private static void LoadSettings() { if (!EditorPrefs.HasKey("vertxCameraZoomToCursor")) { zoomToCursor = ZoomToCursor.SixAxis | ZoomToCursor.Trackball | ZoomToCursor.DefaultCamera; } else { zoomToCursor = (ZoomToCursor)EditorPrefs.GetInt("vertxCameraZoomToCursor"); } if (!EditorPrefs.HasKey("vertxAlignCameraAutomatically")) { alignCameraAutomatically = true; } else { alignCameraAutomatically = EditorPrefs.GetBool("vertxAlignCameraAutomatically"); } if (!EditorPrefs.HasKey("vertxZoomToCursorIgnoresBackfaces")) { zoomToCursorIgnoresBackfaces = true; } else { zoomToCursorIgnoresBackfaces = EditorPrefs.GetBool("vertxZoomToCursorIgnoresBackfaces"); } cameraStatus = (NCameraStatus)EditorPrefs.GetInt("vertxCameraStatus"); switch (cameraStatus) { case NCameraStatus.off: case NCameraStatus.none: material.mainTexture = textureDefault; break; case NCameraStatus.sixAxis: material.mainTexture = textureSixAxis; break; default: material.mainTexture = textureTrackball; break; } }
private static void Preferences() { using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.LabelField("All", EditorStyles.helpBox); #if UNITY_2017_3_OR_NEWER zoomToCursor = (ZoomToCursor)EditorGUILayout.EnumFlagsField("Zoom To Cursor", zoomToCursor); #else zoomToCursor = (ZoomToCursor)EditorGUILayout.EnumMaskPopup("Zoom To Cursor", zoomToCursor); #endif if (changeCheckScope.changed) { EditorPrefs.SetInt("vertxCameraZoomToCursor", (int)zoomToCursor); } } using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope()) { zoomToCursorIgnoresBackfaces = EditorGUILayout.Toggle("Zoom To Cursor Ignores Backfaces", zoomToCursorIgnoresBackfaces); if (changeCheckScope.changed) { EditorPrefs.SetBool("vertxZoomToCursorIgnoresBackfaces", zoomToCursorIgnoresBackfaces); } } using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.LabelField("Six Axis", EditorStyles.helpBox); alignCameraAutomatically = EditorGUILayout.Toggle("Align Camera Automatically", alignCameraAutomatically); if (changeCheckScope.changed) { EditorPrefs.SetBool("vertxAlignCameraAutomatically", alignCameraAutomatically); } } }