private void TryReleaseAction(ACT.EOperation operation, ACT.EInputType inputType) { LocalPlayer tmpLocalPlayer = Game.ControllerMgr.Get <UnitController>().LocalPlayer; var tmpInterruptIdx = tmpLocalPlayer.ActStatus.ActiveAction.GetActionInterruptIdx(operation, inputType); if (-1 != tmpInterruptIdx) { tmpLocalPlayer.LinkSkill(null, tmpInterruptIdx); } }
public static int GetActionInterruptIdx(this Action action, ACT.EOperation operation, ACT.EInputType inputType = ACT.EInputType.EIT_Click) { int tmpInterruptIdx = -1; for (int i = 0, max = action.ActionInterrupts.Count; i < max; ++i) { var tmpActionInterrupt = action.ActionInterrupts[i]; if ((tmpActionInterrupt.InputKey1 == (int)operation && tmpActionInterrupt.InputType1 == (int)inputType) || (tmpActionInterrupt.InputKey2 == (int)operation && tmpActionInterrupt.InputType2 == (int)inputType)) { tmpInterruptIdx = i; break; } } return(tmpInterruptIdx); }