Exemple #1
0
        IEnumerator runActions(GameAction[] actions, onFinished finishHandler)
        {
            for (int i = 0; i < actions.Length; ++i)
            {
                if (_interrupted)
                {
                    yield break;
                }

                yield return(StartCoroutine(runAction(actions[i])));
            }

            if (finishHandler != null && !_interrupted)
            {
                finishHandler();
            }
        }
Exemple #2
0
        public static void invoke(GameObject gameObject, onFinished finishHandler)
        {
            GameAction[] actions = gameObject.GetComponents <GameAction>();

            if (actions == null)
            {
                return;
            }

            if (actions.Length > 0)
            {
                GameAction action = actions[0];

                //if (finishHandler != null)
                //	action.setOnFinished(finishHandler);

                action.startActions(actions, finishHandler);
            }
        }
Exemple #3
0
 private void startActions(GameAction[] actions, onFinished finishHandler)
 {
     StartCoroutine(runActions(actions, finishHandler));
 }