public static void emit(EventManagerType emt)
 {
     if (onEvent != null)
     {
         onEvent(emt);
     }
 }
 public static void emit(EventManagerType emt)
 {
     if (onEvent != null)
     {
         onEvent(emt);
     }
 }
示例#3
0
        public static void TriggerEvent(EventManagerType eventType)
        {
            UnityEvent thisEvent;

            if (Instance._eventDictionary.TryGetValue(eventType, out thisEvent))
            {
                thisEvent.Invoke();
            }
        }
示例#4
0
    // iTween.ShakePosition(gameObject, new Vector3(1, 1, 0), 1);
    /// <summary>
    /// Effects the specified emt.
    /// </summary>
    /// <param name="emt">The emt.</param>
    void Effect(EventManagerType emt)
    {
        switch (emt)
        {
            case  EventManagerType.FISHEYEBUMP:
                StartCoroutine(StartToFisheye());
                break;

            case EventManagerType.DASH:
                StartCoroutine(Dash());
                break;
        }
    }
示例#5
0
    // iTween.ShakePosition(gameObject, new Vector3(1, 1, 0), 1);

    /// <summary>
    /// Effects the specified emt.
    /// </summary>
    /// <param name="emt">The emt.</param>
    void Effect(EventManagerType emt)
    {
        switch (emt)
        {
        case  EventManagerType.FISHEYEBUMP:
            StartCoroutine(StartToFisheye());
            break;

        case EventManagerType.DASH:
            StartCoroutine(Dash());
            break;
        }
    }
示例#6
0
        public static void StopListening(EventManagerType eventType, UnityAction listener)
        {
            // No need create again for remove
            if (_eventManager == null)
            {
                return;
            }

            UnityEvent thisEvent;

            if (_eventManager._eventDictionary.TryGetValue(eventType, out thisEvent))
            {
                thisEvent.RemoveListener(listener);
            }
        }
示例#7
0
        public static void StartListening(EventManagerType eventName, UnityAction listener)
        {
            UnityEvent thisEvent;

            if (Instance._eventDictionary.TryGetValue(eventName, out thisEvent))
            {
                thisEvent.AddListener(listener);
            }
            else
            {
                thisEvent = new UnityEvent();
                thisEvent.AddListener(listener);
                Instance._eventDictionary.Add(eventName, thisEvent);
            }
        }