using System; using System.Collections.Generic; using UnityEngine; namespace Reset.Items{ public abstract class WeaponActor : MonoBehaviour{ public Dictionary weaponEvents = new Dictionary(); public Weapon relatedWeapon; public GameObject relatedObject; public void RegisterWeaponEvent(string calledName, Action action){ weaponEvents.Add(calledName, action); } public void DoWeaponEvent(string eventName){ if (weaponEvents.ContainsKey(eventName)) { weaponEvents[eventName].Invoke(); return; } Debug.LogError($"There is no event by name of {eventName} in {name}"); } } }