Skip to main content

Posts

Showing posts from December, 2014

#Unity notes: GUI.enabled

Question : i m sort of learning the facebook sdk example implementation scripts in unity. i came across this code GUI.enabled, i have no idea what it meant! so i did some experiment, base on unity documentation code. heres unity code that i did experiment with it. notice that GUI.enabled is called twice in this code. the first value of GUI.enabled is based on user click, if user selected the "Edit All Options"toggle button, then the value returned is true. second value of GUI.enabled assigned to false. After the GUI.enabled is called, all the GUI component called after it will be enabled/disabled depending GUI.enabled  value. On second call, GUI.enabled is set to false, all the component called after it will be disabled. *see the button ok always been disabled. First scenario: "Edit All Options" always been enabled, from code we can see that the GUI.enabled is been called after the edit all options toggle button created. "E...

c# notes : #region

#region allows to specify block codes to be expanded and collapse convenient for longer code files. must be closed with #endregion eg:          #region FB.Login() example          public void FBLogin {          }        #endregion         expected result in editor         

#Unity note : Platform dependent compilation

consist preprocessor directives, let scripts partitioned, compile and execute a section of code exclusively for one of the supported platforms from the defined symbol we can get to know UNITY_EDITOR UNITY_EDITOR_WIN UNITY_EDITOR_OSX UNITY_STANDALONE_OSX UNITY_IPHONE UNITY_ANDROID UNITY_2_6 //unity engine version and so forth. complete information on unity help manual http://docs.unity3d.com/Manual/PlatformDependentCompilation.html

c# notes : virtual

virtual keyword used when we want to allow a method, property, indexer, event declaration to be overridden in any class who inherits it. virtual modifier cant be use with static,   abstract,   private,   ovveride example

c# notes : sealed class

sealed modifier prevents subclasses/other class inherit from sealed class. sealed modified applicable to class and methods example codes           sealed class Chair            {               public string color;               public float height;            }           we can't extend the sealed class.. eg if we try to code           class BabyChair : Chair {} //error.