Esempio n. 1
0
        /*! \endcond */


        /// <summary>
        /// This method is used to create a Custom Event at runtime.
        /// </summary>
        /// <param name="customEventName">The name of the custom event.</param>
        /// <param name="eventReceiveMode">The receive mode of the event.</param>
        /// <param name="distanceThreshold">The min or max distance to transmit the event to (optional).</param>
        /// <param name="errorOnDuplicate">Whether or not to log an error if the event already exists.</param>
        public static void CreateCustomEvent(string customEventName, CustomEventReceiveMode eventReceiveMode,
            float distanceThreshold, bool errorOnDuplicate = true) {
            if (AppIsShuttingDown) {
                return;
            }

            if (Instance.customEvents.FindAll(delegate(CustomEvent obj) {
                return obj.EventName == customEventName;
            }).Count > 0) {
                if (errorOnDuplicate) {
                    Debug.LogError("You already have a Custom Event named '" + customEventName +
                                   "'. No need to add it again.");
                }
                return;
            }

            var newEvent = new CustomEvent(customEventName) {
                eventReceiveMode = eventReceiveMode,
                distanceThreshold = distanceThreshold
            };

            Instance.customEvents.Add(newEvent);
        }
 public CustomEventSelection(CustomEvent cEvent, bool isSelected)
 {
     Event      = cEvent;
     IsSelected = isSelected;
 }
 public CustomEventSelection(CustomEvent cEvent, bool isSelected)
 {
     Event = cEvent;
     IsSelected = isSelected;
 }