void AddClickEvent()
    {
        //暂时无用
        BtnHome.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            SceneManager.LoadScene("Home");
            GameOperDelegate.GoToHome();
        });

        //暂时无用
        BtnEdit.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            JoinMainView joinMainView = transform.parent.GetComponentInChildren <JoinMainView>(true);
            DisplayView displayView   = transform.parent.GetComponentInChildren <DisplayView>(true);
            DestroyWindow();
            Destroy(displayView.gameObject);
            joinMainView.gameObject.SetActive(true);
            joinMainView.BackToJoinEdit();
            GameOperDelegate.GotoEdit();
        });

        BtnReplay.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            GameOperDelegate.Replay();
        });

        BtnDisplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            //NoDisplay表示从画册直接进入游戏,返回时返回画册,其余情况是从展示页进入的游戏,返回展示页
            if (GameManager.instance.displayType == DisplayType.NoDisplay)
            {
                GameManager.instance.SetNextSceneName(SceneName.Calendar);
                TransitionView.instance.OpenTransition();
            }
            else
            {
                GameManager.instance.displayType = DisplayType.BackDisplay;
                GameManager.instance.SetNextSceneName(SceneName.Display);
                TransitionView.instance.OpenTransition();
            }

            GameOperDelegate.GotoDisplay();
        });

        BtnContinue.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
        });

        BtnClose.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
        });
    }
Exemple #2
0
    void AddClickEvent()
    {
        //暂时无用
        BtnHome.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            SceneManager.LoadScene("Home");
            GameOperDelegate.GoToHome();
        });

        //暂时无用
        BtnEdit.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            JoinMainView joinMainView = transform.parent.GetComponentInChildren <JoinMainView>(true);
            DisplayView displayView   = transform.parent.GetComponentInChildren <DisplayView>(true);
            Destroy(displayView.gameObject);
            joinMainView.gameObject.SetActive(true);
            joinMainView.BackToJoinEdit();
            CloseWindow();
            GameOperDelegate.GotoEdit();
        });

        BtnGame.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            UIHelper.instance.LoadPrefab("Prefabs/game/window|window_choosegame", GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
        });

        BtnDisplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();

            /*
             * GameManager.instance.displayType = DisplayType.BackDisplay;
             * if (GameManager.instance.openType==OpenType.FirstEdit||GameManager.instance.openType==OpenType.BackEdit)
             * {
             *  GameManager.instance.SetNextViewPath(PanelName.DisplayView);
             *  UIHelper.instance.LoadPrefab(PanelName.TransitionView, GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
             * }
             * else
             * {
             *  GameManager.instance.SetNextViewPath(PanelName.CalendarDetailView);
             *  UIHelper.instance.LoadPrefab(PanelName.TransitionView, GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
             * }
             */
            if (GameManager.instance.displayType == DisplayType.NoDisplay)
            {
                GameManager.instance.SetNextSceneName(SceneName.Calendar);
                TransitionView.instance.OpenTransition();
            }
            else
            {
                GameManager.instance.displayType = DisplayType.BackDisplay;
                GameManager.instance.SetNextSceneName(SceneName.Display);
                TransitionView.instance.OpenTransition();
            }

            GameOperDelegate.GotoDisplay();
        });

        BtnReplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            GameOperDelegate.Replay();
        });
    }