Posts

Showing posts from July, 2014
Image
Unity Editor Scripting : If you ever have to create an instance (in hierarchy) from an .fbx file and a prefab from an instance, you can use following commands. 1 .fbx to instance      :  PrefabUtility . InstantiatePrefab 2 instance to .prefab :  PrefabUtility . CreatePrefab Creating AnimatorController file :  AssetDatabase . CreateAsset  

Conditional / Ternary Operator

Conditional Operator / Ternary Operator : condition ? true_expression : false_expression; bool x = condition ? true : false; eg : string   result  = (percentage  >= 36)  ?  "pass"  :  "fail" ; -------------------------------------------------------- NullCoalesce (??) int totalMarks = marks ?? 0 ; The  ??  operator is called the null-coalescing operator. It returns the left-hand operand if the operand is not null; otherwise it returns the right hand operand. eg:  int ? x = null ; int y = x ?? -1; int? is a shorthand for Nullable, which itself is shorthand of Nullable. eg Nullable a = null; A nullable type can represent the correct range of values for its underlying value type, plus a additional null value. --------------------------------------------------------

Installing Ant, Svn and Git on Mac

Install home-brew if not already installed ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" or ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" sudo brew update brew install ant brew install svn brew install git Install  JDK 7 ( If apache doesn't work in Sierra here is a usefull article : https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions)
           Great trick for optimization so that code doesn't have to count size of array/list again and again.    for  ( int   i  =  0 ,  count  =  objectList . Count ;  i  <  count ;  i ++)             {                 .......  =  objectList [ i ];                  if  ( .... )                 {                     ........                 }             }

Intro to Objective-C

Intro to Objective-C :  http://cocoadevcentral.com/d/learn_objectivec/