private void ExecuteInstantAction(InstantAction action, bool outOfFlow = false) { try { action.action(); } catch (Exception e) { if (action.OnFailureCallback != null) { action.OnFailureCallback(e); } else { Debug.LogErrorFormat("{0} action failed: {1}", action.Name, e); } if (action.WillStopOnError) { StopAll(); } return; } action.OnSuccessCallback?.Invoke(); }
public static GameAction TestInstant(string message) => InstantAction .Create("Test Instant", () => Debug.Log("Instant Action: " + message));
public static GameAction TestInstantWithError(Exception error) => InstantAction .Create("Test Instant With Error", () => throw error);