// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha7)) { heroScript.Attack(); } else if (Input.GetKeyDown(KeyCode.Alpha8)) { heroScript.Skill1(); } else if (Input.GetKeyDown(KeyCode.Alpha9)) { heroScript.Skill2(); } else if (Input.GetKeyDown(KeyCode.Alpha0)) { heroScript.Skill3(); } else if (Input.GetKey(KeyCode.W)) { heroScript.Move(0); } else if (Input.GetKey(KeyCode.A)) { heroScript.Move(-90); } else if (Input.GetKey(KeyCode.S)) { heroScript.Move(180); } else if (Input.GetKey(KeyCode.D)) { heroScript.Move(90); } else if ((Input.GetKeyUp(KeyCode.W)) || (Input.GetKeyUp(KeyCode.A)) || (Input.GetKeyUp(KeyCode.S)) || (Input.GetKeyUp(KeyCode.D))) { heroScript.Idle(); } }
void FixedUpdate() { controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump); jump = false; }