Example #1
0
    private void NotifyOtherObjects()
    {
        if (DebugMode)
        {
            Debug.Log("Notifying other objects about an HP change!");
        }

        HealthEventArgs args = new HealthEventArgs(HP, MaxHP, gameObject.tag);

        _ambassador.SendMessage(_changeEvent, args, SendMessageOptions.DontRequireReceiver);
        _healthProvider.SendMessage(_changeEvent, args, SendMessageOptions.DontRequireReceiver);
    }