コード例 #1
0
        void Update()
        {
            AddAndRemoveRuntime();
            AddAndRemovePersistent();

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

            InvokeRuntime();
            InvokePersistent();

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

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

            if (floatEventDictionary.TryGetValue(eventName, out thisFloatEvent))
            {
                thisFloatEvent.RemoveListener(listener);
            }
        }
コード例 #4
0
    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);
        }
    }
コード例 #5
0
    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);
        }
    }
コード例 #6
0
    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);
        }
    }
コード例 #7
0
 private void OnMouseDown()
 {
     eventWithFloat.RemoveListener(PassFloat);
 }
コード例 #8
0
 public void StopListening(UnityAction <float> newFloatListener)
 {
     myCollisionDamageEvent.RemoveListener(newFloatListener);
 }
コード例 #9
0
 public static void AddOnce(this FloatEvent thisEvent, UnityAction <float> reciever)
 {
     thisEvent.RemoveListener(reciever);
     thisEvent.AddListener(reciever);
 }
コード例 #10
0
 private void OnDisable()
 {
     evt.RemoveListener(this);
 }
コード例 #11
0
 private void OnDisable()
 {
     changeTimeScale.RemoveListener(ChangeTimeScale);
 }
コード例 #12
0
 public void Unsubscribe(UnityAction <float> action)
 {
     _normalScaleEvent.RemoveListener(action);
     _slowScaleEvent.AddListener(action);
 }