Monday, September 9, 2013

UNITY: DAN Cannon Prototype

Personal Game Dev Note:

I wasn't allowed to drag my instance of the "_GameScoreKeeper" that was in the Hierarchy into the public "Game_Commander" type object slot on the "Target", but once I turned it into a prefab I was able to drop it in no problem.

Also, didn't declare it as a "GameObject", but as a "Game_Commander" after giving the object a Game_Commander Class script.

Also(2), don't forget to declare the method as "public", otherwise it's inaccessible to other scripts.


UPDATE (2013.SEP.18):

STATIC:
Use "Static" variables, methods, classes, etc. to declare something to be part of the CLASS itself, and not the INSTANCE of the class.

Statics

You can just use the dot operator "." to access the method, and don't need to instantiate an object of that class to use it's members.

Entire classes can be static.  However, STATIC classes can not be instantiated.

NON-STATIC:
Non static variables and methods belong to the instance of the class.


ENABLE / DISABLE USING IF-STATEMENTS
Use this technique to disable GUI Buttons, etc.

PROPERTIES:


No comments: