示例#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);
        }
示例#2
0
        private void DrawVive()
        {
            UnityGUI.Space();
            UnityGUI.Label("Vive_LeftController");
            UnityGUI.IndentLevel++;

            var pos = VRInput.LeftHandPosition;
            var rot = VRInput.LeftHandRotation.eulerAngles;

            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position X: " + pos.x.ToString("0.000"));
            UnityGUI.Label("Rotation X: " + rot.x.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Y: " + pos.y.ToString("0.000"));
            UnityGUI.Label("Rotation Y: " + rot.y.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Z: " + pos.z.ToString("0.000"));
            UnityGUI.Label("Rotation Z: " + rot.z.ToString("0.000"));
            UnityGUI.EndHorizontal();

            ButtonStateLabel(VRButton.Vive_LeftMenu);
            ButtonStateLabel(VRButton.Vive_LeftTrackpad);
            ButtonStateLabel(VRButton.Vive_LeftTrigger);
            AxisStateLabel(VRButton.Vive_LeftTrigger);
            AxisStateLabel(VRButton.Vive_LeftGrip);
            AxesStateLabel(VRButton.Vive_LeftTrackpad);
            UnityGUI.IndentLevel--;

            UnityGUI.Space();
            UnityGUI.Label("Vive_RightController");
            UnityGUI.IndentLevel++;

            pos = VRInput.RightHandPosition;
            rot = VRInput.RightHandRotation.eulerAngles;
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position X: " + pos.x.ToString("0.000"));
            UnityGUI.Label("Rotation X: " + rot.x.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Y: " + pos.y.ToString("0.000"));
            UnityGUI.Label("Rotation Y: " + rot.y.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Z: " + pos.z.ToString("0.000"));
            UnityGUI.Label("Rotation Z: " + rot.z.ToString("0.000"));
            UnityGUI.EndHorizontal();

            ButtonStateLabel(VRButton.Vive_RightMenu);
            ButtonStateLabel(VRButton.Vive_RightTrackpad);
            ButtonStateLabel(VRButton.Vive_RightTrigger);
            AxisStateLabel(VRButton.Vive_RightTrigger);
            AxisStateLabel(VRButton.Vive_RightGrip);
            AxesStateLabel(VRButton.Vive_RightTrackpad);
            UnityGUI.IndentLevel--;
        }
示例#3
0
        private void DrawAddEventButton()
        {
            UnityGUI.BeginHorizontal();
            UnityGUI.FlexibleSpace();
            if (UnityGUI.Button("+", AddButtonOptions))
            {
                events.arraySize++;
            }

            UnityGUI.EndHorizontal();
        }
示例#4
0
        void OnGUI()
        {
            UnityGUI.Header("Coordinates");
            headset = UnityGUI.Enum("Headset", headset);

            UnityGUI.Space();

            UnityGUI.BeginHorizontal();
            UnityGUI.Label(" ", "X", UnityGUI.BoldLabel);
            UnityGUI.Label("Y", UnityGUI.BoldLabel);
            UnityGUI.EndHorizontal();

            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Resolution", headset.GetWidth().ToString());
            UnityGUI.Label(headset.GetHeight().ToString());
            UnityGUI.EndHorizontal();

            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Field of View", ((int)headset.GetFieldOfView(Axis.Horizontal)).ToString());
            UnityGUI.Label(((int)headset.GetFieldOfView(Axis.Vertical)).ToString());
            UnityGUI.EndHorizontal();

            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Diameter (um)", ((int)headset.GetRetinalDiameter(Axis.Horizontal)).ToString());
            UnityGUI.Label(((int)headset.GetRetinalDiameter(Axis.Vertical)).ToString());
            UnityGUI.EndHorizontal();

            UnityGUI.Space();

            Draw("Pixel", ref pixel);
            Draw("Visual Angle", ref angle);
            Draw("Retina (um)", ref retina);
            Draw("Polar", ref polar);

            UnityGUI.Separator();
            UnityGUI.Header("Electrode Count");

            UnityGUI.BeginChangeCheck();
            pattern     = UnityGUI.Enum("Pattern", pattern);
            layout      = UnityGUI.Enum("Layout", layout);
            fieldOfView = UnityGUI.Float("Field of View", fieldOfView);
            var changed = UnityGUI.EndChangeCheck();

            if (changed)
            {
                numElectrodes = pattern.GetElectrodePositions(layout, fieldOfView).Length;
            }

            UnityGUI.Space();
            UnityGUI.Label("Electode Count", numElectrodes.ToString());
        }
示例#5
0
        private void DrawOculus()
        {
            UnityGUI.Space();
            UnityGUI.Label("Rift_LeftController");
            UnityGUI.IndentLevel++;

            var pos = VRInput.LeftHandPosition;
            var rot = VRInput.LeftHandRotation.eulerAngles;

            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position X: " + pos.x.ToString("0.000"));
            UnityGUI.Label("Rotation X: " + rot.x.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Y: " + pos.y.ToString("0.000"));
            UnityGUI.Label("Rotation Y: " + rot.y.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Z: " + pos.z.ToString("0.000"));
            UnityGUI.Label("Rotation Z: " + rot.z.ToString("0.000"));
            UnityGUI.EndHorizontal();

            ButtonStateLabel(VRButton.Rift_X);
            ButtonStateLabel(VRButton.Rift_Y);
            ButtonStateLabel(VRButton.Rift_Start);
            ButtonStateLabel(VRButton.Rift_LeftThumbstick);
            ButtonStateLabel(VRButton.Rift_LeftThumbRest);
            ButtonStateLabel(VRButton.Rift_LeftIndexTrigger);
            AxisStateLabel(VRButton.Rift_LeftIndexTrigger);
            AxisStateLabel(VRButton.Rift_LeftMiddleTrigger);
            AxesStateLabel(VRButton.Rift_LeftThumbstick);
            UnityGUI.IndentLevel--;

            UnityGUI.Space();
            UnityGUI.Label("Rift_RightController");
            UnityGUI.IndentLevel++;

            pos = VRInput.RightHandPosition;
            rot = VRInput.RightHandRotation.eulerAngles;
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position X: " + pos.x.ToString("0.000"));
            UnityGUI.Label("Rotation X: " + rot.x.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Y: " + pos.y.ToString("0.000"));
            UnityGUI.Label("Rotation Y: " + rot.y.ToString("0.000"));
            UnityGUI.EndHorizontal();
            UnityGUI.BeginHorizontal();
            UnityGUI.Label("Position Z: " + pos.z.ToString("0.000"));
            UnityGUI.Label("Rotation Z: " + rot.z.ToString("0.000"));
            UnityGUI.EndHorizontal();

            ButtonStateLabel(VRButton.Rift_A);
            ButtonStateLabel(VRButton.Rift_B);
            ButtonStateLabel(VRButton.Rift_RightThumbstick);
            ButtonStateLabel(VRButton.Rift_RightThumbRest);
            ButtonStateLabel(VRButton.Rift_RightIndexTrigger);
            AxisStateLabel(VRButton.Rift_RightIndexTrigger);
            AxisStateLabel(VRButton.Rift_RightMiddleTrigger);
            AxesStateLabel(VRButton.Rift_RightThumbstick);
            UnityGUI.IndentLevel--;
        }