blob: 890d1e6656120ef3333c4bbc7ac8bf3644021fd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 基础的切换 state
public class ActionSwitchState : ActionBase
{
StateController m_StateController;
StateBase m_TargetState;
public ActionSwitchState(StateController stateSystem, StateBase targetState)
{
m_StateController = stateSystem;
m_TargetState = targetState;
}
public override void Execute()
{
#if UNITY_EDITOR
string thsName = m_StateController.Current.GetType().FullName;
string clsName = m_TargetState.GetType().FullName;
Debug.Log(thsName + " -> " + clsName);
#endif
m_StateController.SwitchToState(m_TargetState);
}
}
|