// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.RecordObject(m_Component, "OVRPlayerController"); { m_Component.Acceleration = EditorGUILayout.Slider("Acceleration", m_Component.Acceleration, 0, 1); m_Component.Damping = EditorGUILayout.Slider("Damping", m_Component.Damping, 0, 1); m_Component.BackAndSideDampen = EditorGUILayout.Slider("Back and Side Dampen", m_Component.BackAndSideDampen, 0, 1); // m_Component.JumpForce = EditorGUILayout.Slider("Jump Force", m_Component.JumpForce, 0, 10); m_Component.RotationAmount = EditorGUILayout.Slider("Rotation Amount", m_Component.RotationAmount, 0, 5); m_Component.RotationRatchet = EditorGUILayout.Slider("Rotation Ratchet", m_Component.RotationRatchet, 0, 180); OVREditorGUIUtility.Separator(); m_Component.GravityModifier = EditorGUILayout.Slider("Gravity Modifier", m_Component.GravityModifier, 0, 1); OVREditorGUIUtility.Separator(); } if (GUI.changed) { EditorUtility.SetDirty(m_Component); } }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; #pragma warning disable 0618 Undo.SetSnapshotTarget(m_Component, "OVRPlayerController"); #pragma warning restore 0618 { m_Component.Acceleration = EditorGUILayout.Slider("Acceleration", m_Component.Acceleration, 0, 1); m_Component.Damping = EditorGUILayout.Slider("Damping", m_Component.Damping, 0, 1); m_Component.BackAndSideDampen = EditorGUILayout.Slider("Back and Side Dampen", m_Component.BackAndSideDampen, 0, 1); // m_Component.JumpForce = EditorGUILayout.Slider("Jump Force", m_Component.JumpForce, 0, 10); m_Component.RotationAmount = EditorGUILayout.Slider("Rotation Amount", m_Component.RotationAmount, 0, 5); OVREditorGUIUtility.Separator(); m_Component.GravityModifier = EditorGUILayout.Slider("Gravity Modifier", m_Component.GravityModifier, 0, 1); OVREditorGUIUtility.Separator(); } if (GUI.changed) { #pragma warning disable 0618 Undo.CreateSnapshot(); Undo.RegisterSnapshot(); EditorUtility.SetDirty(m_Component); } Undo.ClearSnapshotTarget(); #pragma warning restore 0618 }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; { m_MotorFoldout = EditorGUILayout.Foldout(m_MotorFoldout, "Motor"); if (m_MotorFoldout) { m_Component.Acceleration = EditorGUILayout.Slider("Acceleration", m_Component.Acceleration, 0, 1); m_Component.Damping = EditorGUILayout.Slider("Damping", m_Component.Damping, 0, 1); m_Component.JumpForce = EditorGUILayout.Slider("Jump Force", m_Component.JumpForce, 0, 10); m_Component.RotationAmount = EditorGUILayout.Slider("Rotation Amount", m_Component.RotationAmount, 0, 5); OVREditorGUIUtility.Separator(); } m_PhysicsFoldout = EditorGUILayout.Foldout(m_PhysicsFoldout, "Physics"); if (m_PhysicsFoldout) { m_Component.GravityModifier = EditorGUILayout.Slider("Gravity Modifier", m_Component.GravityModifier, 0, 1); OVREditorGUIUtility.Separator(); } } if (GUI.changed) { EditorUtility.SetDirty(target); } }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.SetSnapshotTarget(m_Component, "OVRPlayerController"); { m_Component.Acceleration = EditorGUILayout.Slider("Acceleration", m_Component.Acceleration, 0, 1); m_Component.Damping = EditorGUILayout.Slider("Damping", m_Component.Damping, 0, 1); m_Component.BackAndSideDampen = EditorGUILayout.Slider("Back and Side Dampen", m_Component.BackAndSideDampen, 0, 1); // m_Component.JumpForce = EditorGUILayout.Slider("Jump Force", m_Component.JumpForce, 0, 10); m_Component.RotationAmount = EditorGUILayout.Slider("Rotation Amount", m_Component.RotationAmount, 0, 5); m_Component.DirXform = EditorGUILayout.ObjectField("Hip Direction", m_Component.DirXform, typeof(Transform), true) as Transform; OVREditorGUIUtility.Separator(); m_Component.GravityModifier = EditorGUILayout.Slider("Gravity Modifier", m_Component.GravityModifier, 0, 1); OVREditorGUIUtility.Separator(); } if (GUI.changed) { Undo.CreateSnapshot(); Undo.RegisterSnapshot(); EditorUtility.SetDirty(m_Component); } Undo.ClearSnapshotTarget(); }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.RecordObject(m_Component, "OVRCameraController"); { #if CUSTOM_LAYOUT OVREditorGUIUtility.Separator(); m_Component.IPD = EditorGUILayout.FloatField("IPD", m_Component.IPD); m_Component.CameraTextureScale = EditorGUILayout.FloatField("Camera Texture Scale", m_Component.CameraTextureScale); m_Component.ScaleRenderTarget = EditorGUILayout.FloatField("Scale Render", m_Component.ScaleRenderTarget); OVREditorGUIUtility.Separator(); m_Component.CameraRootPosition = EditorGUILayout.Vector3Field("Camera Root Position", m_Component.CameraRootPosition); m_Component.NeckPosition = EditorGUILayout.Vector3Field("Neck Position", m_Component.NeckPosition); OVREditorGUIUtility.Separator(); m_Component.UsePlayerEyeHeight = EditorGUILayout.Toggle("Use Player Eye Height", m_Component.UsePlayerEyeHeight); OVREditorGUIUtility.Separator(); m_Component.FollowOrientation = EditorGUILayout.ObjectField("Follow Orientation", m_Component.FollowOrientation, typeof(Transform), true) as Transform; m_Component.TrackerRotatesY = EditorGUILayout.Toggle("Tracker Rotates Y", m_Component.TrackerRotatesY); OVREditorGUIUtility.Separator(); m_Component.EnableOrientation = EditorGUILayout.Toggle("Enable Orientation", m_Component.EnableOrientation); m_Component.EnablePosition = EditorGUILayout.Toggle("Enable Position", m_Component.EnablePosition); m_Component.PredictionOn = EditorGUILayout.Toggle("Prediction On", m_Component.PredictionOn); m_Component.TimeWarp = EditorGUILayout.Toggle("Time Warp", m_Component.TimeWarp); m_Component.FreezeTimeWarp = EditorGUILayout.Toggle("Freeze Time Warp", m_Component.FreezeTimeWarp); m_Component.Mirror = EditorGUILayout.Toggle("Mirror to Display", m_Component.Mirror); OVREditorGUIUtility.Separator(); m_Component.BackgroundColor = EditorGUILayout.ColorField("Background Color", m_Component.BackgroundColor); m_Component.NearClipPlane = EditorGUILayout.FloatField("Near Clip Plane", m_Component.NearClipPlane); m_Component.FarClipPlane = EditorGUILayout.FloatField("Far Clip Plane", m_Component.FarClipPlane); OVREditorGUIUtility.Separator(); #else DrawDefaultInspector(); #endif } if (GUI.changed) { EditorUtility.SetDirty(m_Component); } }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.SetSnapshotTarget(m_Component, "OVRCameraController"); { #if CUSTOM_LAYOUT OVREditorGUIUtility.Separator(); m_Component.VerticalFOV = EditorGUILayout.FloatField("Vertical FOV", m_Component.VerticalFOV); m_Component.IPD = EditorGUILayout.FloatField("IPD", m_Component.IPD); OVREditorGUIUtility.Separator(); m_Component.CameraRootPosition = EditorGUILayout.Vector3Field("Camera Root Position", m_Component.CameraRootPosition); m_Component.NeckPosition = EditorGUILayout.Vector3Field("Neck Position", m_Component.NeckPosition); m_Component.EyeCenterPosition = EditorGUILayout.Vector3Field("Eye Center Position", m_Component.EyeCenterPosition); OVREditorGUIUtility.Separator(); m_Component.UsePlayerEyeHeight = EditorGUILayout.Toggle("Use Player Eye Height", m_Component.UsePlayerEyeHeight); OVREditorGUIUtility.Separator(); m_Component.FollowOrientation = EditorGUILayout.ObjectField("Follow Orientation", m_Component.FollowOrientation, typeof(Transform), true) as Transform; m_Component.TrackerRotatesY = EditorGUILayout.Toggle("Tracker Rotates Y", m_Component.TrackerRotatesY); OVREditorGUIUtility.Separator(); // Remove Portrait Mode from Inspector window for now //m_Component.PortraitMode = EditorGUILayout.Toggle ("Portrait Mode", m_Component.PortraitMode); m_Component.PredictionOn = EditorGUILayout.Toggle("Prediction On", m_Component.PredictionOn); m_Component.CallInPreRender = EditorGUILayout.Toggle("Call in Pre-Render", m_Component.CallInPreRender); m_Component.WireMode = EditorGUILayout.Toggle("Wire-Frame Mode", m_Component.WireMode); m_Component.LensCorrection = EditorGUILayout.Toggle("Lens Correction", m_Component.LensCorrection); m_Component.Chromatic = EditorGUILayout.Toggle("Chromatic", m_Component.Chromatic); OVREditorGUIUtility.Separator(); #else DrawDefaultInspector(); #endif } if (GUI.changed) { Undo.CreateSnapshot(); Undo.RegisterSnapshot(); EditorUtility.SetDirty(m_Component); } Undo.ClearSnapshotTarget(); }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.SetSnapshotTarget(m_Component, "OVRCameraController"); { #if CUSTOM_LAYOUT m_Component.NeckPosition = EditorGUILayout.Vector3Field("Neck Position", m_Component.NeckPosition); m_Component.EyeCenterPosition = EditorGUILayout.Vector3Field("Eye Center Position", m_Component.EyeCenterPosition); OVREditorGUIUtility.Separator(); m_Component.FollowOrientation = EditorGUILayout.ObjectField("Follow Orientation", m_Component.FollowOrientation, typeof(Transform), true) as Transform; m_Component.TrackerRotatesY = EditorGUILayout.Toggle("Tracker Rotates Y", m_Component.TrackerRotatesY); OVREditorGUIUtility.Separator(); m_Component.PredictionOn = EditorGUILayout.Toggle("Prediction On", m_Component.PredictionOn); m_Component.CallInPreRender = EditorGUILayout.Toggle("Call in Pre-Render", m_Component.CallInPreRender); m_Component.WireMode = EditorGUILayout.Toggle("Wire-Frame Mode", m_Component.WireMode); m_Component.LensCorrection = EditorGUILayout.Toggle("Lens Correction", m_Component.LensCorrection); m_Component.Chromatic = EditorGUILayout.Toggle("Chromatic", m_Component.Chromatic); OVREditorGUIUtility.Separator(); m_Component.BackgroundColor = EditorGUILayout.ColorField("Background Color", m_Component.BackgroundColor); m_Component.NearClipPlane = EditorGUILayout.FloatField("Near Clip Plane", m_Component.NearClipPlane); m_Component.FarClipPlane = EditorGUILayout.FloatField("Far Clip Plane", m_Component.FarClipPlane); OVREditorGUIUtility.Separator(); #else DrawDefaultInspector(); #endif } if (GUI.changed) { Undo.CreateSnapshot(); Undo.RegisterSnapshot(); EditorUtility.SetDirty(m_Component); } Undo.ClearSnapshotTarget(); }
// OnInspectorGUI public override void OnInspectorGUI() { GUI.color = Color.white; Undo.RecordObject(m_Component, "OVRCameraController"); { #if CUSTOM_LAYOUT OVREditorGUIUtility.Separator(); m_Component.VerticalFOV = EditorGUILayout.FloatField("Vertical FOV", m_Component.VerticalFOV); m_Component.IPD = EditorGUILayout.FloatField("IPD", m_Component.IPD); m_Component.ScaleRenderTarget = EditorGUILayout.FloatField("Scale Render", m_Component.ScaleRenderTarget); OVREditorGUIUtility.Separator(); m_Component.CameraRootPosition = EditorGUILayout.Vector3Field("Camera Root Position", m_Component.CameraRootPosition); m_Component.NeckPosition = EditorGUILayout.Vector3Field("Neck Position", m_Component.NeckPosition); m_Component.EyeCenterPosition = EditorGUILayout.Vector3Field("Eye Center Position", m_Component.EyeCenterPosition); OVREditorGUIUtility.Separator(); m_Component.UsePlayerEyeHeight = EditorGUILayout.Toggle("Use Player Eye Hght", m_Component.UsePlayerEyeHeight); OVREditorGUIUtility.Separator(); m_Component.FollowOrientation = EditorGUILayout.ObjectField("Follow Orientation", m_Component.FollowOrientation, typeof(Transform), true) as Transform; m_Component.TrackerRotatesY = EditorGUILayout.Toggle("Tracker Rotates Y", m_Component.TrackerRotatesY); OVREditorGUIUtility.Separator(); // Remove Portrait Mode from Inspector window for now //m_Component.PortraitMode = EditorGUILayout.Toggle ("Portrait Mode", m_Component.PortraitMode); m_Component.EnableOrientation = EditorGUILayout.Toggle("Enable Orientation", m_Component.EnableOrientation); m_Component.PredictionOn = EditorGUILayout.Toggle("Prediction On", m_Component.PredictionOn); m_Component.CallInPreRender = EditorGUILayout.Toggle("Call in Pre-Render", m_Component.CallInPreRender); m_Component.WireMode = EditorGUILayout.Toggle("Wire-Frame Mode", m_Component.WireMode); OVREditorGUIUtility.Separator(); m_Component.UseCameraTexture = EditorGUILayout.Toggle("Use Camera Texture", m_Component.UseCameraTexture); m_Component.CameraTextureScale = EditorGUILayout.FloatField("Camera Texture Scale", m_Component.CameraTextureScale); m_Component.LensCorrection = EditorGUILayout.Toggle("Lens Correction", m_Component.LensCorrection); m_Component.Chromatic = EditorGUILayout.Toggle("Chromatic", m_Component.Chromatic); m_Component.FlipCorrectionInY = EditorGUILayout.Toggle("FlipY", m_Component.FlipCorrectionInY); m_Component.ShowDistortionWire = EditorGUILayout.Toggle("Show Wireframe", m_Component.ShowDistortionWire); OVREditorGUIUtility.Separator(); m_Component.BackgroundColor = EditorGUILayout.ColorField("Background Color", m_Component.BackgroundColor); m_Component.NearClipPlane = EditorGUILayout.FloatField("Near Clip Plane", m_Component.NearClipPlane); m_Component.FarClipPlane = EditorGUILayout.FloatField("Far Clip Plane", m_Component.FarClipPlane); OVREditorGUIUtility.Separator(); #else DrawDefaultInspector(); #endif } if (GUI.changed) { EditorUtility.SetDirty(m_Component); } }