예제 #1
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);
                }
            }
        }
예제 #2
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);
         }
     }
 }