private void Update() { horizontal = Input.GetAxis("Horizontal"); vertical = Input.GetAxis("Vertical"); state = PlayerState.Idle; if (horizontal != 0 || vertical != 0) { state = PlayerState.Run; } if (Input.GetMouseButtonDown(0)) { state = PlayerState.Shot; } if (Input.GetMouseButtonDown(1) || playerDash.IsDash) { state = PlayerState.Dash; } if (Input.GetKeyDown(KeyCode.Space)) { ActiveItem activeItem = ObjectPoolManager.Instance.GetObject(activeItemType, transform.position).GetComponent <ActiveItem>(); activeItem.Ability(); } }