LinkedT(GameObject gob, LinkedT lt) { this.gob = gob; this.parentLT = lt; totalNumChoices = 0; currC = 0; createList(); }
private void checkInput() { if (Input.GetKeyDown (KeyCode.S) || Input.GetKeyDown (KeyCode.DownArrow)) { curr.nextObject(); } else if (Input.GetKeyDown (KeyCode.W) || Input.GetKeyDown (KeyCode.UpArrow)) { curr.prevObject(); } else if (Input.GetKeyDown (KeyCode.Return)) { curr = curr.selectChoice(); } else if (Input.GetKeyDown (KeyCode.Backspace)) { curr = curr.prevLevel(); } }
public void init() { this.showLevel (); parentLT = this; }
LinkedT(GameObject gob, LinkedT lt) { this.gob = gob; this.parentLT = lt; createList(); }
void Start() { curr = new LinkedT (gameObject); curr.init (); }
private void createList() { totalNumChoices = 0; currC = 0; bool isDes = false; foreach (Transform t in gob.transform) { if(isDes == false) { //found deselect sprite des = t.gameObject; isDes = true; } else { buttonList.Add(t.gameObject); // Add a default script onto the button if none exists if(t.gameObject.GetComponent<MenuCode>() == null) t.gameObject.AddComponent<DoNothing>(); ++ totalNumChoices; if(t.childCount > 1) { LinkedT linT = new LinkedT(t.gameObject, this); linT.hideLevel(); subMenuList.Add(linT); } else subMenuList.Add(null); } } }
private void createList() { bool isDes = false; foreach (Transform t in gob.transform) { if(isDes == false) { //found deselect sprite des = t.gameObject; isDes = true; } else { buttonList.Add(t.gameObject); ++ totalNumChoices; if(t.childCount > 1) { print (t.gameObject); LinkedT linT = new LinkedT(t.gameObject, this); linT.hideLevel(); subMenuList.Add(linT); } else subMenuList.Add(null); } } }