public override void OnEnable() { base.OnEnable(); machine = (StateMachine)target; machineObject = machine.CachedGameObject; machine.SetScriptIcon(AssetDatabaseUtility.LoadAssetInFolder<Texture2D>("statemachine.png", "StateMachine")); HideMachineComponents(); if (machine.GetComponents<StateMachine>().Length > 1) { Debug.LogError("There can be only one StateMachine per GameObject."); machine.Destroy(); } }
public override void OnEnable() { base.OnEnable(); _machine = (StateMachine)target; _machineObject = _machine.gameObject; _machine.SetScriptIcon(HelperFunctions.LoadAssetInFolder<Texture2D>("statemachine.png", "StateMachine")); HideMachineComponents(); if (_machine.GetComponents<StateMachine>().Length > 1) { Debug.LogError("There can be only one StateMachine per GameObject."); _machine.Destroy(); } }