void CreateCharacter() { if (currChar == null) { currChar = Instantiate(charPref) as GameObject; PlaceableObject po = currChar.GetComponent <PlaceableObject> (); po.OnSelect(); } }
public void CreationByVoice() { if (currChar != null) { PlaceableObject po = currChar.GetComponent <PlaceableObject> (); if (po.placing) { po.OnSelect(); } currChar = null; } CreateCharacter(); }
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 }