Ejemplo n.º 1
0
        private void OnDisable()
        {
            // Unsubscribe all overloaded methods with their respective events
            RelativeEventHandler.UnsubscribeEvent("Heal", this, "Heal");
            RelativeEventHandler.UnsubscribeEvent("Damage", this, "Damage");

            // Remove the instance Id
            IdCache.RemoveInstanceId(GetInstanceID());
        }
Ejemplo n.º 2
0
        private void OnEnable()
        {
            // Subscribe all overloaded methods with their respective events
            RelativeEventHandler.SubscribeEvent("Heal", this, "Heal");
            RelativeEventHandler.SubscribeEvent("Damage", this, "Damage");

            // Cache the instance Id
            IdCache.CacheInstanceId(GetInstanceID(), this);
        }
 private void InvokeRelativeEvent(string eventName, int instanceId, object[] args)
 {
     RelativeEventHandler.InvokeEvent(eventName, cache[instanceId], args);
 }