public override void Enter() { base.Enter(); // Debug.Log("Flee Enter", gameObject); model.transform.Rotate(new Vector3(0, 180, 0)); model.ChangeState(model.moveState); }
public override void Exit() { if (spawnedSpiritBomb == null) { base.Exit(); return; } spawnedSpiritBomb.GetComponent <Projectile_SpiritBomb>().thrown = true; GetComponentInParent <Health>().OnDeathEvent -= TakeYouAllDownWithMe; Kennith_Model.ShareYourPower += model.SyphoningPower; // Debug.Log("Attack Exit", gameObject); model.ChangeState(model.fleeState); }
public override void OnInspectorGUI() { Kennith_Model model = (Kennith_Model)target; if (GUILayout.Button("Throw Spirit Bomb")) { model.ChangeState(model.spiritBombState); } if (GUILayout.Button("Throw Hail Attack")) { model.ChangeState(model.hailState); } if (GUILayout.Button("Go Idle")) { model.ChangeState(model.idleState); } if (GUILayout.Button("Move Around")) { model.ChangeState(model.moveState); } if (GUILayout.Button("FLEE")) { model.ChangeState(model.fleeState); } if (GUILayout.Button("Perish")) { model.ChangeState(model.deathState); } DrawDefaultInspector(); }
private void OnGUI() { if (Selection.activeGameObject == null) { GUILayout.Label("Select a Kennith-type AI to control"); return; } model = Selection.activeGameObject.GetComponent <Kennith_Model>(); if (model == null) { GUILayout.Label("Select a Kennith-type AI to control"); return; } if (GUILayout.Button("Throw Spirit Bomb")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.spiritBombState); } } else { Debug.LogError("Selected Object does not have required component"); } } if (GUILayout.Button("Throw Hail Attack")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.hailState); } } else { Debug.LogError("Selected Object does not have required component"); } } if (GUILayout.Button("Go Idle")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.idleState); } } else { Debug.LogError("Selected Object does not have required component"); } } if (GUILayout.Button("Move Around")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.moveState); } } else { Debug.LogError("Selected Object does not have required component"); } } if (GUILayout.Button("FLEE")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.fleeState); } } else { Debug.LogError("Selected Object does not have required component"); } } if (GUILayout.Button("Perish")) { if (model != null) { if (!Application.isPlaying) { Debug.LogWarning("Editor must be playing for this button to function"); } else { model.ChangeState(model.deathState); } } else { Debug.LogError("Selected Object does not have required component"); } } }