public void ResetAll() { if (m_humans[0] == null) { for (int i = 0; i < 3; i++) { m_humans[i] = new SHumanScore(); } } m_ghost.knockOut = 0; m_ghost.hitCandy = 0; for (int i = 0; i < 3; i++) { m_humans[i].resuscitation = 0; m_humans[i].setAlterCandle = 0; m_humans[i].setCandle = 0; } }
/// <summary> /// Main /// </summary> /// void Start() { IsLocal = false; if (m_dummyGhost == null) { m_dummyGhost = GameObject.FindGameObjectsWithTag("DummyGhost");//優先 } if (m_ghost == null) { m_ghost = GameObject.Find("Ghost(Clone)");//優先 if (m_ghost == null) { m_ghost = GameObject.Find("Ghost"); } } if (m_find == null) { foreach (Transform child in this.transform) { if (child.name == "find") { m_find = child.gameObject; } } } if (m_candy == null) { foreach (Transform child in this.transform) { if (child.name == "Candy") { m_candy = child.gameObject; } } } if (m_animator == null) { m_animator = this.GetComponent <Animator>(); } if (ExMark == null || Impatiencle == null || Chikin == null) { foreach (Transform child in this.transform) { if (child.name == "ExclamationMark") { ExMark = child.GetComponent <ParticleSystem>(); } if (child.name == "ImpatienceParticle") { Impatiencle = child.GetComponent <ParticleSystem>(); } if (child.name == "StanChickParticle") { Chikin = child.GetComponent <ParticleSystem>(); Chikin.gameObject.SetActive(false); } } } beatSE = new CBeat(); m_shumanScore = new SHumanScore(); m_hp = 1; m_reLife = MaxLifeTime; m_hunmanstrength = 100; m_hunmanTime = 1; m_pStateMachine = new CStateMachine <CHuman>(this); //初始化状态机 m_pStateMachine.SetCurrentState(CHumanState_Main.Instance()); //设置一个当前状态 m_pStateMachine.SetGlobalStateState(CHumanState_Wait.Instance()); //设置全局状态 m_candyFlag = true; ShumanScore.resuscitation = 0; ShumanScore.setAlterCandle = 0; ShumanScore.setCandle = 0; m_isReLifeScoreOn = false; }