Ejemplo n.º 1
0
 protected override void Update()
 {
     base.Update();
     if (GameObject.FindWithTag("Player").GetComponent <Character>().Airborne == true)
     {
         //ButtonPressedFirstTime.RemoveAllListeners();
         ButtonPressedFirstTime.AddListener(delegate { this.GetComponentInParent <InputManager>().GlideButtonDown(); });
         ButtonReleased.AddListener(delegate { this.GetComponentInParent <InputManager>().GlideButtonUp(); });
         ButtonPressed.AddListener(delegate { this.GetComponentInParent <InputManager>().GlideButtonPressed(); });
     }
     else
     {
         //ButtonPressedFirstTime.RemoveAllListeners();
         ButtonPressedFirstTime.AddListener(delegate { this.GetComponentInParent <InputManager>().RunButtonDown(); });
         ButtonReleased.AddListener(delegate { this.GetComponentInParent <InputManager>().RunButtonUp(); });
         ButtonPressed.AddListener(delegate { this.GetComponentInParent <InputManager>().RunButtonPressed(); });
     }
 }