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();
        }
Beispiel #2
0
 public static GameAction TestInstant(string message) =>
 InstantAction
 .Create("Test Instant", () => Debug.Log("Instant Action: " + message));
Beispiel #3
0
 public static GameAction TestInstantWithError(Exception error) =>
 InstantAction
 .Create("Test Instant With Error", () => throw error);