Exemplo n.º 1
0
        public void Initialise(EventsManagerEventsTab parent,
                               DDNAEventManagerEvent currentEvent,
                               ParameterProvider parameterProvider)
        {
            _parent = parent;

            HashSet <int> existingParameters = FindParametersAlreadyOnEvent(currentEvent.parameters, parameterProvider);

            _addableParameters = FilterParameterList(existingParameters, parameterProvider.Data);
        }
Exemplo n.º 2
0
 public EventsManagerParametersTab(EventsManagerWindow parent,
                                   EventsManagerAuthProvider authProvider,
                                   EventsManagerEnvironmentProvider environmentProvider,
                                   EventsManagerDataProvider <DDNAEventManagerEvent> eventProvider,
                                   ParameterProvider parameterProvider)
 {
     _parent              = parent;
     _authProvider        = authProvider;
     _environmentProvider = environmentProvider;
     _eventProvider       = eventProvider;
     _parameterProvider   = parameterProvider;
     _parameterCreator    = new EventsManagerParameterCreator();
     _parameterCreator.OnParameterCreated += ParameterCreated;
     _parameterCreator.OnCreationFailed   += ParameterCreationFailed;
     _listScrollPosition = Vector2.zero;
 }
Exemplo n.º 3
0
        public EventsManagerEventsTab(EventsManagerWindow parent,
                                      EventsManagerAuthProvider authProvider,
                                      EventsManagerEnvironmentProvider environmentProvider,
                                      EventProvider eventProvider,
                                      ParameterProvider parameterProvider)
        {
            _parent              = parent;
            _authProvider        = authProvider;
            _environmentProvider = environmentProvider;
            _eventProvider       = eventProvider;
            _parameterProvider   = parameterProvider;
            _eventEditor         = new EventsManagerEventEditor(parent);

            _eventEditor.OnEventCreated        += EventCreated;
            _eventEditor.OnEventCreationFailed += EventCreationFailed;

            ClearSelectedEvent();
        }
Exemplo n.º 4
0
        private HashSet <int> FindParametersAlreadyOnEvent(List <DDNAEventManagerEventParameter> existingParameters,
                                                           ParameterProvider allParameters)
        {
            HashSet <int> existingParameterIds = new HashSet <int>();

            foreach (DDNAEventManagerEventParameter parameter in existingParameters)
            {
                existingParameterIds.Add(parameter.id);
            }

            // NOTE: now we need to find the IDs of the special parameters,
            // as they are not included in the Event's own listing (they're outside eventParams)
            foreach (int parameterId in allParameters.SpecialParameterIDs)
            {
                existingParameterIds.Add(parameterId);
            }

            return(existingParameterIds);
        }
Exemplo n.º 5
0
        private void OnEnable()
        {
            _authProvider        = new EventsManagerAuthProvider(this);
            _environmentProvider = new EventsManagerEnvironmentProvider();
            _eventProvider       = new EventProvider();
            _parameterProvider   = new ParameterProvider();

            _environmentProvider.OnResponseArrived += ProviderResponseArrived;
            _eventProvider.OnResponseArrived       += ProviderResponseArrived;
            _parameterProvider.OnResponseArrived   += ProviderResponseArrived;

            _eventsTab     = new EventsManagerEventsTab(this, _authProvider, _environmentProvider, _eventProvider, _parameterProvider);
            _parametersTab = new EventsManagerParametersTab(this, _authProvider, _environmentProvider, _eventProvider, _parameterProvider);

            titleContent = new GUIContent(WINDOW_TITLE);

            _authProvider.LoadCacheToken();

            if (EditorPrefs.HasKey(EDITOR_PREFS_API_KEY))
            {
                _apiKey = EditorPrefs.GetString(EDITOR_PREFS_API_KEY);
            }
        }