Example #1
0
 //Use this to initialise display when special stage button pressed
 private void SpecialStg()
 {
     dbtn = FindObjectOfType(typeof(DynamicButtons)) as DynamicButtons;
     PopulateList();
     DefaultCanvas.SetActive(true);
     dbtn.SetBtnInvisible(StgCount(crsName[0]));
     courseName = crsName[0];
 }
Example #2
0
    //Dropdown courses
    public void Drop_IndexChanged(int index)
    {
        dbtn = FindObjectOfType(typeof(DynamicButtons)) as DynamicButtons;

        switch (index)
        {
        case 0:
            dbtn.SetBtnInvisible(StgCount(crsName[0]));
            courseName = crsName[0];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[0], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[0], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[0], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[0], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[0], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[0], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[0], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[0], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[0], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[0], 10); });
            break;

        case 1:
            dbtn.SetBtnInvisible(StgCount(crsName[1]));
            courseName = crsName[1];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 2:
            dbtn.SetBtnInvisible(StgCount(crsName[2]));
            courseName = crsName[2];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 3:
            dbtn.SetBtnInvisible(StgCount(crsName[3]));
            courseName = crsName[3];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 4:
            dbtn.SetBtnInvisible(StgCount(crsName[4]));
            courseName = crsName[4];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 5:
            dbtn.SetBtnInvisible(StgCount(crsName[5]));
            courseName = crsName[5];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 6:
            dbtn.SetBtnInvisible(StgCount(crsName[6]));
            courseName = crsName[6];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 7:
            dbtn.SetBtnInvisible(StgCount(crsName[7]));
            courseName = crsName[7];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;

        case 8:
            dbtn.SetBtnInvisible(StgCount(crsName[8]));
            courseName = crsName[8];
            get1.onClick.AddListener(delegate { GetStageSelected(crsName[index], 1); });
            get2.onClick.AddListener(delegate { GetStageSelected(crsName[index], 2); });
            get3.onClick.AddListener(delegate { GetStageSelected(crsName[index], 3); });
            get4.onClick.AddListener(delegate { GetStageSelected(crsName[index], 4); });
            get5.onClick.AddListener(delegate { GetStageSelected(crsName[index], 5); });
            get6.onClick.AddListener(delegate { GetStageSelected(crsName[index], 6); });
            get7.onClick.AddListener(delegate { GetStageSelected(crsName[index], 7); });
            get8.onClick.AddListener(delegate { GetStageSelected(crsName[index], 8); });
            get9.onClick.AddListener(delegate { GetStageSelected(crsName[index], 9); });
            get10.onClick.AddListener(delegate { GetStageSelected(crsName[index], 10); });
            break;
        }
    }