<?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>Matthew Miner &#187; Software Development</title>
	<atom:link href="http://www.matthewminer.com/topics/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthewminer.com</link>
	<description>Multimedia and Technology Aficionado</description>
	<lastBuildDate>Sun, 04 Dec 2011 22:34:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Faking Namespaces in Unity</title>
		<link>http://www.matthewminer.com/2011/faking-namespaces-in-unity/</link>
		<comments>http://www.matthewminer.com/2011/faking-namespaces-in-unity/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 03:30:12 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://www.matthewminer.com/2011/faking-namespaces-in-unity/</guid>
		<description><![CDATA[Fake it until you make it. Or until somebody else makes it. &#8212; Alfred Mirek Recently the devilishly handsome Nick Breslin asked about an alternative to namespaces in Unity. Namespaces are a familiar concept to C# programmers that solve the problem of naming collisions, but Unity has yet to support them. The documentation promises that [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>Fake it until you make it. Or until somebody else makes it. <span class="author">&#8212; Alfred Mirek</span></p></blockquote>
<p>Recently the devilishly handsome Nick Breslin <a href="http://twitter.com/#!/KegOfGlory/status/34843233922060288">asked</a> about an alternative to namespaces in Unity. Namespaces are a familiar concept to C# programmers that solve the problem of naming collisions, but Unity has yet to support them. The <a href="http://unity3d.com/support/documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html">documentation</a> promises that this limitation &#8220;will be removed in a future version,&#8221; but don&#8217;t hold your breath. You need to breathe.<span id="more-205"></span></p>
<p>If you&#8217;re unaware of what namespaces are, you probably won&#8217;t care about this post. If you&#8217;re a Unity programmer familiar with the construct, you still probably won&#8217;t find it overly enthralling. Heck, even I have difficulty mustering enthusiasm about the subject. The reason is that you&#8217;re unlikely to encounter naming collisions as a game developer. The issue arises when building libraries to be used by other developers. Distribute a class named <code>Player</code> in your .unitypackage and watch as disgruntled developers ask why Unity&#8217;s console shouts at them. If you&#8217;re distributing code for others to incorporate into their game, it&#8217;s important that it doesn&#8217;t require them to rename their existing scripts.</p>
<p>The solution I offered to Mr. Breslin was the use of nested classes. That is, make your classes the children of a single parent class.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SuperAI <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Pathfinding <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">...</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> BehaviourTree <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">...</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>To separate each class into separate files for better organization, use C#&#8217;s <a href="http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.80).aspx#Y288">partial classes</a>.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-style: italic;">// SuperAIPathfinding.cs</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> SuperAI <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Pathfinding <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">...</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-style: italic;">// SuperAIBehaviourTree.cs</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> SuperAI <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> BehaviourTree <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">...</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>This allows developers implementing your library to have their own <code>Pathfinding</code> class. Unfortunately, it&#8217;s an imperfect solution. If one of the nested classes inherits from <code>MonoBehaviour</code>, you are unable to attach it to a game object. Also, Unity prevents two files from having the same name, so if your library contains a file named Pathfinding.cs and the developer has a script named identically, Unity&#8217;s compiler will shake its fist and curse rudely. Furthermore, you can&#8217;t simply jam a <code>using</code> keyword at the top of your class and have the child classes available without the <code>SuperAI</code> accessor.</p>
<p>Of course, other options are available. For one, your library can be distributed in assembly (<abbr title="Dynamic-Link Library">DLL</abbr>) form and use actual namespaces. But again, classes are unable to inherit from <code>MonoBehaviour</code> and be used as a component. Also, your code becomes unmodifiable once it&#8217;s in <abbr title="Dynamic-Link Library">DLL</abbr> form, which may be undesirable if you want to give developers the ability to make their own tweaks.</p>
<p>The simplest solution, and perhaps the most obvious, is to prefix all class names with the name of your library.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SuperAIPathfinding <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">...</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SuperAIBehaviourTree <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">...</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>When I worked at OverInteractive Media, this is how we avoided naming collisions in dimeRocker&#8217;s client package. With classes like <code>Util</code> and <code>Debug</code>, we needed to ensure that our naming decisions wouldn&#8217;t cause grief for developers using the service. We simply prefixed every class name with &#8220;dr&#8221;; no nested classes, partial classes, or awkwardly named files. We needed scripts that inherited from <code>MonoBehaviour</code> and which could be modified by the developer, so this option was also our only one.</p>
<p>As usual, the simplest solution is often the most effective. While faking namespaces through a combination of nested and partial classes might strike your fancy, simply giving your classes unique names might be the best choice for keeping those dastardly naming collisions to a minimum.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2011/faking-namespaces-in-unity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unity Cutscene Editor Initial Release</title>
		<link>http://www.matthewminer.com/2010/unity-cutscene-editor-initial-release/</link>
		<comments>http://www.matthewminer.com/2010/unity-cutscene-editor-initial-release/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 01:36:45 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[summerofcode]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/?p=114</guid>
		<description><![CDATA[I&#8217;m going to remake The Godfather&#8230; in 3D! &#8212; Zhang Rou Today I&#8217;m releasing the cutscene editor I worked on as part of Unity&#8217;s Summer of Code last year. The version number is 0.1 &#8212; it&#8217;s several features short of what I envisioned and it&#8217;s not as user-friendly as I&#8217;d like it to be &#8212; [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>I&#8217;m going to remake The Godfather&#8230; in 3D! <span class="author">&#8212; Zhang Rou</span></p></blockquote>
<p>Today I&#8217;m releasing the cutscene editor I worked on as part of Unity&#8217;s Summer of Code last year.<span id="more-114"></span> The version number is 0.1 &#8212; it&#8217;s several features short of what I envisioned and it&#8217;s not as user-friendly as I&#8217;d like it to be &#8212; but I feel it&#8217;s important to get the existing code out there for other eyes to see. What&#8217;s missing now is a sample scene, proper documentation, transitions, and a decent live preview, among other things. The &#8220;filters&#8221; concept (which basically applies full-screen effects to cameras) is half-baked. Transitions didn&#8217;t even make it to the oven. In other words, not all functionality you might expect is there, and the usability is frightening.</p>
<p>With that disclaimer out of the way, I intend to continue improving the editor and get it to the point where it&#8217;s indispensable to developers building cutscenes. I have set up <a href="http://code.google.com/p/silverscreen/">a project</a> on Google Code where the .unitypackage can be <a href="http://code.google.com/p/silverscreen/downloads/list">downloaded</a>. The code hasn&#8217;t yet been saved to a subversion repository, but it will be shortly. The code is licensed under the liberal MIT license, so feel free to use it however you wish. I welcome any and all contributions; additional developers would be fantastic. Bug reports and feature requests, which I encourage you to make, can be logged on the <a href="http://code.google.com/p/silverscreen/issues/list">issue tracker</a>.</p>
<p>If you have any questions or would like to lend your developer talent, you can email me at <a href="mailto:matthew@matthewminer.com">matthew@matthewminer.com</a>. In the coming weeks I&#8217;ll make some posts on how to use the tool, and hopefully some improvements as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2010/unity-cutscene-editor-initial-release/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dashing Coroutines for an Improved Coding Experience</title>
		<link>http://www.matthewminer.com/2010/dashing-coroutines-for-an-improved-coding-experience/</link>
		<comments>http://www.matthewminer.com/2010/dashing-coroutines-for-an-improved-coding-experience/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 23:32:51 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[dimeRocker]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/?p=103</guid>
		<description><![CDATA[I&#8217;ve had enough of your mumbo jumbo. Unless your mumbo jumbo encompasses coroutines. Those I dig. &#8212; Kaj Gottlob After my last two borderline useless posts, perhaps today&#8217;s code snippet will be more valuable. I&#8217;m optimistic. In the dimeRocker Unity client, of which I&#8217;m a developer, coroutines are used to send information to and from [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>I&#8217;ve had enough of your mumbo jumbo. Unless your mumbo jumbo encompasses coroutines. Those I dig. <span class="author">&#8212; Kaj Gottlob</span></p></blockquote>
<p>After my <a href="/2010/a-new-medium-for-the-scrolling-marquee/">last</a> <a href="/2010/blink-blink-blink/">two</a> borderline useless posts, perhaps today&#8217;s code snippet will be more valuable. I&#8217;m optimistic.</p>
<p>In the <a href="http://dimerocker.com/developers">dimeRocker Unity client</a>, of which I&#8217;m a developer, coroutines are used to send information to and from the servers. Conveniently, coroutines can execute in parallel with your own code or they can be called from another coroutine in order to wait for their completion. Such functionality is useful in Unity for a number of purposes, and seasoned developers will certainly be familiar with them.<span id="more-103"></span></p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">IEnumerator Start <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Wait for user information to be retrieved</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">yield</span> <span style="color: #0600FF; font-weight: bold;">return</span> StartCoroutine<span style="color: #008000;">&#40;</span>drClient<span style="color: #008000;">.</span><span style="color: #0000FF;">User</span><span style="color: #008000;">.</span><span style="color: #0000FF;">FetchUser</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Download friends' profiles without waiting</span><br />
&nbsp; &nbsp; StartCoroutine<span style="color: #008000;">&#40;</span>FetchAllFriends<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>In the code above, the first coroutine finishes execution before the second one starts. An easily made mistake though is to call a coroutine without using <code>StartCoroutine</code>, as you would a regular method. In this scenario, the coroutine instructions aren&#8217;t executed and no errors are thrown. Luckily there&#8217;s a way to prevent such a ghastly mistake. Let&#8217;s say I have the following coroutine.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">IEnumerator FetchSomeInfoCoroutine <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">...</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>Tantalizing, I know. If I add an additional function that returns a <code>Coroutine</code> object&#8230;</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> Coroutine FetchSomeInfo <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> StartCoroutine<span style="color: #008000;">&#40;</span>FetchSomeInfo<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>I can now execute the contents of the coroutine simply by calling the public <code>FetchSomeInfo</code> method. I don&#8217;t even have to be aware that I&#8217;m executing a coroutine. If I wish to wait for the instructions to complete, I can still pair the method with a <code>yield</code> statement.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">IEnumerator Start <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Execute contents of coroutine</span><br />
&nbsp; &nbsp; FetchSomeInfo<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Execute contents of coroutine and wait for it to finish</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">yield</span> <span style="color: #0600FF; font-weight: bold;">return</span> FetchSomeInfo<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>As you can see, eliminating the need for <code>StartCoroutine</code> makes the code cleaner and more bulletproof (I myself have made the mistake of calling a coroutine directly, to great frustration). Of course, there is a downside to this method of calling coroutines, which is the reason why the dimeRocker Unity client still requires, for the most part, the use of <code>StartCoroutine</code>: developers currently calling coroutines are familiar with using <code>StartCoroutine</code>, and sending it a method that returns a <code>Coroutine</code> object will cause the compiler to throw an error. But, hopefully developers working on libraries to be used with Unity will adapt this system and folks will get used to it, and we can all have the elegant, &#8220;there&#8217;s no way you can screw this up&#8221; code we desire. I&#8217;m optimistic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2010/dashing-coroutines-for-an-improved-coding-experience/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Summer of Code: Progress Report on Unity3D Blog</title>
		<link>http://www.matthewminer.com/2009/summer-of-code-progress-report-on-unity3d-blog/</link>
		<comments>http://www.matthewminer.com/2009/summer-of-code-progress-report-on-unity3d-blog/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:00:10 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[summerofcode]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=27</guid>
		<description><![CDATA[I am overjoyed at your ability to use hyperlinks. &#8212; D.B. Cooper Recently a somewhat detailed progress report about my Cutscene Editor was posted on the Unity3D blog. Rather than copying and pasting the post here, I reckon I&#8217;ll link to the article instead. Enjoy!]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>I am overjoyed at your ability to use hyperlinks. <span class="author">&#8212; D.B. Cooper</span></p></blockquote>
<p>Recently a somewhat detailed progress report about my Cutscene Editor was posted on the Unity3D blog. Rather than copying and pasting the post here, I reckon I&#8217;ll <a href="http://blogs.unity3d.com/2009/08/21/summer-of-code-progress-of-cutscene-editor/">link to the article</a> instead. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2009/summer-of-code-progress-report-on-unity3d-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Event.Use() and Scroll Views</title>
		<link>http://www.matthewminer.com/2009/event-use-and-scroll-views/</link>
		<comments>http://www.matthewminer.com/2009/event-use-and-scroll-views/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 01:00:16 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=25</guid>
		<description><![CDATA[A scroll view that tries to reveal its content, how utterly pointless. &#8212; Matthew Miner Today&#8217;s Unity discovery: calling Event.Use() every time the OnGUI() function runs will cause scroll views to not work. At least, they won&#8217;t respect any dimensions you set and will simply stretch to accommodate the elements contained within it. &#8220;A scroll [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>A scroll view that tries to reveal its content, how utterly pointless. <span class="author">&#8212; Matthew Miner</span></p></blockquote>
<p>Today&#8217;s Unity discovery: calling <code>Event.Use()</code> every time the <code>OnGUI()</code> function runs will cause scroll views to not work. At least, they won&#8217;t respect any dimensions you set and will simply stretch to accommodate the elements contained within it. &#8220;A scroll view that tries to reveal its content, how utterly pointless.&#8221; Those were my exact words.<span id="more-25"></span></p>
<p>In code form, I had something like this:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Vector2 scroll<span style="color: #008000;">;</span><br />
<br />
<span style="color: #6666cc; font-weight: bold;">void</span> OnGUI <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; scroll <span style="color: #008000;">=</span> EditorGUILayout<span style="color: #008000;">.</span><span style="color: #0000FF;">BeginScrollView</span><span style="color: #008000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scroll,<br />
&nbsp; &nbsp; &nbsp; &nbsp; GUILayout<span style="color: #008000;">.</span><span style="color: #0000FF;">Width</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">50</span><span style="color: #008000;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; GUILayout<span style="color: #008000;">.</span><span style="color: #0000FF;">Height</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">200</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; GUILayout<span style="color: #008000;">.</span><span style="color: #0000FF;">Label</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;I like big labels and I cannot lie.&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; EditorGUILayout<span style="color: #008000;">.</span><span style="color: #0000FF;">EndScrollView</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">Event</span><span style="color: #008000;">.</span><span style="color: #0000FF;">current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">type</span> <span style="color: #008000;">==</span> EventType<span style="color: #008000;">.</span><span style="color: #0000FF;">KeyDown</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Debug<span style="color: #008000;">.</span><span style="color: #0000FF;">Log</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;You've pressed a key. Righteous.&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">Event</span><span style="color: #008000;">.</span><span style="color: #0000FF;">current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Use</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>The scroll view is most certainly not 50 pixels wide. Moving <code>Event.current.Use()</code> inside the if statement fixes it though.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">Event</span><span style="color: #008000;">.</span><span style="color: #0000FF;">current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">type</span> <span style="color: #008000;">==</span> EventType<span style="color: #008000;">.</span><span style="color: #0000FF;">KeyDown</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; Debug<span style="color: #008000;">.</span><span style="color: #0000FF;">Log</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;You've pressed a key. Righteous.&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">Event</span><span style="color: #008000;">.</span><span style="color: #0000FF;">current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Use</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>And all is well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2009/event-use-and-scroll-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer of Code: Week Two</title>
		<link>http://www.matthewminer.com/2009/summer-of-code-week-two/</link>
		<comments>http://www.matthewminer.com/2009/summer-of-code-week-two/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:22:27 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[summerofcode]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=23</guid>
		<description><![CDATA[Shouldn&#8217;t you be done by now? &#8212; Harold K. Bullard A new requirement for the Summer of Code is to give weekly progress reports detailing what we&#8217;ve accomplished in the past week as well as what we intend to conjure up in the next one. I figure to give the old blog some love, I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>Shouldn&#8217;t you be done by now? <span class="author">&#8212; Harold K. Bullard</span></p></blockquote>
<p>A new requirement for the Summer of Code is to give weekly progress reports detailing what we&#8217;ve accomplished in the past week as well as what we intend to conjure up in the next one. I figure to give the old blog some love, I&#8217;d post my progress reports here.<span id="more-23"></span></p>
<h3>Week 1</h3>
<ul>
<li>Determined desired features</li>
<li>Fleshed out media metaphors presented to user (shots, actors, audio and subtitles)</li>
<li>Basic user interface setup</li>
<li>Researched animations and animation events</li>
</ul>
<h3>Week 2</h3>
<ul>
<li>Classes: media, tracks, clips are objects</li>
<li>Media can be added to timeline</li>
<li>Playback: camera toggling, audio and subtitles</li>
<li>More user interface setup
<ul>
<li>Custom inspectors</li>
<li>A scrubbable timeline</li>
<li>Drag and drop media from project Hierarchy and Assets view</li>
</ul>
</li>
<li>Reviewed third-party code contribution</li>
</ul>
<h3>Week 3</h3>
<ul>
<li>Add ability to add actors</li>
<li>Clip editing: drag clips to a new position on timeline</li>
<li>Manage overlapping elements</li>
<li>Make a zoomable timeline (currently it&#8217;s at a fixed zoom level)</li>
<li>Razor tool</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2009/summer-of-code-week-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer of Code: A Week and a Half In</title>
		<link>http://www.matthewminer.com/2009/summer-of-code-a-week-and-a-half-in/</link>
		<comments>http://www.matthewminer.com/2009/summer-of-code-a-week-and-a-half-in/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 01:40:16 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[summerofcode]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=21</guid>
		<description><![CDATA[I hope your software is of higher quality than your analogies. &#8212; Bill Bowerman Work on the Cutscene Editor has been progressing steadily. The GUI is starting to come together and actually resemble a cutscene editor (whatever the heck that looks like; I conveniently have no point of comparison). Building the editor window controls has [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>I hope your software is of higher quality than your analogies. <span class="author">&#8212; Bill Bowerman</span></p></blockquote>
<p>Work on the Cutscene Editor has been progressing steadily. The <abbr title="Graphical User Interface">GUI</abbr> is starting to come together and actually resemble a cutscene editor (whatever the heck that looks like; I conveniently have no point of comparison).<span id="more-21"></span> Building the editor window controls has been frustrating at times, but ultimately rewarding. Frustrating because the documentation can leave much to be desired. Rewarding because the ability to extend the editor is sensational. It&#8217;s like a roller coaster, but it code form and without the long lineups.</p>
<p><a href="/?attachment_id=365"><img src="/wordpress/wp-content/uploads/2011/05/cutscene_editor_0.1-440x163.png" alt="Cutscene Editor 0.1" title="Cutscene Editor 0.1" class="size-medium wp-image-365" /></a></p>
<p>Above is a screenshot of the current version. Let&#8217;s call it 0.1. If it looks terribly unusable, that&#8217;s because it is. But don&#8217;t you fret, <em>it will be awesome</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2009/summer-of-code-a-week-and-a-half-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding a Cutscene</title>
		<link>http://www.matthewminer.com/2009/coding-a-cutscene/</link>
		<comments>http://www.matthewminer.com/2009/coding-a-cutscene/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:55:17 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[summerofcode]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=19</guid>
		<description><![CDATA[I would have pitched a Hello Kitty GUI skin. Way more useful than a friggin&#8217; cutscene editor. &#8212; Olof &#214;hman Today I was accepted into Unity&#8217;s Summer of Code. In their wise words, it&#8217;s &#8220;a program through which we offer indie &#38; student developers the chance to get paid for doing something cool in Unity.&#8221; [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p>I would have pitched a Hello Kitty GUI skin. Way more useful than a friggin&#8217; cutscene editor. <span class="author">&#8212; Olof &Ouml;hman</span></p></blockquote>
<p>Today I was accepted into Unity&#8217;s <a href="http://www.unity3d.com/usc/">Summer of Code</a>. In their wise words, it&#8217;s &#8220;a program through which we offer indie &amp; student developers the chance to get paid for doing something cool in Unity.&#8221;<span id="more-19"></span> Applicants pitch an idea and if it&#8217;s accepted they get cash, a mentor, and six weeks to complete their project. It&#8217;s a rather fine program I reckon &#8212; there&#8217;s some intimidating talent in the Unity community and a never-ending need for more Awesome Stuff.</p>
<p>My particular idea was to create a <strong>Cutscene Editor</strong> to facilitate easy creation of realtime cutscenes by developers and filmmakers alike. Think of it as merging Final Cut with Unity, but working with in-game cameras and animations rather than video footage. Creating cutscenes in Unity is currently a bit of a drag and requires the developer to whip out their trusty script editor. The goal of this project is to make such whipping unnecessary, and to make it possible for video editors to work with elements like clips, transitions, and effects in a familiar way. If this sounds interesting to you (and I sincerely hope it does), I encourage you to take a look at <a href="/wordpress/wp-content/uploads/2010/05/usc_proposal.pdf">my proposal</a> [<abbr title="Portable Document Format">PDF</abbr>].</p>
<p>Over the next six weeks I&#8217;ll be posting about my progress here and on the <a href="http://forum.unity3d.com/">forum</a>. Naturally I&#8217;d love to hear any feedback and ideas you might have. My development time is fairly limited, but in the given month and a half I hope to make this tool as useful as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2009/coding-a-cutscene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically Loading XML in Flex</title>
		<link>http://www.matthewminer.com/2008/dynamically-loading-in-flex/</link>
		<comments>http://www.matthewminer.com/2008/dynamically-loading-in-flex/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 16:05:28 +0000</pubDate>
		<dc:creator>Matthew Miner</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://matthewminer.com/wordpress2/?p=11</guid>
		<description><![CDATA[XML? Ha! I once wrote some XML! Hilarious! &#8212; Juan Jos&#233; P&#233;rez Hern&#225;ndez This winter I built a basic video player for a website using Adobe Flex. Beside the viewer was a list of thumbnail images, one for each video. When clicked on these would load the appropriate video and display relevant information below the [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="quote"><p><abbr title="Extensible Markup Language">XML</abbr>? Ha! I once wrote some <abbr title="Extensible Markup Language">XML</abbr>! Hilarious! <span class="author">&#8212; Juan Jos&eacute; P&eacute;rez Hern&aacute;ndez</span></p></blockquote>
<p>This winter I built a basic video player for a website using Adobe Flex. Beside the viewer was a list of thumbnail images, one for each video. When clicked on these would load the appropriate video and display relevant information below the viewer. This information, as well as the paths to the videos and thumbnail images, was stored in an external <abbr title="Extensible Markup Language">XML</abbr> file. The player worked well, perhaps even excellent, until some of the information in the <abbr title="Extensible Markup Language">XML</abbr> file was changed.<span id="more-11"></span> The video player still worked, but the new information was nowhere to be found. Below is the tag I used to load the <abbr title="Extensible Markup Language">XML</abbr> data.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:XML</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;vidXML&quot;</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;videos.xml&quot;</span> <span style="color: #000066;">format</span>=<span style="color: #ff0000;">&quot;e4x&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<p>To my surprise, using this tag causes the <abbr title="Extensible Markup Language">XML</abbr> data to be compiled into the .swf rather than loaded at runtime. Making a change to videos.xml didn&#8217;t do a thing &#8212; indeed, it wasn&#8217;t even necessary that the <abbr title="Extensible Markup Language">XML</abbr> file exist after compilation.</p>
<p>Now, this is not the behaviour I desired. I wanted to allow others to modify the contents of the <abbr title="Extensible Markup Language">XML</abbr> file and have their changes reflected in the <abbr title="Shockwave Flash">SWF</abbr>. The solution was to not use the Flex <abbr title="Extensible Markup Language">XML</abbr> tag at all, but rather to use the following code.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;xmlReq.send();&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HTTPService</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;xmlReq&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;videos.xml&quot;</span> <span style="color: #000066;">resultFormat</span>=<span style="color: #ff0000;">&quot;e4x&quot;</span> <span style="color: #000066;">result</span>=<span style="color: #ff0000;">&quot;toXMLFormat(event)&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #339933;">&lt;![CDATA[</span><br />
<span style="color: #339933;">&nbsp; &nbsp; import mx.rpc.events.ResultEvent;</span><br />
<br />
<span style="color: #339933;">&nbsp; &nbsp; private var vidXML:XML;</span><br />
<br />
<span style="color: #339933;">&nbsp; &nbsp; private function toXMLFormat(event:ResultEvent):void {</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; vidXML = event.result as XML;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; }</span><br />
<span style="color: #339933;">]]&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>I&#8217;m relatively new to the Flex game, so this may seem obvious to veterans in the field, but for new Flexers (Flexies? Flexettes?) it&#8217;s perhaps something to take note of. I sure wish I had.</p>
<p>Sigh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewminer.com/2008/dynamically-loading-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

