Пример #1
0
    public void RegisterEvent(GameEvent listenedEvent, UnityEvent responseEvent)
    {
        Debug.Log(responseEvent.ToString());
        Event = listenedEvent;
        Event.RegisterListener(this);

        response = responseEvent;
    }
    public void OnSelection()
    {
        // method called when this object is selected by the BCI

        Debug.Log("-------------- Selected: " + myobjID + "---------------------");
        // invoke our selection handler
        Debug.Log("Invoking:" + selectedEvent.ToString());
        selectedEvent.Invoke();
    }
Пример #3
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Z))
        {
            //List<string> eventNames = instance.eventDictionary.Keys.ToList();
            //List<UnityEvent> eventsList = instance.eventDictionary.Values.ToList();

            //Debug.Log(eventNames + " - " + eventsList);

            if (instance.eventDictionary.Count != 0)
            {
                foreach (string key in instance.eventDictionary.Keys)
                {
                    UnityEvent uEvent = null;
                    instance.eventDictionary.TryGetValue(key, out uEvent);
                    Debug.Log(key + " - " + uEvent.ToString());
                }
            }
            else
            {
                Debug.Log("NOTHING IN EVENT DICTIONARY");
            }
        }
    }
Пример #4
0
        } //END Show

        //---------------------------------------//
        public void Hide( float fadeSpeed, float delay, EaseCurve.EaseType easeCurve, UnityEvent onCompleteFunction )
        //---------------------------------------// 
        {

            if( showDebug ) { Debug.Log( "ScreenFadeManager.cs Hide( onComplete ) " + onCompleteFunction.ToString() ); }

            if( uiColorTweenManager_ScreenFader != null )
            {
                uiColorTweenManager_ScreenFader.PlayAlpha( 0f, fadeSpeed, delay, easeCurve, onCompleteFunction );
            }

        } //END Hide
Пример #5
0
        } //END Force

        //---------------------------------------//
        public void Show( Color fadeToColor, float fadeSpeed, float delay, EaseCurve.EaseType easeCurve, UnityEvent onCompleteFunction )
        //---------------------------------------// 
        {

            if( showDebug ) { Debug.Log( "ScreenFadeManager.cs Show( onComplete ) " + onCompleteFunction.ToString() ); }

            if( uiColorTweenManager_ScreenFader != null )
            {
                uiColorTweenManager_ScreenFader.Play( UITweener.TweenValue.Show, fadeToColor, fadeSpeed, delay, easeCurve, onCompleteFunction );
            }

        } //END Show
Пример #6
0
        public static List <UnityAction> GetNonPersistentListeners(this UnityEvent unityEvent)
        {
            if (_nonPersistentListeners.ContainsKey(unityEvent))
            {
                return(_nonPersistentListeners[unityEvent]);
            }

            //else
            System.Console.WriteLine("No non persistent listeners were found for the following event : " + unityEvent.ToString());
            return(null);
        }
Пример #7
0
        public static int GetNonPersistentListenersCount(this UnityEvent unityEvent)
        {
            if (_nonPersistentListeners.ContainsKey(unityEvent))
            {
                return(_nonPersistentListeners[unityEvent].Count);
            }

            //else
            System.Console.WriteLine("No non persistent listener was found for the following event : " + unityEvent.ToString());
            return(-1);
        }