Ejemplo n.º 1
0
 public static void objectDestroyed(GenericObject obj)
 {
     if (activeChallenge != null)
     {
         if ((activeChallenge.getModel() == GenericChallenge.Model.Destruction) || (activeChallenge.getModel() == GenericChallenge.Model.TimeDestruction))
         {
             ((DestructionChallenge)activeChallenge).objectDestroyed(obj);
         }
     }
 }
Ejemplo n.º 2
0
    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));
        }
    }