Exemplo n.º 1
0
        private int DrawEvent(int index)
        {
            var event_ = events.GetArrayElementAtIndex(index);

            UnityGUI.BeginHorizontal();

            var foldout = Foldout(TriggerName, event_, "foldout", FoldoutOptions);

            DrawTriggerSpace(event_);

            var deleteIndex = -1;

            if (UnityGUI.Button("X", RemoveButtonOptions))
            {
                deleteIndex = index;
            }

            UnityGUI.EndHorizontal();

            if (foldout)
            {
                Field(true, event_, "unityEvent");
            }

            return(deleteIndex);
        }
Exemplo n.º 2
0
        private void DrawAddEventButton()
        {
            UnityGUI.BeginHorizontal();
            UnityGUI.FlexibleSpace();
            if (UnityGUI.Button("+", AddButtonOptions))
            {
                events.arraySize++;
            }

            UnityGUI.EndHorizontal();
        }
Exemplo n.º 3
0
        void OnGUI()
        {
            UnityGUI.Space();
            _dataType = UnityGUI.Enum("Data Type", _dataType);

            UnityGUI.Space();
            UnityGUI.Label("Parameters", UnityGUI.BoldLabel);

            _headset = UnityGUI.Enum("Headset Model", _headset);
            if (_dataType == DataType.Phosphene)
            {
                _pattern = UnityGUI.Enum("Electrode Pattern", _pattern);
                _layout  = UnityGUI.Enum("Electrode Layout", _layout);
            }

            UnityGUI.Space();
            _gpuAccel = UnityGUI.ToggleLeft("GPU Accelerated", _gpuAccel);

            if (UnityGUI.Button(!cpuStarted ? "Start" : "Stop", new GUIOptions {
                maxWidth = 50
            }))
            {
                if (!cpuStarted)
                {
                    Start();
                }
                else
                {
                    StopCPU();
                }
            }

            if (threadGroup != null)
            {
                UnityGUI.Enabled = cpuStarted || !_gpuAccel;
                UnityGUI.Space();
                UnityGUI.Label("CPU Threads", UnityGUI.BoldLabel);

                for (int i = 0; i < threadGroup.NumThreads; i++)
                {
                    UnityGUI.Label("Thread " + i.ToString(), (threadGroup.Progress[i] * 100).ToString("N0") + "%");
                }
            }
        }