public static void objectDestroyed(GenericObject obj) { if (activeChallenge != null) { if ((activeChallenge.getModel() == GenericChallenge.Model.Destruction) || (activeChallenge.getModel() == GenericChallenge.Model.TimeDestruction)) { ((DestructionChallenge)activeChallenge).objectDestroyed(obj); } } }
private IEnumerator timer() { while (true) { if (challenge.getModel() == GenericChallenge.Model.TimeSurvive) { ((TimeSurviveChallenge)challenge).tick(); } else if (challenge.getModel() == GenericChallenge.Model.TimeDestruction) { ((TimeDestructionChallenge)challenge).tick(); } if (challenge.getStatus() == GenericChallenge.Status.Failed) { //giveUp(); Debug.Log("OVER"); StopCoroutine(timerCoroutine); break; } yield return(new WaitForSeconds(1)); } }