// Update is called once per frame
    void Update()
    {
        if (!m_SpawnRun)
        {
            return;
        }
        if (m_ManagementTarget != null)
        {
            if (m_ManagementTarget.m_Live == Object.E_LIVE.DEAD)
            {
                ++m_DeadCount;
                TimerNet.SetTimer_s(m_TimerKey, false);
                m_ManagementTarget = null;
            }
            return;
        }

        if (m_CurrentSpawnCount < m_SpawnCount && TimerNet.GetTimer(m_TimerKey) <= 0.0f)
        {
            if (PhotonNetwork.IsMasterClient)
            {
                GameObject g = PhotonNetwork.InstantiateSceneObject(m_FilePath + "/" + m_MonsterPrefab.name, transform.position, Quaternion.Euler(0.0f, 180.0f, 0.0f));
                if (g)
                {
                    m_ManagementTarget = g.GetComponent <Character>();
                    PhotonView view = g.GetComponent <PhotonView>();
                    m_PhotonView.RPC("SetManagementTarget_RPC", RpcTarget.AllViaServer, view.ViewID);
                    TimerNet.SetTimer_s(m_TimerKey, m_SpawnDelay, true);
                }
            }
        }
    }
Beispiel #2
0
    void GameSequenceEvent()
    {
        if (m_UpdateSequence)
        {
            return;
        }
        m_UpdateSequence = true;

        if (m_SequenceProgress[(int)m_GameSequence])
        {
            return;
        }

        float timer = TimerNet.GetTimer(m_SequenceTimerKey);

        if (timer > 0.0f)
        {
            return;
        }

        switch (m_GameSequence)
        {
        case E_GAMESEQUENCE.BEGINGAME:
        {
            SetNextGameSequence();
        }
        break;

        case E_GAMESEQUENCE.READY:
        {
            m_GameReadyCanvas.Run();
            SetNextGameSequence();
        }
        break;

        case E_GAMESEQUENCE.START:
        {
            if (m_GameReadyCanvas.IsComplete)
            {
                SetNextGameSequence();
            }
        }
        break;

        case E_GAMESEQUENCE.NORMALSTAGESTART:
        {
            m_SpawnManager.NormalMonsterSpawnStart();
            m_ControlCanvas.SetActive(true);
            m_SkillUICanvas.SetActive(true);
            m_GameUICanvas.TimeCheck(true);
            SetNextGameSequence();
        }
        break;

        case E_GAMESEQUENCE.NORMALSTAGE:
        {
            if (m_SpawnManager.IsAllNormalMonsterSpawnOperationsCompleted())
            {
                SetNextGameSequence(1.5f);
            }
        }
        break;

        case E_GAMESEQUENCE.NORMALSTAGE_END:
        {
            m_PianoEffect.CurtainClose();
            SetNextGameSequence(2.0f);
        }
        break;

        case E_GAMESEQUENCE.BOSSSTAGESTART:
        {
            m_PianoEffect.CurtainOpen();
            m_BossUICanvas.gameObject.SetActive(true);
            m_MyCharacter.transform.position = m_BossRoomStartPoint.position;
            m_MyCharacter.transform.rotation = Quaternion.identity;
            VerticalFollowCamera.SetDistanceSmooth(5.0f, 1.5f);
            SetNextGameSequence();
        }
        break;

        case E_GAMESEQUENCE.BOSSSTAGE:
        {
            m_SpawnManager.BossMonsterSpawnStart();
            SetNextGameSequence();
        }
        break;

        case E_GAMESEQUENCE.BOSSSTAGE_END:
        {
            if (m_SpawnManager.IsAllBossMonsterSpawnOperationsCompleted())
            {
                DeleteTeamAllUnits(E_TEAMTYPE.BLUE);
                DeleteTeamAllUnits(E_TEAMTYPE.GREEN);
                DeleteTeamAllUnits(E_TEAMTYPE.YELLOW);
                GameClearUIOpen();
                m_GameUICanvas.TimeCheck(false);
                SetNextGameSequence();
            }
        }
        break;

        case E_GAMESEQUENCE.AFTERGAME:
        {
            m_SequenceProgress[(int)m_GameSequence] = true;
        }
        break;

        default:
            break;
        }
    }