Beispiel #1
0
 // Inside update is where we check for user inputs, and in this case set the platform values appropraitely.
 void Update()
 {
     if (isTriggered)
     {
         if (Input.GetKeyDown(KeyCode.E) && platform.platformSpeed == 0)
         {
             Debug.Log("Turnin it on.");
             anim.SetBool("flipDown", true);
             platform.platformSpeed = platform.userSetSpeed;
             healthBar.hurtPlayer(healthCost);//ACTIVATING LEVER DAMAGES PLAYER
         }
         else if (Input.GetKeyDown(KeyCode.E) && platform.platformSpeed > 0)
         {
             Debug.Log("Turnin it off.");
             anim.SetBool("flipDown", false);
             platform.platformSpeed = 0;
             healthBar.hurtPlayer(healthCost);
         }
     }
 }