emailGitHubLinkedIn

Unity: Strongly Typed Game Object Fields—How and Why

Often in Unity one game object in a scene must reference another. Unity lets us do this by adding a public field to a script, which we can then set within Unity's inspector to another object. For example, let's say we have an enemy object that needs a reference to a weapon object.

More »

…And we're back

Hi there. Welcome to my software development portfolio, where I host my personal projects and opine about programming-related matters. If you scroll past this post, you may notice a large discrepancy in post dates. I originally created this site to break into the software development field, but I'm afraid that once I landed a position, updating this site took a low priority, and it fell into disuse. But lately I've begun pursuing some new personal projects, and I wanted a place to share them as well as my thoughts and findings while working on them. In particular, I've begun working with the Unity game engine, and I plan to document my learning process and share tips with other developers. So I've revamped this portfolio site, converting the entire thing to WordPress from the custom PHP I wrote way back when, and have begun migrating the old content over. So far I've brought over all my blog posts from before, but I'm still working on transferring my old projects. These will eventually find their way to the Projects page, and new projects will get posted there as well. In the meantime, I plan to begin writing new blog posts in earnest, so check back often for new content, or follow me on Twitter for the latest updates (and other assorted ramblings).

More »

A .NET Dev Learns Unity, Part 1—First Impressions

Welcome to "A .NET Dev Learns Unity," a series of blog posts in which I explore the world of game development using the Unity game engine. I've wanted to get into game development for some time now, and Unity promises a robust, mature platform for creating both 2D and 3D games. Games can be published to an impressive array of platforms—Windows, Mac OS X, Linux, iOS, Android, web browsers, game consoles such as PlayStation 3 and Xbox 360, and more. And most compelling, from my perspective, is that it uses C# as a primary scripting language.

More »

Beware Thread.FreeNamedDataSlot (and other tips regarding thread-local storage in .NET)

Recently I had to resolve an issue with a .NET data-access library storing data in thread-specific named data slots. The library used named data slots (via System.Threading.Thread's GetData and SetData methods) to store static variables without sharing them between threads. But when using this library in a WCF service called by two programs at the same time, a problem occurred: after one program finished using the library, the second program failed.

More »

Setting the body element's id attribute to use page-specific CSS rules

Sometimes a web design requires CSS rules specific to a page. Perhaps you want to highlight the current page in the site navigation, or change the typography to match a page's theme. You could write a separate CSS file containing such rules for each page, but this can lead to writing the same or similar rules in multiple places, violating the DRY principle and making maintenance error-prone. Also, if your site has a lot of pages, or if one script can generate different pages depending on user input, creating CSS files with rules specific to each may be undesirable or impossible. But there's another way: setting the id attribute of the page's element, and writing CSS rules specific to elements with that id.

More »