IEnumerator SpawnAirGhost() { //HeartBeatEmg(); CurHeartState = EHeartState.EHS_Find; _CreateAirGhost(); //m_AirGhost = m_AirGhostManager.GetGhost(); m_Tip.gameObject.SetActive(true); m_Tip.text = m_tipslist.Count > 1 ? m_tipslist[1] : string.Empty;; yield return(new WaitForSeconds(0.5f)); Vector3 pos = Random.insideUnitSphere * m_AirRaidus; m_AirGhost.transform.position = pos; Vector3 dir = pos.normalized; m_AirGhost.transform.rotation = Quaternion.LookRotation(-dir); m_AirGhost.gameObject.SetActive(true); m_AirGyroController.EnableGyro(true); { m_Arrow.gameObject.SetActive(true); } //StartCoroutine(MobileVibrate()); StartCoroutine(SearchingAirGhost()); m_AirGhost.m_ghostState = DragonGhost.EGhostState.EGS_CATCHABLE; yield break; }
void SetHeartState(EHeartState value) { if (value == m_HeartState) { return; } m_HeartState = value; switch (value) { case EHeartState.EHS_None: m_HeartText.text = 75.ToString(); break; case EHeartState.EHS_Wait: HeartBeatNormal(); StartCoroutine("WaitHeartBeatNumber"); break; case EHeartState.EHS_Find: StartCoroutine("FindHeartBeatNumber"); break; case EHeartState.EHS_Dead: DeadHeartBeatNumber(); break; } }
IEnumerator WaitingGhostSpawn() { // reset ResetGhostSpawnRate(); DragonGhost.EGhostType type = m_GhostList[m_curGhostIndex]; CurHeartState = EHeartState.EHS_Wait; int rad = Random.Range(0, 100); //m_Ghost.m_ghostState = DragonGhost.EGhostState.EGS_HIDDEN; m_AirGhost.m_ghostState = DragonGhost.EGhostState.EGS_HIDDEN; m_curCatchGhostTime = 0; m_Tip.gameObject.SetActive(true); m_Tip.text = m_tipslist.Count > 2 ? m_tipslist[2] : string.Empty;; m_Arrow.gameObject.SetActive(false); while (true) { if (m_SpawnGhostRate > rad) { m_SpawnGhostRate = 100; //if (type == DragonGhost.EGhostType.EGT_MASK) //{ // StartCoroutine(SpawnMaskGhost()); //} //else if (type == DragonGhost.EGhostType.EGT_AIR) StartCoroutine(SpawnAirGhost()); yield break; } else { AddSpawnGhostRate(); if (m_SpawnGhostRate > rad) { m_SpawnGhostRate = 100; //if (type == DragonGhost.EGhostType.EGT_MASK) //{ // StartCoroutine(SpawnMaskGhost()); //} //else if (type == DragonGhost.EGhostType.EGT_AIR) StartCoroutine(SpawnAirGhost()); yield break; } } float time = Random.Range(3, 5); yield return(new WaitForSeconds(time)); } yield break; }
public void OnGhostAttack() { if (m_cameramain == null) { m_cameramain = GameObject.Find("camera"); } if (m_cameramain != null && m_cameramain.GetComponent <ImageEffect_BrokenScreen>() == null) { ImageEffect_BrokenScreen comp = m_cameramain.AddComponent <ImageEffect_BrokenScreen>(); comp.BumpMap = m_ImageBroken.BumpMap; } CurHeartState = EHeartState.EHS_Dead; }