Exemple #1
0
    public static StateMachineTransition Create(StateMachine stateMachine, TransitionInfo.Transition info)
    {
        var target = stateMachine.GetState(info.to);

        if (!target)
        {
            Logger.LogWarning("StateMachineTransition::Create: Create transition [Weapon:{0}:{1}] failed, target [{2}] state is null.", stateMachine.info.ID, info.ID, info.to);
            return(null);
        }

        var trans = Create(false);

        trans.stateMachine = stateMachine;
        trans.info         = info;
        trans.target       = target;

        trans.OnInitialize();

        return(trans);
    }
Exemple #2
0
 protected override void OnDestroy()
 {
     target       = null;
     stateMachine = null;
     info         = null;
 }