protected override void Update() { targetDup = Input.GetAxis(AsixY); targetRight = Input.GetAxis(AsixX); PSKeyLeftOrRightNumber = Input.GetAxis(PSKeyLeftOrRight); PSKeyUpOrDownNumber = Input.GetAxis(PSKeyUpOrDown); Rup = -1 * Input.GetAxis(RAsixY); Rright = -1 * Input.GetAxis(RAsixX); if (!InputEnable) { targetDup = 0; targetRight = 0; Dup = 0; Dright = 0; Dmg = 0; Dvec = Vector3.zero; } else { Dup = Mathf.Lerp(Dup, targetDup, 0.5f); Dright = Mathf.Lerp(Dright, targetRight, 0.5f); input = SqrtToCircle(new Vector2(Dright, Dup)); Dmg = Mathf.Sqrt((input.x * input.x) + (input.y * input.y)); Dmg = Mathf.Clamp(Dmg, 0.0f, 1.0f); //把值限制到0-1 if (PlayerTarget != null) { Dvec = input.x * PlayerTarget.right + input.y * PlayerTarget.forward; } } GameButtonLT1.Tick(Input.GetKey(LT1)); GameButtonLT2.Tick(Input.GetKey(LT2)); GameButtonLT3.Tick(Input.GetKey(LT3)); GameButtonRT1.Tick(Input.GetKey(RT1)); GameButtonRT2.Tick(Input.GetKey(RT2)); GameButtonRT3.Tick(Input.GetKey(RT3)); GameButtonOpetions.Tick(Input.GetKey(Opetions)); GameButtonA.Tick(Input.GetKey(keyA)); GameButtonB.Tick(Input.GetKey(keyB)); GameButtonC.Tick(Input.GetKey(keyC)); GameButtonD.Tick(Input.GetKey(keyD)); ////实现A键长按功能 //PressKeyA = (GameButtonA.IsPressing && !GameButtonA.IsDelaying) || GameButtonA.IsExtending; //PressKeyB = GameButtonB.OnPressed; //PressKeyC = GameButtonC.OnPressed; //PressKeyD = GameButtonD.OnPressed; }