//普通攻击 private void OnClickNormalAttack() { if (Input.GetMouseButtonDown(0)) { ParamData paramData = ECSLocate.Player.GetReqParam(EntityReqId.PlayerNormalAttack); paramData.SetBool(true); ECSLocate.Player.PushPlayerReq(EntityReqId.PlayerNormalAttack); } }
protected void ComputeVelocity() { #region 点击加速 // Vector2 move=Vector2.zero; // if (Input.GetKeyDown(KeyCode.A)) // { // move.x = 1; // } // if (Input.GetButtonDown("Jump")) // { // move.y = 1; // } // ParamData paramData = ECSLocate.Player.GetReqParam(EntityReqId.PlayerMove); // paramData.SetVect2(move); // ECSLocate.Player.PushPlayerReq(EntityReqId.PlayerMove); #endregion #region 键速度 Vector2 move = Vector2.zero; bool dash = false; move.x = Input.GetAxisRaw("Horizontal"); if (Input.GetButtonDown("Jump")) { move.y = 1; } if (Input.GetMouseButtonDown(0)) { dash = true; } ParamData paramData = ECSLocate.Player.GetReqParam(EntityReqId.PlayerMove); paramData.SetVect2(move); paramData.SetBool(dash); ECSLocate.Player.PushPlayerReq(EntityReqId.PlayerMove); #endregion }