Пример #1
0
        public void fireEvent()
        {
            var domain = findDomain();

            if (domain == null)
            {
                Debug.Log("WARNING: no domain root found");
                return;
            }
            var renderData = EventLocator.Dispatch(domain, address, eventParameters);

            PublicRenderer.Render(this.gameObject, renderData);
        }
Пример #2
0
        private void fireEvent()
        {
            var renderData = EventLocator.Dispatch(domain, address, eventParameters);

            PublicRenderer.Render(this.gameObject, renderData);
        }
Пример #3
0
        /// <summary>
        /// Get an event grid event based on the input parameters. This method accepts any <see cref="ResponseBaseDTO" />.
        /// Event type will be extracted from the DTO.
        /// </summary>
        /// <param name="anyDto">Any dto.</param>
        /// <param name="subject">The subject.</param>
        /// <param name="appendEventIdToSubject">if set to <c>true</c> [append event identifier to subject].</param>
        /// <param name="dataVersion">The data version.</param>
        /// <param name="locator">The locator.</param>
        /// <returns>
        /// An <see cref="EventGridEvent" />
        /// </returns>
        public EventGridEvent GetEventGridEventFromResponseDTO(ResponseBaseDTO anyDto, string subject, bool appendEventIdToSubject = true, string dataVersion = "1.0", EventLocator locator = null)
        {
            if (anyDto == null)
            {
                throw new ArgumentNullException(nameof(anyDto));
            }

            var eventGridEventId = Guid.NewGuid().ToString();

            var eventToPublish = new EventGridEvent
            {
                Id          = eventGridEventId,
                Data        = anyDto,
                EventTime   = DateTime.UtcNow,
                EventType   = anyDto.ReturnEventType,
                Subject     = appendEventIdToSubject ? $"{subject}/{eventGridEventId}" : subject,
                DataVersion = dataVersion,
            };

            return(locator == null ? eventToPublish : eventToPublish.DecorateWith(locator));
        }