private void OnEditorUpdate() { InspectableState viewOptionsState = guiViewSettings.Refresh(); if (viewOptionsState != InspectableState.NotModified) { SceneWindow sceneWindow = SceneWindow.GetWindow <SceneWindow>(); if (sceneWindow != null) { sceneWindow.Camera.ViewSettings = viewSettings; } ProjectSettings.SetObject(SceneCamera.ViewSettingsKey, viewSettings); } InspectableState moveOptionsState = guiMovementSettings.Refresh(); if (moveOptionsState != InspectableState.NotModified) { SceneWindow sceneWindow = SceneWindow.GetWindow <SceneWindow>(); if (sceneWindow != null) { sceneWindow.Camera.MoveSettings = moveSettings; } ProjectSettings.SetObject(SceneCamera.MoveSettingsKey, moveSettings); } InspectableState renderOptionsState = guiRenderSettings.Refresh(); if (renderOptionsState != InspectableState.NotModified) { SceneWindow sceneWindow = SceneWindow.GetWindow <SceneWindow>(); if (sceneWindow != null) { sceneWindow.Camera.RenderSettings = renderSettings; } ProjectSettings.SetObject(SceneCamera.RenderSettingsKey, renderSettings); } InspectableState gizmoOptionsState = guiGizmoSettings.Refresh(); if (gizmoOptionsState != InspectableState.NotModified) { gizmoSettings = (GizmoDrawSettings)objGizmoSettings; SceneWindow sceneWindow = SceneWindow.GetWindow <SceneWindow>(); if (sceneWindow != null) { sceneWindow.GizmoDrawSettings = gizmoSettings; } ProjectSettings.SetObject(SceneWindow.GizmoDrawSettingsKey, gizmoSettings); } }
private void OnDestroy() { if (camera != null) { Vector3 pos = camera.SceneObject.Position; Quaternion rot = camera.SceneObject.Rotation; ProjectSettings.SetObject(CameraPositionKey, pos); ProjectSettings.SetObject(CameraRotationKey, rot); camera.SceneObject.Destroy(true); camera = null; } sceneAxesGUI.Destroy(); sceneAxesGUI = null; }
/// <summary> /// Resets all scene camera settings to default values. /// </summary> private void ResetToDefault() { viewSettings = new SceneCameraViewSettings(); moveSettings = new SceneCameraMoveSettings(); renderSettings = new RenderSettings(); SceneWindow sceneWindow = SceneWindow.GetWindow <SceneWindow>(); if (sceneWindow != null) { sceneWindow.Camera.ViewSettings = viewSettings; sceneWindow.Camera.MoveSettings = moveSettings; sceneWindow.Camera.RenderSettings = renderSettings; } ProjectSettings.SetObject(SceneCamera.ViewSettingsKey, viewSettings); ProjectSettings.SetObject(SceneCamera.MoveSettingsKey, moveSettings); ProjectSettings.SetObject(SceneCamera.RenderSettingsKey, renderSettings); }
private void SaveSettings() { ProjectSettings.SetObject(ExpandStatesKey, expandStates); }