Пример #1
0
 void Update()
 {
     if (Input.GetKey("e") && highlightObject.triggerable)
     {
         interactionHandler.Interact("Computer");
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     // Uses same conditions as highlight to call Interact(), runs waterBonsai()
     if (Input.GetKey("e") && highlightObject.triggerable)
     {
         interactionHandler.Interact("Bonsai Tree");
     }
 }
Пример #3
0
    void Update()
    {
        directionalInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
        if (directionalInput.x > 0 && !facingRight && curentState != PlayerState.Interacting)
        {
            Flip();
        }
        else if (directionalInput.x < 0 && facingRight && curentState != PlayerState.Interacting)
        {
            Flip();
        }
        player.SetDirectionalInput(directionalInput);
        animator.UpdateMovement(directionalInput.x != 0 ? true : false);
        animator.SetGrounded(player.IsGrounded());

        if (controller.JumpKeyPressed() && curentState != PlayerState.Interacting)
        {
            player.OnJumpInputDown();
            animator.TriggerJump();
        }
        if (controller.JumpKeyReleased() && curentState != PlayerState.Interacting)
        {
            player.OnJumpInputUp();
            animator.ResetJump();
        }
        animator.SetGrounded(player.IsGrounded());
        animator.SetFalling(player.isFalling() ? true : false);
        if (controller.InteractKeyPressed())
        {
            interactionHandler.Interact();
        }
        else
        {
            curentState = PlayerState.Normal;
        }
    }
 public void Interact()
 {
     interactionHandler.Interact();
     //  Debug.Log("Called");
 }