public void OnTriggerEnter(Collider other) { current = GetComponent <MyGuyController>(); seenTarget = other.gameObject; if ((seenTarget.GetComponent <CharacterBase>() != null) && (targetFound == false) && (seenTarget.GetComponent <MyGuyController>() == null)) { current.currentState.MoveStop(); posTarget = seenTarget; LookAtEnemy(); } }
public override void OnInspectorGUI() { MyGuyController myGuy = (MyGuyController)target; if (GUILayout.Button("Idle")) { myGuy.SetState(0); } if (GUILayout.Button("Attack")) { myGuy.SetState(1); } if (GUILayout.Button("Run Away")) { myGuy.SetState(2); } if (GUILayout.Button("Die now")) { myGuy.SetState(3); } base.OnInspectorGUI(); }
private void Awake() { target = GetComponent <Radar>(); myGuyTaunt = GetComponent <MyGuyController>(); }