Unity Script Performance Testing

Tags: , , ,

Today’s article is the first to test Unity script performance speed. It establishes a way to set up and test C# scripts in Unity whether you have access to Pro or not. As a first example, I was reminded by the news this week that AddComponent(string) is being removed in Unity 5.0. These alternative versions of AddComponent and GetComponent aren’t something I normally use, but the news got me thinking of their performance compared to the generic-typed versions: GetComponent<ComponentType>(). The docs say to avoid the versions taking a string, but how bad could the performance really be? Today’s article puts the two versions to the test to find out just that!

Read the rest of this article »

No Comments

Unity Editor Integration with Pure Code

Tags: , ,

One apparent downside to the “pure code” approach to Unity app code design is that it makes less use of the Unity Editor. Because it only uses one main MonoBehaviour, there aren’t a lot of MonoBehaviour classes that can be modified by the Inspector panel- a mainstay in Unity design and debugging. Today’s article introduces another kind of auxiliary MonoBehaviour to work around this issue enabling you to use the “pure code” approach without sacrificing the Inspector panel.

Read the rest of this article »

No Comments

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 »

2 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 »

1 Comment

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 »

2 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