コード例 #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).
        }
コード例 #2
0
        public static void SetStateMachine(ref TStateMachine stateMachine, ref IStateMachineRunnerPromise runnerPromiseFieldRef)
        {
            if (!pool.TryPop(out var result))
            {
                result = new AsyncUniTask <TStateMachine>();
            }
            TaskTracker.TrackActiveTask(result, 3);

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