Exemple #1
0
        void Update()
        {
            AddAndRemoveRuntime();
            AddAndRemovePersistent();

            _floatEvent.AddListener(ReceviceFloat1);
            _exposedFloatEvent.AddPersistentListener(ReceviceFloat1);

            InvokeRuntime();
            InvokePersistent();

            _floatEvent.RemoveListener(ReceviceFloat1);
            _exposedFloatEvent.RemovePersistentListener(ReceviceFloat1);
        }
Exemple #2
0
    public void StopListening(string eventName, UnityAction <object> listener)
    {
        FloatEvent thisEvent = null;

        if (eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
Exemple #3
0
        public static void StopListeningFloatEvent(string eventName, UnityAction <float> listener)
        {
            Init();
            FloatEvent thisFloatEvent = null;

            if (floatEventDictionary.TryGetValue(eventName, out thisFloatEvent))
            {
                thisFloatEvent.RemoveListener(listener);
            }
        }
    public static void StopListening(string eventName, UnityAction <float> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        FloatEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
    public static void StopListening(Object obj, string eventName, UnityAction <float> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        FloatEvent thisEvent = null;
        string     domain    = GetDomain(obj, eventName);

        if (instance.floatEventDictionary.TryGetValue(domain, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
    public static void StopGlobalListening(string globalEventName, UnityAction <float> listener)
    {
        UnlistDomain(globalEventName);

        if (eventManager == null)
        {
            return;
        }
        FloatEvent thisEvent = null;

        if (instance.floatEventDictionary.TryGetValue(globalEventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
 private void OnMouseDown()
 {
     eventWithFloat.RemoveListener(PassFloat);
 }
 public void StopListening(UnityAction <float> newFloatListener)
 {
     myCollisionDamageEvent.RemoveListener(newFloatListener);
 }
 public static void AddOnce(this FloatEvent thisEvent, UnityAction <float> reciever)
 {
     thisEvent.RemoveListener(reciever);
     thisEvent.AddListener(reciever);
 }
 private void OnDisable()
 {
     evt.RemoveListener(this);
 }
Exemple #11
0
 private void OnDisable()
 {
     changeTimeScale.RemoveListener(ChangeTimeScale);
 }
Exemple #12
0
 public void Unsubscribe(UnityAction <float> action)
 {
     _normalScaleEvent.RemoveListener(action);
     _slowScaleEvent.AddListener(action);
 }