public static void StartListening(string eventName, UnityAction <Vector3> listener) { UnityEvent <Vector3> thisEvent = null; if (instance.eventDictionaryVector.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new VectorEvent(); thisEvent.AddListener(listener); instance.eventDictionaryVector.Add(eventName, thisEvent); } }
public virtual void Register() { //speed = ownerState.GetComponent<Stats>().currentMoveSpeed; moveEvent.AddListener(Move); }