Example #1
0
    public void InvokeTransitionAction(R oldRoom, R newRoom, Action onComplete)
    {
        foreach (var transitionObject in _transitionsDictionary.Keys)
        {
            transitionObject.InvokeTransitionAction(oldRoom, newRoom, _callbackCollector.AddCallback());
        }

        _callbackCollector.SetReady(() =>
        {
            foreach (var completeAction in _transitionsDictionary.Values)
            {
                completeAction.SafeInvoke(true);
            }
            onComplete();
        });
    }
Example #2
0
    public void Run(Action onComplete, T arg)
    {
        for (int i = 0; i < _writersList.Count; i++)
        {
            _coroutineList.Add
            (
                CoroutineInvoker.Instance.StartCoroutine(
                    _writersList[i].Coroutine(_callbackCollector.AddCallback(), arg)
                    )
            );
        }

        _callbackCollector.SetReady(() =>
        {
            onComplete.SafeInvoke();
            _coroutineList.Clear();
        });
    }