public override void OnInspectorGUI() { base.OnInspectorGUI(); //DrawDefaultInspector(); PlatoBehaviour mytarget = (PlatoBehaviour)target; if (GUILayout.Button("walk")) { mytarget.ChangeState(mytarget.gameObject.GetComponent <WalkState>()); } }
// Start is called before the first frame update void Start() { reference = gameObject.GetComponent <PlatoBehaviour>(); }