Пример #1
0
    /// <summary>
    /// hides the other modes' UI and shows the desired mode's one
    /// </summary>
    /// <param name="desiredMode"></param>
    public void SwitchInterface(InterfaceMode desiredMode)
    {
        switch (desiredMode)
        {
        case InterfaceMode.start:
            templateModeUI.gameObject.SetActive(false);
            gameModeUI.gameObject.SetActive(false);
            startOptionsPanel.gameObject.SetActive(true);
            curModeUI = startOptionsPanel;
            break;

        case InterfaceMode.game:
            templateModeUI.gameObject.SetActive(false);
            gameModeUI.gameObject.SetActive(true);
            startOptionsPanel.gameObject.SetActive(false);
            curModeUI = gameModeUI;
            break;

        case InterfaceMode.template:
            templateModeUI.gameObject.SetActive(true);
            gameModeUI.gameObject.SetActive(false);
            startOptionsPanel.gameObject.SetActive(false);
            curModeUI = templateModeUI;
            break;
        }
        curModeUI.Initialize();
        curInterfaceMode = desiredMode;
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     buttons[0] = this.transform.Find("按钮:离线任务").GetComponent <Button>();
     buttons[1] = this.transform.Find("按钮:末端移动").GetComponent <Button>();
     buttons[2] = this.transform.Find("按钮:单轴点动").GetComponent <Button>();
     animations = this.GetComponent <Animation>();
     for (int i = 0; i < 3; i++)
     {
         imgs[i] = this.transform.Find("Image" + i.ToString()).gameObject;
     }
     for (int i = 0; i < 3; i++)
     {
         modes[i] = new ModeUI(buttons[i], imgs[i]);
     }
 }