浏览代码

Added debug toggle

/main
DeivSky 4 年前
当前提交
15afbcfd
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 14
      UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs

14
UOP1_Project/Assets/Scripts/StateMachine/Core/StateMachine.cs


namespace DeivSky.StateMachine
{
public class StateMachine : MonoBehaviour
{
[SerializeField] private Scriptables.ScriptableState _initialStateSO = null;
public class StateMachine : MonoBehaviour
{
#if UNITY_EDITOR
public bool debug;
#endif
[SerializeField] private Scriptables.ScriptableState _initialStateSO = null;
[SerializeField] private ScriptableObject[] _scriptableObjects = null;
private List<Type> _scriptableObjectsTypes = null;
private readonly Dictionary<Type, Component> _cachedComponents = new Dictionary<Type, Component>();

_currentState.OnStateExit();
_currentState = transitionState;
_currentState.OnStateEnter();
Debug.Log("Entering state " + _currentState.Name);
#if UNITY_EDITOR
if (debug)
Debug.Log($"{name} entering state {_currentState.Name}");
#endif
}
}

正在加载...
取消
保存