private void Update() { if (PlayerInfo.Instance.IsLock || !useSkill) { return; } //Protect Wall if (Input.GetKeyDown(KeyCode.LeftControl)) { WeaponManager.Instance.SetProtectWeapon(); PlayerAnimation.Instance.Block(); } //Idle <-> Atk else if (Input.GetKeyDown(KeyCode.Tab)) { WeaponManager.Instance.TurnAtkWeapon(); } //Swap Atk weapon else if (Input.GetKeyDown(KeyCode.Q)) { WeaponManager.Instance.SwapAtkWeapon(); } //Particle Chain else if (Input.GetKeyDown(KeyCode.Alpha2)) { WeaponManager.Instance.SetMagicWeapon(); PlayerAnimation.Instance.ParticleChain(); } //Particle Blade else if (Input.GetKeyDown(KeyCode.Alpha1)) { WeaponManager.Instance.SetBladeWeapon(); PlayerAnimation.Instance.Slash(); } //Escape else if (Input.GetMouseButtonDown(1)) { PlayerAnimation.Instance.Roll(); } else if (Input.GetKeyDown(KeyCode.R)) { RaycastHit hit; Ray ray = new Ray(transform.position + transform.up * 0.7f, PlayerInfo.Instance.Model.forward); if (Physics.Raycast(ray, out hit, 0.8f)) { //Debug.Log(hit.point); VoxelHitEvent.SetBlock(hit, new BlockAir()); } } }
// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.Mouse0)) { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { //Debug.Log(hit.point); VoxelHitEvent.SetBlock(hit, new BlockAir()); } } }