Example #1
0
    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);
        }
    }
Example #2
0
 public virtual void Register()
 {
     //speed = ownerState.GetComponent<Stats>().currentMoveSpeed;
     moveEvent.AddListener(Move);
 }