Exemple #1
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") + "%");
                }
            }
        }