示例#1
0
 void CreateCharacter()
 {
     if (currChar == null)
     {
         currChar = Instantiate(charPref) as GameObject;
         PlaceableObject po = currChar.GetComponent <PlaceableObject> ();
         po.OnSelect();
     }
 }
示例#2
0
 public void CreationByVoice()
 {
     if (currChar != null)
     {
         PlaceableObject po = currChar.GetComponent <PlaceableObject> ();
         if (po.placing)
         {
             po.OnSelect();
         }
         currChar = null;
     }
     CreateCharacter();
 }
示例#3
0
 void Update()
 {
             #if UNITY_EDITOR
     if (Input.GetMouseButtonDown(0))
     {
         CreateCharacter();
     }
     if (Input.GetMouseButtonUp(0))
     {
         if (currChar != null)
         {
             PlaceableObject po = currChar.GetComponent <PlaceableObject> ();
             po.OnSelect();
             currChar = null;
         }
     }
             #endif
 }