void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { UnityEngine.SceneManagement.SceneManager.LoadScene("Menu"); } if (_jsm.GetButtonDown(JoyStickManager.e_XBoxControllerButtons.X)) { _inventory.UseItem(); } if (!_stunned && !_dashing) { HandleMovement(); } HandleJump(); HandleDash(); HandleIce(); jumpHelper(); _anim.SetBool("Grounded", _grounded); _anim.SetFloat("xVel", xVel); _rgbd2d.velocity = new Vector2(xVel, _rgbd2d.velocity.y); }
IEnumerator Co_SetPlayerInvulnerableAfterDeath() { yield return(new WaitForEndOfFrame()); Items.Inventory inventory = this.GetComponent <Items.Inventory>(); inventory.PickSpecificItem(GameObject.FindObjectOfType <Items.ItemManager>().PickSpecificItem("Shield")); inventory.UseItem(); this.transform.GetComponentInChildren <Items.Shield>().ChangeDuration(1.5f); }