Ejemplo n.º 1
0
        public static void SetStateMachine(ref AsyncUniTaskMethodBuilder builder, ref TStateMachine stateMachine)
        {
            if (!pool.TryPop(out var result))
            {
                result = new AsyncUniTask <TStateMachine>();
            }
            TaskTracker.TrackActiveTask(result, 3);

            builder.runnerPromise = result;       // set runner before copied.
            result.stateMachine   = stateMachine; // copy struct StateMachine(in release build).
        }
Ejemplo n.º 2
0
        public static void SetRunner <T>(ref AsyncUniTaskMethodBuilder <T> builder, ref TStateMachine stateMachine)
        {
            var result = pool.TryRent();

            if (result == null)
            {
                result = new MoveNextRunner <TStateMachine>();
            }

            builder.runner      = result;       // set runner before copied.
            result.stateMachine = stateMachine; // copy struct StateMachine(in release build).
        }