Beispiel #1
0
    public IEnumerator GetReady()
    {
        ShowGetReadySign();
        control.EnableMovement();
        yield return(new WaitForSeconds(2f));

        HideGetReadySign();
    }
Beispiel #2
0
    /// <summary>
    /// Shows the instructions for 4 seconds and toggles player controls
    /// </summary>
    public IEnumerator TrainSign()
    {
        control.DisableMovement();
        ShowTrainSign();
        yield return(new WaitForSeconds(4f));

        HideTrainSign();
        control.EnableMovement();
    }
Beispiel #3
0
 /// <summary>
 /// Get object references and start the instructions coroutine. Also disables the instructions in case the player dies
 /// </summary>
 void Start()
 {
     trainSign = GameObject.Find("trainSign").GetComponent <SpriteRenderer> ();
     control   = FindObjectOfType(typeof(BullTrainController)) as BullTrainController;
     if (firstTimeOnTheTrain)
     {
         StartCoroutine(TrainSign());
         StopCoroutine(TrainSign());
         firstTimeOnTheTrain = false;
     }
     else if (!firstTimeOnTheTrain)
     {
         StopAllCoroutines();
         HideTrainSign();
         control.EnableMovement();
     }
 }