//按键检测 private void CheckButtonInput() { btnA.Trick(Input.GetKey(KeyA)); btnB.Trick(Input.GetKey(KeyB)); btnC.Trick(Input.GetKey(KeyC)); btnD.Trick(Input.GetKey(KeyD)); btnLockon.Trick(Input.GetKey(KeyLockon)); //A键 Run = (btnA.IsPressing && !btnA.IsDelaying) || btnA.IsExtending; //长按shift键,跑步 Jump = btnA.OnPressed && btnA.IsExtending; //双击A键,跳 Roll = btnA.OnRelesed && btnA.IsDelaying; //单击A键,翻滚/后撤 //Run=btnA.IsPressing; //Jump = btnB.OnPressed; Attack = btnC.OnPressed; Defense = btnD.IsPressing; //锁定 Lockon = btnLockon.OnPressed; }
//按键检测 private void CheckButtonInput() { ButtonA.Trick(Input.GetButton(btnA)); ButtonB.Trick(Input.GetButton(btnB)); ButtonC.Trick(Input.GetButton(btnC)); ButtonD.Trick(Input.GetButton(btnD)); ButtonLB.Trick(Input.GetButton(btnLB)); ButtonLT.Trick(Input.GetButton(btnLT)); ButtonJS.Trick(Input.GetButton(btnJstick)); //A键 Run = (ButtonA.IsPressing && !ButtonA.IsDelaying) || ButtonA.IsExtending; //长按A键,跑步 Jump = ButtonA.OnPressed && ButtonA.IsExtending; //双击A键,跳 Roll = ButtonA.OnRelesed && ButtonA.IsDelaying; //单击A键,翻滚/后撤 //LB,LT 键 Attack = ButtonLB.OnPressed; Defense = ButtonLT.IsPressing; //JS键 Lockon = ButtonJS.OnPressed; }