EventStatus IEventListener.Process(Event zEvent)
        {
            EventStatus result = EventStatus.Not_Handled;

            switch (zEvent.EventAction)
            {
            case EventAction.SetGlobalParameter:
            {
                GlobalParameterData globalParameterData = (GlobalParameterData)zEvent._parameter;
                if (globalParameterData != null)
                {
                    SetGlobalParameter(globalParameterData._name, globalParameterData._value);
                    result = EventStatus.Handled;
                }
                break;
            }

            case EventAction.SetGlobalSwitch:
            {
                GlobalSwitchParameterData globalSwitchParameterData = (GlobalSwitchParameterData)zEvent._parameter;
                if (globalSwitchParameterData != null)
                {
                    SetGlobalSwitch(globalSwitchParameterData._name, globalSwitchParameterData._switch);
                    result = EventStatus.Handled;
                }
                break;
            }
            }
            return(result);
        }
예제 #2
0
 public bool SetGlobalParameter(string parameterName, float value)
 {
     if (_forceQueueAllEvents)
     {
         globalParameter = new GlobalParameterData();
     }
     globalParameter._name  = parameterName;
     globalParameter._value = value;
     return(PostEvent("GlobalParameter", EventAction.SetGlobalParameter, globalParameter));
 }