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); } }