uml

Unity3d :: UML :: Behaviour visualization cheat sheet

Hi,

Here is a detailed UML class diagram of the Behaviour API for Unity 3D.

Basically the action duties of the Behaviour class include;

  • Enables-disables the component

UnityEngine.Behaviour Class Diagram

Unity3d :: UML :: Component visualization cheat sheet

Hi,

Here is a detailed UML class diagram of the Component API for Unity 3D.

Basically the action duties of the Component class include;

  • Broadcast messages to listeners
  • Manage composite scene Component instances registered

Using an analogy, the Component class acts as the GameObject's circuit breaker. All pieces of the scene object are wired through this component class.

An interesting characteristic of the Component class is, although it composites all components into itself, the class is also the base class for all Components. It's like having your cake and eating it to. There must be a design pattern name for this but, I am at a loss for what it is called.

In the UML diagram all Behavior subclasses are to the left vertical, straight Component subclasses are bottom horizontal.

UnityEngine.Component Class Diagram

Unity3d :: UML :: Renderer visualization cheat sheet

Hi,

Here is a detailed UML class diagram of the Renderer API for Unity 3D.

Basically the action duties of the Renderer class include;

  • Render the current mesh's materials

The Renderer class makes use of the following;

  • Material (mesh render)
  • Vector4 (lightmap tiling)
  • Matrix4x4 (transformation)
  • Bounds (bounding volume of the renderer)

UnityEngine.Renderer Class Diagram

Unity3d :: UML :: Camera visualization cheat sheet

Tags -

Hi,

Here is a detailed UML class diagram of the Camera API for Unity 3D.

Basically the action duties of the Camera class include;

  • Render the current Scene through it's viewport
  • Clip rendering

The Camera class makes heavy use of the following;

  • Rect (camera size)
  • Vector3 (viewport)
  • Matrix4x4 (projection)

The Camera enumerations;

  • CameraClearFlags
  • DepthTextureMode
  • RenderingPath

UnityEngine.Camera Class Diagram

Unity3d :: UML :: Transform visualization cheat sheet

Hi,

Here is a detailed UML class diagram of the Transform API for Unity 3D.

Coming from an ActionScript - Flash background, this class stumped me for a bit until I really started looking into the api docs and realizing that GameObject is just a container for composite instances such as the Transform class. The Transform instance is accessed through the GameObject.transform instance property as well as a couple other ways with methods like GameObject.GetComponent().

In ActionScript, the UIComponent owns, measures, lays out and renders the display object children (although UIComponent is abstract for measurement and layout). In a sense, the UIComponent is the Transform as well as a million other things. Have you seen how many lines of code UIComponent has in Flex 4? :)

What Unity3D does is composite all the features such as transform into the class. Adobe should take note, this is a much cleaner design since having the composite instances create any easy interface for each section the GameObject contains. There are clear boundaries between functionality.

As we can see in the UML, the Transform class deals with it's own position, scale and rotation and also has the duty of containing other Transform children. In the whole design pattern area this is called the composite pattern. The composite is a tree of instances that share the same api (interface).

Basically the action duties of the Transform class include;

  • Addition and removal of children
  • Child queries
  • Translation (position) transform
  • Rotational (rotation) transform

The Transform class makes heavy use of the following;

  • Vector3 (position)
  • Quaternion (rotation)
  • Matrix4x4 (transform)

The parent

In a lot of graphical languages you will have a method called addChild() or addElement(). In Unity3D, there is no method for adding a child to a Transform. Setting the parent property of the parent Transform will automatically add the child Transform to the parent.

The root

The root property returns the top level Transform that is attached to the Scene. This could also be achieved by creating a while() loop and looping through the Transform.parent until null is reached.

UnityEngine.Transform Class Diagram

Unity3d :: UML :: Animation visualization cheat sheet

Hi,

Here is a detailed UML class diagram of the Animation API for Unity 3D.

The Animation component is composed in the GameObject as the animation property. Each GameObject uses this instance to control it's registered AnimationState instances.

There is a subtle composite hierarchy found within Animation that is worth noting.

  • Animation
    • AnimationState
      • AnimationClip
        • AnimationCurve
          • Keyframe

Mike

PS There will be more detailed adventures in these classes found in the Unity3D section of the site down the road. I'm just publishing the UML for now so others can see the system and api as a whole.

UnityEngine.Animation Class Diagram

Unity3d :: UML :: GameObject cheat sheet

Hi,

I am putting together a series of Unity3D class tutorials and UML class designs. My programming background comes from years of pretty regimented design pattern applications using Java, PHP and ActionScript. Mainly object oriented components and projects that relied heavily on forward and reverse engineering. The UML diagram below is an example of reverse engineering, to document and map an existing software system.

When it comes to this programming stuff, I need a map (my previous career in the 90's was a Land Surveyor :). To become an efficient programmer and master of a language it is really important to grasp something graphically as well as textually.

This is going to be my contribution to the Unity3D community. I hope you budding programmers/artists see the value in what I offer here and make some really well architected Unity3d games as well as something that hasn't been thought of (non-game).

Another area that I see Unity3D growing in is how to actually architect the application with javascript or C#. It's sad to say that some of the Unity3D code I have seen lately looks like my code did back in Flash 5 circa 2001. What does this all amount to? Spaghetti code that is touched by everything and contained by nothing. If I were to make a bet, I would bet in 5 years you will see a real software approach coming to Unity3D. An example of this is how Flash turned into Flex with a Flash site becoming a now coined buzz word "RIA" Rich Internet Application.

Will we see the same thing happen to Unity3D? Yes we will because the engine is much more than a game engine. That is what I am here to expose. :)

In some of my later blog posts I will explain more of these diagrams, also will be adding to the Unity3D section of the site which is a developing book.

Mike

UnityEngine.GameObject Class Diagram

Syndicate content