コード例 #1
0
 public static void TryInvoke(this UnityEventString evt, string value)
 {
     if (evt != null)
     {
         evt.Invoke(value);
     }
 }
コード例 #2
0
 public void AddListenerToAnnotateEndSensorBookmarkEvent(UnityAction <string> listener)
 {
     if (AnnotateEndSensorBookmarkEvent == null)
     {
         AnnotateEndSensorBookmarkEvent = new UnityEventString();
     }
     AnnotateEndSensorBookmarkEvent.AddListener(listener);
 }
コード例 #3
0
    public static void TriggerEvent(string eventName, string param)
    {
        UnityEventString thisEvent = null;

        if (instance.eventParamDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(param);
        }
    }
コード例 #4
0
    // Custom Unity Event validation
    public void OnValidate()
    {
        response = Event != null && Event.UnityEventType == typeof(UnityEvent) ? response : null;

        responseGameObject = Event != null && Event.UnityEventType == typeof(UnityEventGameObject) ? responseGameObject : null;
        responseTransform  = Event != null && Event.UnityEventType == typeof(UnityEventTransform) ? responseTransform : null;
        responseInt        = Event != null && Event.UnityEventType == typeof(UnityEventInt) ? responseInt : null;
        responseFloat      = Event != null && Event.UnityEventType == typeof(UnityEventFloat) ? responseFloat : null;
        responseBool       = Event != null && Event.UnityEventType == typeof(UnityEventBool) ? responseBool : null;
        responseString     = Event != null && Event.UnityEventType == typeof(UnityEventString) ? responseString : null;
    }
コード例 #5
0
    public static void StopListening(string eventName, UnityAction <string> listener)
    {
        if (eventManager == null)
        {
            return;
        }

        UnityEventString thisEvent = null;

        if (instance.eventParamDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
コード例 #6
0
    public static void StartListening(string eventName, UnityAction <string> listener)
    {
        UnityEventString thisEvent;

        if (instance.eventParamDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.AddListener(listener);
        }
        else
        {
            thisEvent = new UnityEventString();
            thisEvent.AddListener(listener);
            instance.eventParamDictionary.Add(eventName, thisEvent);
        }
    }
コード例 #7
0
 public void SetOnLanguageChanged(UnityEventString value)
 {
     onLanguageChanged = value;
 }
コード例 #8
0
 public void SetOnTalk(UnityEventString value)
 {
     onTalk = value;
 }