void OnDisable()
 {
     //AIEventManager.StopListening ("test", someListener);
     AIEventManager.StopListening("Spawn", SomeOtherFunction);
     AIEventManager.StopListening("Destroy", SomeThirdFunction);
     AIEventManager.StopListening("Damage", DamageListener);
 }
Esempio n. 2
0
    //private PlayerAttributes pa;

    void Awake()
    {
        if (instance == null)
        {
            DontDestroyOnLoad(gameObject);
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
Esempio n. 3
0
    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");
        }
    }
Esempio n. 5
0
 void OnEnable()
 {
     AIEventManager.StartListening("test", someListener);
     AIEventManager.StartListening("Spawn", SomeOtherFunction);
     AIEventManager.StartListening("Destroy", SomeThirdFunction);
 }
Esempio n. 6
0
 void OnDisable()
 {
     //        EventManager.StopListening ("Spawn", spawnListener);
     AIEventManager.StopListening("Spawn", Spawn);
 }
Esempio n. 7
0
    //    private UnityAction spawnListener;
    //
    //    void Awake () {
    //        spawnListener = new UnityAction (Spawn);
    //    }

    void OnEnable()
    {
        //        EventManager.StartListening ("Spawn", spawnListener);
        AIEventManager.StartListening("Spawn", Spawn);
    }