コード例 #1
0
 public void UseCurrentSelection()
 {
     if ((CurrentPoint != null) && (CurrentPoint.gameObject != null))
     {
         CurrentPoint.Interact();
     }
 }
コード例 #2
0
        private void Update()
        {
            if (isDead)
            {
                // do not receive any input when the player character is dead
                sideMovementInput = 0.0f;
                return;
            }

            if (Time.timeScale == 0.0f) // equality is ok here bc this 0.0f is a value that is directly set
            {
                // do not receive any input when the game is paused
                return;
            }

            if (Input.GetButtonDown("Pause"))
            {
                GameController.Instance.PauseGame(true);
                return;
            }

            sideMovementInput = Input.GetAxisRaw("Horizontal");

            if (Input.GetButtonDown("Jump"))
            {
                jumpInput = true;
            }

            if (!isAttacking && Input.GetButtonDown("Fire1"))
            {
                combatUnit.StartAttack();
                return;
            }

            if (!isAttacking && Input.GetButtonDown("Interact"))
            {
                interactionPoint.Interact();
            }
        }