Example #1
0
 LinkedT(GameObject gob, LinkedT lt)
 {
     this.gob = gob;
     this.parentLT = lt;
     totalNumChoices = 0;
     currC = 0;
     createList();
 }
Example #2
0
 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();
     }
 }
Example #3
0
 public void init()
 {
     this.showLevel ();
     parentLT = this;
 }
Example #4
0
 LinkedT(GameObject gob, LinkedT lt)
 {
     this.gob = gob;
     this.parentLT = lt;
     createList();
 }
Example #5
0
 void Start()
 {
     curr = new LinkedT (gameObject);
     curr.init ();
 }
Example #6
0
        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);
                }
            }
        }
Example #7
0
 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);
         }
     }
 }