예제 #1
0
    public void OverrideGameEnd(bool isSuccess)
    {
        if (SingleGameState.IsTest)
        {
            SceneManager.instance.ActionEvent(_ACTION.GO_TOWN);
            SingleGameState.IsTest = false;
        }

        if (isSuccess)
        {
            if (UiState == 1)//넷트워크에서 처리가 잘됨. 좋은거
            {
#if UNITY_EDITOR
                if (SceneManager.instance.testData.bCutSceneTest && GameObject.Find("CinemaSceneManager") != null)
                {
                    CinemaSceneManager csm = GameObject.Find("CinemaSceneManager").GetComponent <CinemaSceneManager> ();

                    SingleGameInfo stageinfo     = (SingleGameInfo)G_GameInfo.GameInfo;
                    bool           bPlayCutScene = false;
                    if (csm.getCinemaSceneStartTypeByStageID(stageinfo.StageId) == CinemaSceneManager.StartType.AFTER_CLEAR)
                    {
                        bPlayCutScene = true;
                    }
                    if (stageinfo.StageId == 310)                      // 3-10 has two conditions, BEFORE_GAME_START and AFTER_CLEAR,
                    {
                        if (csm.getCinemaSceneStartTypeByStageID(stageinfo.StageId) == CinemaSceneManager.StartType.BEFORE_GAME_START)
                        {
                            bPlayCutScene = true;
                        }
                    }

                    if (bPlayCutScene)
                    {
                        int idx = 0;
                        if (stageinfo.StageId == 310)
                        {
                            idx = 2;
                        }
                        CutSceneMgr.StartCinemaScene(false, idx, idx, () => {
                            OpenResultPanel(true);
                        });
                        return;
                    }
                }
#endif
                OpenResultPanel(true);
            }
            else//클라가 먼저 실행됨 네트워크에서 처리.
            {
                UiState = 2;
            }
        }
        else
        {
            UiState = 2;
            NetworkClient.instance.SendPMsgStageCompleteC((int)StageId, 0, new int[] { 0, 0, 0 });
        }
    }
    void Start()
    {
        if (instance == null)
        {
            instance = this;
            eventCnt = 0;

            Stageinfo = (SingleGameInfo)G_GameInfo.GameInfo;
            setActiveSequences(false);
        }
    }
    void Update()
    {
        if (bossUnit != null)
        {
            if (bossUnit.CharInfo.Hp < bossUnit.CharInfo.MaxHp / 2)
            {
                QuestInfo questInfo = QuestManager.instance.GetLastestUnCompleteQuestInfo();

                if (questInfo != null && getCinemaSceneStartType(questInfo.unTaskId) == CinemaSceneManager.StartType.DURING_BATTLE)
                {
                    if (eventCnt == 0)
                    {
                        eventCnt = 1;
                        int startSeqIdx = getCinemaSceneStartingSeqIndex(questInfo.unTaskId);
                        int endSeqIdx   = getCinemaSceneEndingSeqIndex(questInfo.unTaskId);
                        CutSceneMgr.StartCinemaScene(true, startSeqIdx, endSeqIdx, null);
                    }
                }
#if UNITY_EDITOR
                else
                {
                    if (SceneManager.instance.testData.bCutSceneTest)
                    {
                        SingleGameInfo stageinfo = (SingleGameInfo)G_GameInfo.GameInfo;

                        CinemaSceneManager csm = GameObject.Find("CinemaSceneManager").GetComponent <CinemaSceneManager> ();
                        if (csm.getCinemaSceneStartTypeByStageID(stageinfo.StageId) == CinemaSceneManager.StartType.DURING_BATTLE)
                        {
                            if (eventCnt == 0)
                            {
                                eventCnt = 1;
                                int startSeqIdx = getCinemaSceneStartingSeqIndex(questInfo.unTaskId);
                                int endSeqIdx   = getCinemaSceneEndingSeqIndex(questInfo.unTaskId);
                                CutSceneMgr.StartCinemaScene(true, startSeqIdx, endSeqIdx, null);
                            }
                        }
                    }
                }
#endif
            }
        }
    }