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(); }
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"); } } }
} //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
} //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
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); }
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); }