public static ActionReport Log(PlayMakerFSM fsm, SkillState state, SkillStateAction action, int actionIndex, string parameter, string logLine, bool isError = false) { if (!PlayMakerGlobals.IsEditor) { return(null); } ActionReport actionReport = new ActionReport { fsm = fsm, state = state, action = action, actionIndex = actionIndex, parameter = parameter, logText = logLine, isError = isError }; if (!ActionReport.ActionReportContains(actionReport)) { ActionReport.ActionReportList.Add(actionReport); ActionReport.InfoCount++; return(actionReport); } return(null); }
private bool ActivateActions(int startIndex) { for (int i = startIndex; i < this.Actions.Length; i++) { this.activeActionIndex = i; SkillStateAction fsmStateAction = this.Actions[i]; if (!fsmStateAction.Enabled) { fsmStateAction.Finished = true; } else { this.ActiveActions.Add(fsmStateAction); this.activeAction = fsmStateAction; fsmStateAction.Active = true; fsmStateAction.Finished = false; fsmStateAction.Init(this); fsmStateAction.Entered = true; fsmStateAction.OnEnter(); if (this.Fsm.IsSwitchingState) { return(false); } if (!fsmStateAction.Finished && this.isSequence) { return(false); } } } return(true); }
public static string GetPath(SkillState state, SkillStateAction action) { if (action == null) { return(SkillUtility.GetPath(state) + "[missing action] "); } return(SkillUtility.GetPath(state) + action.GetType().get_Name() + ": "); }
public void OnGUI() { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.OnGUI(); } this.RemoveFinishedActions(); }
public void OnLateUpdate() { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.OnLateUpdate(); } this.CheckAllActionsFinished(); }
public bool OnJointBreak2D(Joint2D joint) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoJointBreak2D(joint); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnControllerColliderHit(ControllerColliderHit collider) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoControllerColliderHit(collider); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnCollisionExit2D(Collision2D collisionInfo) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoCollisionExit2D(collisionInfo); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnParticleCollision(GameObject other) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoParticleCollision(other); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnAnimatorIK(int layerIndex) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoAnimatorIK(layerIndex); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnTriggerExit2D(Collider2D other) { for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.DoTriggerExit2D(other); } this.RemoveFinishedActions(); return(this.fsm.IsSwitchingState); }
public bool OnEvent(SkillEvent fsmEvent) { bool flag = false; for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); flag = fsmStateAction.Event(fsmEvent); } return(this.fsm.IsSwitchingState || flag); }
public void OnUpdate() { if (this.finished) { return; } this.StateTime += Time.get_deltaTime(); for (int i = 0; i < this.ActiveActions.get_Count(); i++) { SkillStateAction fsmStateAction = this.ActiveActions.get_Item(i); fsmStateAction.Init(this); fsmStateAction.OnUpdate(); } this.CheckAllActionsFinished(); }
public void OnExit() { this.active = false; this.finished = false; SkillStateAction[] array = this.Actions; for (int i = 0; i < array.Length; i++) { SkillStateAction fsmStateAction = array[i]; if (fsmStateAction.Entered) { this.activeAction = fsmStateAction; fsmStateAction.Init(this); fsmStateAction.OnExit(); } } }
public SkillEventData(SkillEventData source) { this.SentByFsm = source.SentByFsm; this.SentByState = source.SentByState; this.SentByAction = source.SentByAction; this.BoolData = source.BoolData; this.IntData = source.IntData; this.FloatData = source.FloatData; this.Vector2Data = source.Vector2Data; this.Vector3Data = source.Vector3Data; this.StringData = source.StringData; this.QuaternionData = source.QuaternionData; this.RectData = source.RectData; this.ColorData = source.ColorData; this.ObjectData = source.ObjectData; this.GameObjectData = source.GameObjectData; this.MaterialData = source.MaterialData; this.TextureData = source.TextureData; this.Player = source.Player; this.DisconnectionInfo = source.DisconnectionInfo; this.ConnectionError = source.ConnectionError; this.NetworkMessageInfo = source.NetworkMessageInfo; this.MasterServerEvent = source.MasterServerEvent; }
public static void LogError(PlayMakerFSM fsm, SkillState state, SkillStateAction action, int actionIndex, string logLine) { ActionReport.Log(fsm, state, action, actionIndex, logLine, "", true); Debug.LogError(SkillUtility.GetPath(state, action) + logLine, fsm); ActionReport.ErrorCount++; }
public static string GetPath(SkillState state, SkillStateAction action, string parameter) { return(SkillUtility.GetPath(state, action) + parameter + ": "); }
public static void RuntimeError(SkillStateAction action, string error) { action.LogError(action + " : " + error); }
public void FinishAction(SkillStateAction action) { this.finishedActions.Add(action); }