Exemple #1
0
        public override void OnInspectorGUI()
        {
            CustomEditorHelper.DrawPropertyWithTooltip(overrideWorldUpProperty, "Overriding the world up allows this camera's vertical axis to be freely oriented in space.");

            EditorGUILayout.HelpBox("NOTE: The green gizmo line indicates the world up for this camera. The blue gizmo line indicates the forward relative to world up.", MessageType.Info);

            if (overrideWorldUpProperty.boolValue)
            {
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Snapping Camera Rotation", EditorStyles.boldLabel);
                if (GUILayout.Button(CinematicCamera.ALIGN_ROTATION_FUNCTION_NAME))
                {
                    Script.AlignCameraRotationWithTrack();
                }

                if (GUILayout.Button(CinematicCamera.ALIGN_UP_FUNCTION_NAME))
                {
                    Script.AlignCameraUpWithTrack();
                }
            }

            serializedObject.ApplyModifiedProperties();
        }