IEnumerator _Coro_FishStopAfter(Swimmer f, float time) { yield return(new WaitForSeconds(time)); if (f != null) { f.StopImm(); } }
void Handle_FreezeBombActive() { //?????? if (GameMain.State_ == GameMain.State.Normal) { mGm.FishGenerator.StopFishGenerate(); } //?????????? foreach (Fish prefabFish in mGm.FishGenerator.Prefab_FishAll) { int typeIdx = prefabFish.TypeIndex; Dictionary <int, Fish> fishTypeDict = mGm.FishGenerator.FishTypeIndexMap[typeIdx]; if (fishTypeDict == null) { continue; } foreach (KeyValuePair <int, Fish> kvp in fishTypeDict) { Fish fInScene = kvp.Value; if (fInScene != null && fInScene.Attackable) { IFishAI aiFish = fInScene.GetComponent($"IFishAI") as IFishAI; if (aiFish != null) { aiFish.Pause(); } Swimmer swm = fInScene.GetComponent <Swimmer>(); if (swm != null) { swm.StopImm(); } } } foreach (KeyValuePair <int, Swimmer> kvpLeader in mGm.FishGenerator.LeadersAll) { kvpLeader.Value.StopImm(); } } }
IEnumerator _Coro_FishStopAfter(Swimmer f,float time) { yield return new WaitForSeconds(time); if(f != null) f.StopImm(); }