Since I am working on a Unity project recently, here’s a cheatsheet that may be helpful for people coming from a Starling and AS3 background to turn on the switch

Language (AS3 VS C#)

Usage Starling Unity Array Array, Vector List Dictionary Object, Dictionary Dictionary<K, V> callback Function method event dispatcher EventDispatcher delegate, event, Action

Remarks:

Since both AS3 and C# are OOP languages, they are somehow similar. C# is definitely more powerful since it’s constantly evolving, whereas AS3 hasn’t updated for a long time.

Display Object hierarchy (Starling VS Unity GUI)

Usage Starling Unity position x, y, scaleX, scaleY, rotation Transform, Rect tranform create element Create by code Create in Unity Editor

Instantiate prefab in code iterate children for (var i:int = 0; i < displayObject.numChildren; ++i)

DisplayObject.GetChildAt(i) foreach (var child in transform) change sibling layer DisplayObject.setChildIndex Transform.SetSiblingIndex

Transform.SetAtFirstSibling

Tranform.SetAtLastSibling change parent DisplayObject.addChild() Transform.SetParent pivot pivotX, pivotY RectTransform pivot

Remarks:

Starling display object is view based, Unity game object is entity based. While Starling display object is simple and easy to understand, Unity game object makes it convenient to attach different components(animation, physics, material, etc). Starling is more like a graphic engine and Unity is more like a game engine.

User Interface (Starling & Feathers VS Unity GUI)

Usage Starling Unity Root element Stage Canvas UI to display Image Image, Quad Image Button Starling Button Button Toggle Button feathers ToggleButton Toggle Container Sprite or LayoutGroup GameObject Layout LayoutGroup LayoutGroup, LayoutElement Text TextField, feathers Label Text, TextMeshPro Scroll ScrollContainer ScrollView List feathers List + list item renderer ScrollView + prefab Anchor feathers AnchorLayout

feathers AnchorLayoutData Rect Transform anchor Tab feathers TabBar

feathers ToggleButton Toggle + ToggleGroup

Remarks:

Starling provide some basic UI elements, Feathers UI is a great addition for dynamic elements such as Layout, Scrolling and List. Unity GUI is in 1 package, it has better editor support.

Low level rendering

Usage Starling Unity Texture Texture Texture2D Shader language AGAL (assemble language) Shader lab (cg/HLSL) Material N/A Material Mesh Mesh (2d) Mesh (2d & 3d) Mesh Renderer MeshStyle MeshRenderer

Remarks:

Both engines support custom rendering pipeline. While Starling is using AGAL directly from Stage3D, Unity has its own shader language. The shader lab is definitely more advanced and allow you to create complicated shaders program easier.

Others

Usage Starling Unity Animation Spine, DragonBones Unity animation framework

Spine Physics Nape, Box2D Unity physics engine Particle system PDParticleSystem

FFParticleSystem Unity particle system UI editor Starling Builder Unity editor

Remarks:

Starling is designed to be small. Extensions are built by 3rd party so you have the greatest flexibility to tailor your app to what you need. Unity is designed to be big and it has almost everything you need in 1 package.

Share this: Twitter

Facebook

Like this: Like Loading...