예제 #1
0
 private void StartCheckCodes()
 {
     m_CodeMechine.Clear();
     m_CodeMechine.AddCodes(this, m_Codes);
     m_CodeMechine.StartCheckCodes();
     DoState = CheckCodeState;
 }
예제 #2
0
    /*-----------------------------------------------------
    * It's "Activation State" timer, count on m_ActTimer *
    *  -----------------------------------------------------*/

    private void ActivationState()
    {
        if (Vector3.Distance(this.transform.position, CurrentPlayer.transform.position) > m_Data.ActivateRadius || CurrentPlayer.IsDead)
        {
            CurrentPlayer.SoundManager.PlayOnce(1040);
            m_SoundManager.Stop();
            StopCheckCodes();
            return;
        }

        if (m_ActTimer < m_Data.ActivatingTime)
        {
            m_ActTimer += Time.fixedDeltaTime;

            if (m_CurrentPhase < m_Data.PhaseDatas.Count)
            {
                m_MobTimer += Time.fixedDeltaTime;

                if (m_MobTimer >= m_Data.PhaseDatas[m_CurrentPhase].Time)
                {
                    PhaseData phase = m_Data.PhaseDatas[m_CurrentPhase];
                    MobManager.m_Instance.SpawnMobs(phase.FishNum, phase.FishVariantNum, phase.PatrolNum, phase.TankNum, this.transform, m_Data.MinRadius, m_Data.MaxRadius);
                    m_CurrentPhase++;
                }
            }

            if (OnActivating != null)
            {
                OnActivating();
            }
        }
        else
        {
            m_Animator.SetTrigger("Finish");
            m_SoundManager.PlayInWorld(1, this.transform.position);
            m_bFinished = true;
            CompleteMission();
            InteractiveItemManager.Instance.RemoveItem(this);

            List <Player> pList = InGamePlayerManager.Instance.Players;
            for (int i = 0; i < pList.Count; i++)
            {
                pList[i].Record.NumOfMission++;
            }

            if (OnActive != null)
            {
                OnActive();
            }
            StartCoroutine(MissionFinish());
            DoState = null;
        }
    }
예제 #3
0
 private void StopCheckCodes()
 {
     m_SoundManager.Stop();
     m_CodeMechine.StopCheckCodes();
     CurrentPlayer = null;
     m_Animator.SetTrigger("Stop");
     m_CurrentPhase = 0;
     m_MobTimer     = 0;
     m_ActTimer     = 0;
     DoState        = null;
     if (OnStop != null)
     {
         OnStop();
     }
 }
예제 #4
0
 private void SuccessOnCheckCode()
 {
     m_Animator.SetTrigger("Start");
     m_ActTimer = 0;
     DoState    = ActivationState;
 }