<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>2 Cents on MMOs &#187; Unity3D game development</title>
	<atom:link href="http://pennymo.com/tag/unity3d-game-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://pennymo.com</link>
	<description>My random musings about the gaming industry</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:56:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XML and Unity3D</title>
		<link>http://pennymo.com/2009/11/21/xml-and-unity-3d/</link>
		<comments>http://pennymo.com/2009/11/21/xml-and-unity-3d/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 01:46:36 +0000</pubDate>
		<dc:creator>Noir</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Unity3D game development]]></category>

		<guid isPermaLink="false">http://pennymo.com/?p=182</guid>
		<description><![CDATA[I needed to be able to save game state, and I wanted to communicate back and forth with websites, and I needed the files to be human readable, and I needed it to be easy [I have been told I am very needy]. The best thing for me to do was to figure out how [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to be able to save game state, and I wanted to communicate back and forth with websites, and I needed the files to be human readable, and I needed it to be easy [I have been told I am very needy]. The best thing for me to do was to figure out how to read, and write, XML inside Unity3D. It&#8217;s a web plugin right? it should support XML processing, and the DOM model right? Well, yes, yes it does.</p>
<h1>How does Unity3D do XML?</h1>
<p>Well, Unity3D uses the Mono implementation of the .net XML processor. Honestly I didn&#8217;t really want to know this, I just wanted to process XML. [did I mention that I am both needy AND demanding?].</p>
<p>In Unity3D (for 2.5 and 2.6 at least) it turns out that XML is best processed through C#.</p>
<p>What you need to do</p>
<ul>
<li>Write file open functions in C#</li>
<li>Write XML read and write functions in C#</li>
<li>write a function to read  the XML and process the results</li>
<li>write a function to write game data in XML</li>
<li>Optional: Read and write lists</li>
</ul>
<p>The instructions are a bit confusing, you may just want to Skip them and, just read source code: <a href="http://pennymo.com/wp-content/uploads/2009/11/RnWXML.cs">Read and Write XML from Unity3D</a>.</p>
<h2>Calling C# from JavaScript in Unity3D</h2>
<p>My project is coded in JavaScript, because it is the most productive. But, even though calling the .net functions can be done from JavaScript, it is still a bit of a mystery.  Processing XML is most natural through C#. So now I will have a project that uses both C# and JavaScript.</p>
<h2>Fiddly bit of Unity3D magic</h2>
<p>The first thing you have to know is that the C# files have to be &#8220;built&#8221; first, so the class names can be known to the JavaScript compiler.  The Unity3D documentation mentions that files in the Plugins or Editor folders get built before JavaScript.</p>
<ol>
<li>Create a C# file, place it in the Plugins directory</li>
</ol>
<p>I&#8217;ll cover how to call the C# stuff from JavaScript later.</p>
<h2>Stuff you need to include for C# into Unity3D</h2>
<pre>using UnityEngine;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using System.Text;</pre>
<p>Unfortunately this (currently) causes a cascade of includes, and you will notice the size of your plugin BLOAT bigtime.</p>
<h2>Opening the file</h2>
<p>It turns out that you will want to open your save file one way for read, and another way for write.</p>
<p>Most of the howtos on the web show reading and writing an XML file by opening a Stream. I found it is MUCH easier to open a stream to write, and open a &#8220;TextReader&#8221; for read.</p>
<p>but first, your C# class needs to be defined:</p>
<pre>public class GameXML : MonoBehaviour
{
 string _FileLocation,_FileName;
 StreamWriter _writer;
 TextReader _reader;</pre>
<p>Then you can open the file. I created one function for read and another for write.</p>
<pre style="padding-left: 30px;">public void OpenSaveFileForWrite()
 {
 FileInfo t = new FileInfo(_FileLocation+"\\"+ _FileName);
 if(!t.Exists)
 {
 _writer = t.CreateText();
 }
 else
 {
 t.Delete();
 _writer = t.CreateText();
 }
 }

 public void OpenSaveFileForRead()
 {
 FileInfo t = new FileInfo(_FileLocation+"\\"+ _FileName);
 if(t.Exists)
 {
 _reader = t.OpenText();
 }
 else
 {
 Debug.Log("SaveFile NotFound");
 }
 }</pre>
<p>Yeah Ok, so I am not taking time to figure out indenting. You can check out formatted code in the included sourcecode.</p>
<h2>Using Unity3D to write XML, it really is just two function calls</h2>
<p>Well, you need a class that describes your games&#8217; save data, but once you have that, all you need to do is turn it into a single text string (Serialization) then write the file out. Also once the data has been serialized, it can be written out using debug routines or printf or whatever, it&#8217;s just a big text string.</p>
<pre>public void WriteGameDataAndTurnSequence(GameSaveGame SGDat )
 {
 string _data = SerializeGame(SGDat);
 Debug.Log("Game Sequence looks like:" + _data); 

 _writer.Write(_data);
 }</pre>
<p>That&#8217;s it&#8230;Well sort of. The GameSaveGame class needs a little esplination. The function above is called from JavaScript. You can pass a reference to a class back and forth between JavaScript and C#. As long as that class has all the data you need then your good. BUT the tricky bit is building a class structure that describes all the data you need. For most games you&#8217;ll have structured data and lists that need to be read and written. This can get a little messy.</p>
<h1>Templates, and sequences classes, Oh My</h1>
<p>Your Serialize function will serialize ONE instance of a class. So in order to read and write complex data, you need to create a russian doll set of class constructs. Lists of class elements held by a &#8220;top level&#8221; class.</p>
<p>Ok, this gets messy. I want to write out a list of turns. the .net serialization can serialize a templated List. This is powerful, it means I can write out a list of arbitrary structure.What you need to know is that you will likely want to define 3 classes:</p>
<p>That One class can contain a Sequence(and tons and tons of other stuff). The Sequence is a class that contains a list of class instances. Your sequence is essentially defined as  a List&lt;ListElementClass&gt;. The Class definition the Sequence, actually sequences is the class definition that holds your actual game data.</p>
<p>Confused? I sure was.</p>
<p>Bottom line, create 3 class definitions in your C# file.</p>
<ol>
<li>One &#8220;top level&#8221; class that defines the top level structure of your game</li>
<li>One (or more) &#8220;Sequence&#8221; classes that hold lists of data</li>
<li>One &#8220;List Element&#8221; class that describes the data in each list element</li>
</ol>
<h3>Top Level</h3>
<p>So my &#8220;top level&#8221; class just needs to really define two members, one for &#8220;settings&#8221; and one for the game&#8217;s turn list.</p>
<pre>public class GameSaveGame
{
 public GameData GameSettings;
 public GameSequence Turns;

 public GameSaveGame()
 {
 GameSettings = new GameData();
 Turns = new GameGameSequence();
 }

 public GameSaveGame(GameData pData, GameSequence pGS)
 {
 GameSettings = pData;
 Turns = pGS;
 }
}</pre>
<h3>Sequence</h3>
<p>my Sequence  GameSequence class so that it would be easy to add elements and stuff like that.</p>
<pre>public class GameSequence
{
 public List&lt;TurnData&gt; TurnList = new List&lt;TurnData&gt;();
 private int Sequence = 0; 

 public GameSequence () { }</pre>
<p>Thee are more convenience functions in the source code, but you get the Idea. Finally, the sequence is a sequence of &#8220;TurnData&#8221; structures. The &#8220;TurnData&#8221; class actually describes what a turn is.</p>
<h3>List Element</h3>
<p>Finally, the inner most nugget. A simple class that describes the data in each turn.</p>
<pre>public class TurnData
{
 public TurnData (){ Unconditional = false; SequenceNum = 0;}
 public TurnData ( int x, int y, int z, int PID, bool cond, int seq)
 {
 X = x;
 Y = y;
 Z = z;
 PlayerID = PID;
 Unconditional = cond;
 SequenceNum = seq;
 }</pre>
<h1>Reading XML with Unity3D</h1>
<p>Reading is just as easy as writing, but I recommend using a different type of stream to read and parse the XML. Extracting XML into game data is just two steps</p>
<ol>
<li>Open the file for read</li>
<li>De-serialize</li>
</ol>
<h2>Open the file for read&#8230;.</h2>
<pre>public void OpenSaveFileForRead()
 {
 FileInfo t = new FileInfo(_FileLocation+"\\"+ _FileName);
 if(t.Exists)
 {
 _reader = t.OpenText();
 }
 else
 {
 Debug.Log("SaveFile NotFound");
 }
 }</pre>
<h2>Reading XML with Unity3D: a little magic</h2>
<p>Here we actually &#8220;do something with XML&#8221;. XmlSerializer is the function that parses the formatted xml data and fills in all those classes you defined.</p>
<pre>GameSaveGame DeserializeGame(TextReader file)
 {
 XmlSerializer xdsg = new XmlSerializer(typeof(GameSaveGame));
 GameSaveGame newGame;
 newGame = (GameSaveGame)xdsg.Deserialize(_reader);
 _reader.Close();
 return newGame;
 }</pre>
<h1>within Unity3D Calling C# from JavaScript</h1>
<p>So, one last thing. How to call the C# functions from Javascript.</p>
<ol>
<li>Declare a variable using the name of the C# file (becomes the class name)</li>
<li>Get the instance of that class</li>
<li>Fill a data structure with your game save data</li>
<li>call your unity3D save/load function</li>
</ol>
<p>It looks something like this</p>
<pre>private var SaveLogic : RnWXML; // note I put my CSharp files in the Plugins directory
SaveLogic = GameRootClass.GetComponent(RnWXML);
var NewGame : SaveGame = SaveLogic.ReadSaveGame(); // the SaveGame class is defined in SaveLogic C#</pre>
<p>I hope this help someone. There are a lot of twiddly bits of magic that need to be strung together in order to read and write XML. What I have NOT done yet is read and write XML from a URL, which will mean opening up a stream reader and writer to an HTTP connection.</p>
<p>That will be interesting, facebook might be a good source of XML&#8230;.<br />
<!-- For more information on installing this code, visit:http://blog.evri.com/index.php/widget-wordpress/ --></p>
<div id="evri-widget-launcher-blogger" style="width:">
<a href="http://www.evri.com/" title="Get content recommendations from Evri">Content recommendations from <em>Evri </em></a>
</div>
<p><script charset="utf-8" src="http://www.evri.com:80/widget/javascripts/ZeroDestruction.1.js" type="text/javascript"></script><br />
<script charset="utf-8" type="text/javascript">
Evri.$(window).ready(function(){
Evri.API.Environment.articleInIframe = true;
Evri.Widget.ZeroDestruction.initWithURL(window.location.href).renderIn("#evri-widget-launcher-blogger");
});
</script></p>
<p>And if you missed the source code link at the beginning of this post: <a href="http://pennymo.com/wp-content/uploads/2009/11/RnWXML.cs">Read and Write XML from Unity</a></p>
<p><a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Delicious" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Reddit" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Twitter" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Slashdot" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Digg" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Facebook" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/blogger_post?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Blogger Post" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/blogger.png" width="16" height="16" alt="Blogger Post"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="MySpace" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/windows_live_favorites?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D" title="Windows Live Favorites" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Windows Live Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F11%2F21%2Fxml-and-unity-3d%2F&amp;linkname=XML%20and%20Unity3D"><img src="http://pennymo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://pennymo.com/2009/11/21/xml-and-unity-3d/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>They grow up to be so big</title>
		<link>http://pennymo.com/2009/09/11/they-grow-up-to-be-so-big/</link>
		<comments>http://pennymo.com/2009/09/11/they-grow-up-to-be-so-big/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 01:59:58 +0000</pubDate>
		<dc:creator>Noir</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Unity3D game development]]></category>

		<guid isPermaLink="false">http://pennymo.com/?p=157</guid>
		<description><![CDATA[Having objects just &#8220;appear&#8221; may be cool on stage, but in a game, it&#8217;s kinda lame. I needed my game objects to &#8220;grow&#8221; into place so they would catch the players eye.
How to do that in Unity3d? well the unity 3d web forums gave me a hint.
Bottom line is to use the Coroutine function yeild, [...]]]></description>
			<content:encoded><![CDATA[<p>Having objects just &#8220;appear&#8221; may be cool on stage, but in a game, it&#8217;s kinda lame. I needed my game objects to &#8220;grow&#8221; into place so they would catch the players eye.</p>
<p>How to do that in Unity3d? well the <a href="http://forum.unity3d.com/viewtopic.php?t=31892">unity 3d web forums</a> gave me a hint.</p>
<p>Bottom line is to use the Coroutine function yeild, and the Lerp function off of Vector3D.</p>
<p>what I do is instantiate an object from a prefab, then call a function called growObj.</p>
<p>Here is my GrowObj function (NOTE: I leave off the type of the first parameter so it could be called with any object that contains a .transform member)</p>
<pre>
/* groObj function, grow an object fom nothing  to some destination size over a period of time
    go is an object to grow
    toScale is the destination scale preferably the object's original local scale
*/
function growObj( go, toScale: Vector3)
{
	var i = 0.0;
	var rate = 1.0 / GrowTime;
	var StartScale = Vector3.zero;
	while ( i &lt;= 1.0)
	{
		i += Time.deltaTime * rate;
		go.transform.localScale = Vector3.Lerp(StartScale, toScale, i);
		yield;
	}
}</pre>
<div>And another trickey bit. If you are creating a bunch of objects in a loop, like I create a grid of objects, you can grow them one at a time by yielding to the groObj function, or you can have them all grow in at once simply by calling grow Obj;</div>
<div>example of having objects &#8220;grow&#8221; into the scene one at a time (prefab is a variable in your script, and you have dragged and dropped a prefab onto that script)</div>
<h3>Objects grow one at a time</h3>
<pre>	 for (var z = zStart ; z &lt; zEnd; z++ ){
	    var pos = Vector3 (0, 0, z) * 4;
	    var clone;
	    clone = Instantiate(prefab, pos, Quaternion.identity);
	    var DestScale : Vector3 = clone.transform.localScale; // capture the original size of the object
	    yield growObj(clone,DestScale);
	}</pre>
<h3>all objects appear and grow together</h3>
<pre>	 for (var z = zStart ; z &lt; zEnd; z++ ){
	    var pos = Vector3 (0, 0, z) * 4;
	    var clone;
	    clone = Instantiate(prefab, pos, Quaternion.identity);
	    var DestScale : Vector3 = clone.transform.localScale; // capture the original size of the object
	    growObj(clone,DestScale);
	}</pre>
<p>Yup the only difference in the two loops is the yield statement in front of growObj.</p>
<p>That&#8217;s all for now. I hope to make a &#8220;bubble&#8221; grow function some time, where the object will overshoot destination scale once, then undershoot the destination scale once</p>
<p><a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Delicious" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Reddit" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Twitter" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Slashdot" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Digg" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Facebook" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/blogger_post?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Blogger Post" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/blogger.png" width="16" height="16" alt="Blogger Post"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="MySpace" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/windows_live_favorites?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big" title="Windows Live Favorites" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Windows Live Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F11%2Fthey-grow-up-to-be-so-big%2F&amp;linkname=They%20grow%20up%20to%20be%20so%20big"><img src="http://pennymo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://pennymo.com/2009/09/11/they-grow-up-to-be-so-big/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Putting Unity 3D content into WordPress: Futile attempts</title>
		<link>http://pennymo.com/2009/09/04/putting-unity-3d-content-into-wordpress-part-2/</link>
		<comments>http://pennymo.com/2009/09/04/putting-unity-3d-content-into-wordpress-part-2/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 20:08:46 +0000</pubDate>
		<dc:creator>Noir</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Production]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Unity3D game development]]></category>

		<guid isPermaLink="false">http://pennymo.com/?p=93</guid>
		<description><![CDATA[I like using Media Library in Word Press.
When you build a project in Unity3d, select the web build, and pick a seporate folder for unity to put the output file into.
In Wordpress, in Site Admin, click the media link, and upload new media, browse to directory you told unity to dump the files. Select and [...]]]></description>
			<content:encoded><![CDATA[<p>I like using Media Library in Word Press.</p>
<p>When you build a project in Unity3d, select the web build, and pick a seporate folder for unity to put the output file into.</p>
<p>In Wordpress, in Site Admin, click the media link, and upload new media, browse to directory you told unity to dump the files. Select and upload the &#8220;.unity3d&#8221; file</p>
<p>When you downloaded the Wordpress plugin from the Unity support site there is a readme file. That readme file contains examples on the tags you need to place in your blog posts.</p>
<p>here are the instructions from the readme.txt file that comes with the plugin</p>
<blockquote>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">=== Usage Instructions ===</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">With the plugin installed and activated as part of your WordPress blog you can start embedding Unity Web Player content in your posts. Embedding content within your post is done by using a simple tag structure:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p><em>Please view the full post to see the Unity content.</em></p>
</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The outer tag declares the existence of Unity Web Player content, the name/value pairs you provide then determine what content is displayed and how. There is only one required parameter, the src URL for the content to be displayed, all other parameters are optional and if not provided default values will be used instead.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">When adding any of the optional parameters please note that the order you list them is not important. Simply provide each parameter in name=&#8221;value&#8221; format, there should be no spaces before or after the equals sign and the value provided should always be wrapped in double-quotes (the &#8221; character). Additionally you need to separate each of the name/value pairs with an empty space. For example, here is a tag set where the src, height and width are all specified:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 114px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p><em>Please view the full post to see the Unity content.</em></p>
</div>
<blockquote><p>=== Usage Instructions ===</p></blockquote>
<blockquote><p>With the plugin installed and activated as part of your WordPress blog you can start embedding Unity Web Player content in your posts. Embedding content within your post is done by using a simple tag structure:</p></blockquote>
<blockquote><p>\[WP_UnityObject src="http://www.yourdomain.com/yourfile.unity3d" \/\]</p></blockquote>
<blockquote><p>The outer tag declares the existence of Unity Web Player content, the name/value pairs you provide then determine what content is displayed and how. There is only one required parameter, the src URL for the content to be displayed, all other parameters are optional and if not provided default values will be used instead.</p></blockquote>
<blockquote><p>When adding any of the optional parameters please note that the order you list them is not important. Simply provide each parameter in name=&#8221;value&#8221; format, there should be no spaces before or after the equals sign and the value provided should always be wrapped in double-quotes (the &#8221; character). Additionally you need to separate each of the name/value pairs with an empty space.</p></blockquote>
<p>When you upload content into the WordPress Media library, it will give you the URL to your content.</p></blockquote>
<p>Soo&#8230;. let&#8217;s see how it works</p>
<p><em>Please view the full post to see the Unity content.</em></p>
<p></span></span></p>
<p><span style="font-family: 'Lucida Grande'; line-height: normal; font-size: 12px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span style="font-family: Georgia; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 13px; line-height: 19px;">Did it work? </span></span></p>
<p>Well, unfortunately more often than not you&#8217;ll get an error downloading the file.<br />
Reading the developer&#8217;s  <a href="http://blogs.unity3d.com/2009/05/12/the-unity-blogs-are-now-web-player-enabled/comment-page-1/#comment-4153">unity 3d blog</a> it seems some people have had success others may be having the same problem as here.</p>
<p><a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Delicious" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Reddit" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Twitter" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Slashdot" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Digg" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Facebook" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/blogger_post?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Blogger Post" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/blogger.png" width="16" height="16" alt="Blogger Post"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="MySpace" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/windows_live_favorites?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts" title="Windows Live Favorites" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Windows Live Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fputting-unity-3d-content-into-wordpress-part-2%2F&amp;linkname=Putting%20Unity%203D%20content%20into%20WordPress%3A%20Futile%20attempts"><img src="http://pennymo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://pennymo.com/2009/09/04/putting-unity-3d-content-into-wordpress-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A venture into Unity 3D</title>
		<link>http://pennymo.com/2009/09/04/a-venture-into-unity-3d/</link>
		<comments>http://pennymo.com/2009/09/04/a-venture-into-unity-3d/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 18:37:21 +0000</pubDate>
		<dc:creator>Noir</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Production]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Unity3D game development]]></category>

		<guid isPermaLink="false">http://pennymo.com/?p=86</guid>
		<description><![CDATA[I have had Unity 3D for 15 days now. I have to say I am a complete convert.
Sure it has it&#8217;s bugs, and problems like any software, but they are few and far between.
One huge advantage Unity has is the sheer number of blogs and posts and information for developers. I have to say Will [...]]]></description>
			<content:encoded><![CDATA[<p>I have had Unity 3D for 15 days now. I have to say I am a complete convert.</p>
<p>Sure it has it&#8217;s bugs, and problems like any software, but they are few and far between.</p>
<p>One huge advantage Unity has is the sheer number of blogs and posts and information for developers. I have to say <a href="http://www.willgoldstone.com/">Will Goldstone&#8217;s</a> posts at <a href="http://www.learnmesilly.com/">LearnMeSilly.com</a> are some of the best &#8220;Zero to Hero&#8221; tutorials I have ever seen. He is writing a book about Unity I hope he is able to make a comfortable living doing what he has been doing. I know the unity community owes him a lot.</p>
<p>I was able to learn everything I needed to know about Unity in 3 days to start development on a game. What was amazing to me, is that I started this project with a sketch and a plan. and after 15 days. I had a playable game that acutally looked a lot like my sketch.</p>
<p>Part was because Unity is so easy to use, and in my mind that makes it powerful, but also in part due to the sheer amount of content that can be absorbed and used by unity.</p>
<p>But now I need to figure out how to get a unity build to display in a wordpress post. Stay Tuned</p>
<p><a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Delicious" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Reddit" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Twitter" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Slashdot" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Digg" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Facebook" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/blogger_post?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Blogger Post" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/blogger.png" width="16" height="16" alt="Blogger Post"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="MySpace" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/windows_live_favorites?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D" title="Windows Live Favorites" rel="nofollow" target="_blank"><img src="http://pennymo.com/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Windows Live Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpennymo.com%2F2009%2F09%2F04%2Fa-venture-into-unity-3d%2F&amp;linkname=A%20venture%20into%20Unity%203D"><img src="http://pennymo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://pennymo.com/2009/09/04/a-venture-into-unity-3d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
