Пример #1
0
 public static void TryInvoke(this UnityEventTransform evt, Transform value)
 {
     if (evt != null)
     {
         evt.Invoke(value);
     }
 }
Пример #2
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;
    }
    private void OnEnable()
    {
        if (OnSwarmTargetDetectedEvent == null)
        {
            OnSwarmTargetDetectedEvent = new UnityEventTransform();
        }

        if (OnNewSwarmTarget == null)
        {
            OnNewSwarmTarget = new UnityEventSwarm();
        }
    }