IEnumerator HunterAttack(Hunter target) { ToggleAbilityControl(); StartCoroutine(blackout.FadeInBlack()); bool succeeded = false; StopTime(); TakedownGame minigame = TakedownGame.GetRandGame(); if (minigame == null) { print("No Game Received!"); yield break; } minigame.drone = false; minigame.BeginGame(); while (!minigame.CheckFinished(ref succeeded)) { yield return(new WaitForSecondsRealtime(1)); } Destroy(minigame); StartTime(); ToggleAbilityControl(); if (succeeded) { Destroy(target.gameObject); StartCoroutine(blackout.FadeOutBlack()); } else { foodCollected = 0; StartCoroutine(blackout.FadeInBlack()); SceneManager.LoadSceneAsync(StateSaver.gameState.curArea.name); } }
IEnumerator PreformTakedown(Drone target) { ToggleAbilityControl(); StartCoroutine(blackout.FadeInBlack()); bool succeeded = false; StopTime(); TakedownGame minigame = TakedownGame.GetRandGame(); if (minigame == null) { print("No Game Received!"); yield break; } minigame.drone = true; minigame.BeginGame(); while (!minigame.CheckFinished(ref succeeded)) { yield return(new WaitForSecondsRealtime(1)); } if (succeeded) { Destroy(target.gameObject); } Destroy(minigame); StartTime(); ToggleAbilityControl(); StartCoroutine(blackout.FadeOutBlack()); }