background preloader


Facebook Twitter

Unity - Scripting API: This section of the documentation contains details of the scripting API that Unity provides.

Unity - Scripting API:

To use this information, you should be familiar with the basic theory and practice of scripting in Unity which is explained in the Scripting section of our manual. The scripting reference is organised according to the classes available to scripts which are described along with their methods, properties and any other information relevant to their use. The pages are extensively furnished with example code that you are free to use for any purpose without crediting Unity. The examples can be viewed in either C# or JavaScript using the menu at the top of each page. Note that the API is the same regardless of which language is used, so the choice of language is purely down to preference. API are grouped by namespaces they belong to, and can be selected from the sidebar to the left. Unity Community. C# Unity 3D resources « 8bit Feed™ Personally, I’m all for the option of a Scripting language versus an Object Oriented Language; however with that said I obviously understand the reasons for actually needing the power, speed & precision that comes with the added and usually grueling work.

C# Unity 3D resources « 8bit Feed™

Nonetheless, if your choosing to go down the path of writing your beloved game in Unity 3D with C#, here are a few resources I’ve gathered to aid your process. That is of course if your migrating from their JavaScript dubbed UnityScript. Otherwise if your already an expert with C#, keep in mind that you won’t really need/have to know any of .net as that’s not really applicable. As for compiling your code, I’d highly recommend TextMate for Mac OSX. There’s also MonoDevelop 2.2 which is in beta for the mac. If your on a PC, you could just use the default Unitron that comes with the install, or there are a few other options, none that I’m familiar with personally. Unity Coding: Arrays, Hashtables and Dictionaries explained « robotduck. In this article I’m going to explain the basic uses of – and differences between – some of the various types of array-like containers you can use in Unity.

Unity Coding: Arrays, Hashtables and Dictionaries explained « robotduck

If you haven’t heard of arrays before, they can be described as a single variable with a series of “compartments”, where each compartment can contain a value. Getting started with C# for Unity3D - Everyday 3D. Clean-Up Day: New Tricks with C# Since I’m currently cleaning up my code to hand it in with my project, I figured I could write some of the stuff down I learned during my work on our game.

Clean-Up Day: New Tricks with C#

All of it applies, of course, to C#, and was used in Unity 3D. Checking for a type Using the is keyword, you can easily check whether a certain object is of a desired type. Also, you should be aware of the as keyword, that allows you to cast an object as something else (given that this is possible). Modelling Behaviour Over Multiple Frames Without Update() Sometimes, you need to model some behaviour over several frames (like fading stuff in or out), but doing it in Update() or FixedUpdate() would require unwieldy if constructions. So … coroutines to the rescue! Private void SomeMethod() { // do some stuff here i = 1f; StartCoroutine(FadeOut()); } private IEnumerator FadeOut() { while (i > 0f) { yield return new WaitForFixedUpdate(); i -= 0.1f; } } Delegates – The Easier Way I wrote about delegates before, explaining how they could be used.

Reducing Memory Usage in Unity, C# and .NET/Mono. Unity on iOS uses an early version of Mono’s heap manager.

Reducing Memory Usage in Unity, C# and .NET/Mono

This manager doesn’t do packing, so if you fragment your heap, it’ll just grab a new one for you. I am under the impression the Unity boffins are working on a new heap manager to get around this problem, but for now a game with no memory leaks can end up consuming ever-increasing amounts of memory. C# is a fun language that allows you to quickly write powerful code without sacrificing readability. However the downside to this is that writing natural C# code produces a lot of garbage collection. The only way around this is to eliminate or reduce your heap allocations. Feel free to add more in the comments. Shamless plug: Easily add human-like and emergent decision making to your Unity3d game with DecisionFlex Like this: Like Loading... Unity Serialization...behind the mistery of ScriptableObject! I'Z Logic! Unity serialization is a powerful feature but a little bit hard to master.

Unity Serialization...behind the mistery of ScriptableObject! I'Z Logic!

Working on my AudioLogic plugin (soon on the AssetStore) I start fighting against the serialization in Unity. I need it because when you modify your audio library from the custom window you will expect that after re-open unity or after hit play your changes are still there and not vanished as a dust in the air… Soooo, I started toying around serialization stuff in Unity. Quick Tips: Combining multiple materials into a single draw call. XML Database for Unity (Part 1) Unity - Manual: Unity Manual. Unity - Showcase. Unity - Download. Unity - Learn - Modules.