void OnDisable() { //AIEventManager.StopListening ("test", someListener); AIEventManager.StopListening("Spawn", SomeOtherFunction); AIEventManager.StopListening("Destroy", SomeThirdFunction); AIEventManager.StopListening("Damage", DamageListener); }
//private PlayerAttributes pa; void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }
public void OnEnemyDamageApplied(float damageTaken) { base.OnDamageApplied(damageTaken); if (characterStats.bCanTakeDamage) { OnTrackTarget(); AIEventManager.TriggerEvent("Damage"); playerState.styleModEvent.Invoke(StyleModAmount); if (characterStats.CurrentHealth <= 0) { OnEnemyDeath(); } } }
void Update() { if (Input.GetKeyDown("q")) { AIEventManager.TriggerEvent("test"); } if (Input.GetKeyDown("o")) { AIEventManager.TriggerEvent("Spawn"); } if (Input.GetKeyDown("p")) { AIEventManager.TriggerEvent("Destroy"); } if (Input.GetKeyDown("x")) { AIEventManager.TriggerEvent("Junk"); } }
void OnEnable() { AIEventManager.StartListening("test", someListener); AIEventManager.StartListening("Spawn", SomeOtherFunction); AIEventManager.StartListening("Destroy", SomeThirdFunction); }
void OnDisable() { // EventManager.StopListening ("Spawn", spawnListener); AIEventManager.StopListening("Spawn", Spawn); }
// private UnityAction spawnListener; // // void Awake () { // spawnListener = new UnityAction (Spawn); // } void OnEnable() { // EventManager.StartListening ("Spawn", spawnListener); AIEventManager.StartListening("Spawn", Spawn); }