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