Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (currentlyInteracting)
     {
         if (Input.GetKeyDown(KeyCode.Return))
         {
             if (!currentReaction.NextStep())
             {
                 if (!currentReactionCollection.TryNextReaction())
                 {
                     Debug.Log("Free to go");
                     currentReaction           = null;
                     currentReactionCollection = null;
                     currentlyInteracting      = false;
                     reactionDisplayArea.gameObject.SetActive(false);
                     Destroy(reactionDisplayArea.transform.GetChild(0).gameObject);
                     allowMovement.Raise();
                 }
                 else
                 {
                     currentReaction = currentReactionCollection.GetNextReaction();
                     Destroy(reactionDisplayArea.transform.GetChild(0).gameObject);
                     var reactionInstance = Instantiate(currentReaction.getReactionObject(), reactionDisplayArea.transform);
                     currentReaction.React(reactionInstance);
                 }
             }
         }
     }
 }