private void Update() { if (moveStart) { if (fsm._CurrentState == Player_State.Damaged) { force = 0; } if (this.transform.rotation.y == 0 && HelpEvent.GetInstance().MoveCorrection(Vector2.right, this.transform.position, 0.6f)) { this.transform.position += Vector3.right * force * Time.deltaTime; } else if (this.transform.rotation.y == 1 && HelpEvent.GetInstance().MoveCorrection(Vector2.left, this.transform.position, 0.6f)) { this.transform.position += Vector3.left * force * Time.deltaTime; } } }
void Skill() { if (_manager.anim.GetCurrentAnimatorStateInfo(0).IsName("Skill")) { if (_manager.anim.GetCurrentAnimatorStateInfo(0).normalizedTime < 0.9f) { Vector3 move = this.transform.parent.transform.position; move += inputMoveXY * speed; if (HelpEvent.GetInstance().MoveCorrection(inputMoveXY, move, 0.4f)) { this.transform.parent.transform.position = move; } } else { _manager.ChScript(Player_State.Idle); _manager.notGavityTime = notGavityTimer; } } }
void Move() // 이동 { move = this.transform.position; if (Input.GetKey(KeyCode.RightArrow)) // 오른쪽이동 { if (HelpEvent.GetInstance().MoveCorrection(Vector2.right, this.transform.position, 0.3f)) { if (groundChack) { moveEffect.SetActive(true); } anim.SetFloat("Forward", 1); move.x += state.warkSpeed * Time.deltaTime; this.transform.rotation = Quaternion.Euler(0, 0, 0); } } else if (Input.GetKey(KeyCode.LeftArrow)) // 왼쪽이동 { if (HelpEvent.GetInstance().MoveCorrection(Vector2.left, this.transform.position, 0.3f)) { if (groundChack) { moveEffect.SetActive(true); } anim.SetFloat("Forward", 1); move.x -= state.warkSpeed * Time.deltaTime; this.transform.rotation = Quaternion.Euler(0, -180, 0); } } else { moveEffect.SetActive(false); anim.SetFloat("Forward", 0); } this.transform.position = move; }