Пример #1
0
    void Awake()
    {
        // Setting up the references.
        anim           = GetComponent <Animator>();
        playerAudio    = GetComponent <AudioSource>();
        playerMovement = GetComponent <PlayerMovement>();
        playerShooting = GetComponentInChildren <PlayerShooting>();

        // Set the initial health of the player.
        currentHealth = startingHealth;

        OnHealthChange += UpdateHealthUI; // My Mod

        // My Mod
        if (OnDamage != null)
        {
            OnDamage = new OnDamageEvent();
        }

        // My Mod
        OnDamage.AddListener(DamageUpdate);
    }
Пример #2
0
 public void StartListeningToOnDamageEvent(UnityAction <IAttackHitbox, IDamageable> listener)
 {
     Debug.Log(listener.Method.Name + " Subscribed to OnDamageEvent");
     onDamageEvent.AddListener(listener);
 }