Capturing and Forwarding Unity Events

Tags: ,

As mentioned in last week’s article on the “pure code” approach to Unity code design, capturing events can be problematic. I gave an example of how this could be overcome, but didn’t flesh it out to cover the sixty events that a MonoBehaviour can receive. Today’s article includes the source code for a class that does just that. It should prove useful to anyone interested in exploring “pure code” design.

Read the rest of this article »

5 Comments

A Pure Code Approach to Unity App Code Design

There are many ways to design your Unity app from a coding perspective. Today’s article talks about just one path you might take. Like any path, it’ll have its own advantages and disadvantages. The choice of app code design will make a huge impact, so it’s good to think about it before you start down any path. Perhaps this is the right one for you…

Read the rest of this article »

4 Comments

Unity App Structure from a Flash Perspective

Tags: , , , , ,

Unity apps are structured very strangely. They’re a lot different than Flash or standalone apps and definitely take some time to get used to. Today’s article is an introduction to how a Unity app’s code is structured from the perspective of a Flash developer. It should give a basic understanding of where your code goes and how the basic architecture of a Unity app looks.

Read the rest of this article »

3 Comments

From AS3 to C#, Part 23: Conclusion

Today’s article wraps up the series with some closing thoughts comparing and contrasting AS3 and C#.

Read the rest of this article »

No Comments

From AS3 to C#, Part 22: Multi-Threading and Miscellany

Tags: , , , ,

Today’s article is the final installment in the series before we wrap things up next week. We’ll talk about C#’s built-in support for multi-threading and cover some odds and ends that were missed in the previous articles.

Read the rest of this article »

No Comments

From AS3 to C#, Part 21: Unsafe Code

Tags: , , , , ,

The series is nearing an end! In today’s article we’ll cover so-called “unsafe” code that gives you unprecedented access to system memory. You can use this to optimize your app or integrate with native (e.g. C, C++) code and APIs. Read on to learn more about this powerful C# tool!

Read the rest of this article »

4 Comments

From AS3 to C#, Part 20: Preprocessor Directives

Tags: ,

Today’s article continues the series by looking at C#’s preprocessor support, which is like an expanded version of AS3’s compile-time constants and conditional compilation. Read on to learn about all the strange (and powerful) #something lines you can put in your code.

Read the rest of this article »

2 Comments

From AS3 to C#, Part 19: SQL-Style Queries With LINQ

Tags: ,

The series continues today by looking at C#’s SQL-style queries called LINQ. These don’t run on a database, but rather query in-memory objects like arrays. Read on to learn about this powerful tool for writing extremely concise, readable code.

Read the rest of this article »

2 Comments

From AS3 to C#, Part 18: Resource Allocation and Cleanup

Tags: , , , , ,

Today we continue the series by looking at how resources—primarily memory—are acquired and cleaned up in C#. We’ll go way beyond the new operator and discuss advanced features like finalizers and using blocks that can make releasing resources much less prone to errors. Read on to learn!

Read the rest of this article »

No Comments

From AS3 to C#, Part 17: Conditionals, Exceptions, and Iterators

Tags: , , , , , , , , , , ,

Continuing the series on C# syntax, today we’ll look at the differences an AS3 programmer can expect to encounter when using conditionals (if/else, switch/case/break/goto) and exceptions (try/catch/finally/throw). We’ll also look at iterators, an all-new category for AS3 programmers that empowers us to both iterate however we want and to write coroutines, a kind of lightweight pseudo-thread.

Read the rest of this article »

4 Comments