public EventStatus ProcessEvent(Fabric.Event zEvent) { _runtimeEvent.Copy(_event); _runtimeEvent.parentGameObject = zEvent.parentGameObject; _runtimeEvent._eventName = zEvent._eventName; if (_ignoreEventAction) { _runtimeEvent.Copy(zEvent); _runtimeEvent.EventAction = zEvent.EventAction; } else { if (zEvent._forceEventAction) { _runtimeEvent.EventAction = zEvent.EventAction; } BuildEvent(); } if (_runtimeEvent.EventAction == EventAction.SetGlobalParameter || _runtimeEvent.EventAction == EventAction.SetGlobalSwitch || _runtimeEvent.EventAction == EventAction.AddPreset || _runtimeEvent.EventAction == EventAction.RemovePreset || _runtimeEvent.EventAction == EventAction.SwitchPreset || _runtimeEvent.EventAction == EventAction.ResetDynamicMixer || _runtimeEvent.EventAction == EventAction.TransitionToSnapshot || _runtimeEvent.EventAction == EventAction.LoadAudioMixer || _runtimeEvent.EventAction == EventAction.UnloadAudioMixer || _runtimeEvent.EventAction == EventAction.MicStart || _runtimeEvent.EventAction == EventAction.MicStop) { EventManager.Instance.ProcessEvent(_runtimeEvent); } else if (_component != null) { _runtimeEvent.eventStatus = ((IEventListener)_component).Process(_runtimeEvent); } if (Application.isEditor && _runtimeEvent.eventStatus != EventStatus.Not_Handled && _runtimeEvent.EventAction == EventAction.PlaySound) { EventManager.Instance.AddActiveEvent(_runtimeEvent, _component); } zEvent.Copy(_runtimeEvent); return(_runtimeEvent.eventStatus); }
private Event ApplyOverrideEventActions(List <EventListener> eventListeners, Event originalEvent, Event overrideEvent) { bool flag = true; for (int i = 0; i < eventListeners.Count; i++) { EventListener eventListener = eventListeners[i]; if (eventListener._overrideParameters == null || !eventListener._overrideEventTriggerAction) { continue; } flag = true; overrideEvent.Copy(originalEvent); if (eventListener._overrideParameters._overrideIncomingEventAction) { if (eventListener._overrideParameters._incomingEventAction != originalEvent.EventAction) { flag = false; continue; } overrideEvent.EventAction = eventListener._overrideParameters._overrideEventAction; } else { overrideEvent.EventAction = eventListener._overrideParameters._overrideEventAction; } if (eventListener._overrideParameters._type == OverrideParameterType.Float) { overrideEvent._parameter = eventListener._overrideParameters.FloatParameter; } else if (eventListener._overrideParameters._type == OverrideParameterType.String) { overrideEvent._parameter = eventListener._overrideParameters.StringParameter; } else if (eventListener._overrideParameters._type == OverrideParameterType.SwitchPresetData) { overrideEvent._parameter = eventListener._overrideParameters.SwitchPresetData; } else if (eventListener._overrideParameters._type == OverrideParameterType.DSPParameterData) { overrideEvent._parameter = eventListener._overrideParameters.DSPParameterData; } else if (eventListener._overrideParameters._type == OverrideParameterType.TransitionToSnapshotData) { overrideEvent._parameter = eventListener._overrideParameters.TransitionToSnapshotData; } if (flag) { return(overrideEvent); } } if (!flag) { return(null); } return(originalEvent); }
public VirtualizationEventInstance Alloc(Event e) { if (_eventInstancePool.Count == 0) { DebugLog.Print("VirtualizationEventInstance: Failed to allocate event instance for Event: " + e._eventName, DebugLevel.Error); return(null); } VirtualizationEventInstance virtualizationEventInstance = _eventInstancePool.Dequeue(); Event @event = new Event(); @event.Copy(e); virtualizationEventInstance._event = @event; return(virtualizationEventInstance); }