public static void Reload() { LockAxisX = EditorPrefs.GetBool("LockAxisX", false); LockAxisY = EditorPrefs.GetBool("LockAxisY", false); LockAxisZ = EditorPrefs.GetBool("LockAxisZ", false); UniformGrid = EditorPrefs.GetBool("UniformGrid", true); EditMode = GetEnum("EditMode", ToolEditMode.Generate); SnapVector = GetVector3("MoveSnap", Vector3.one); DefaultMoveOffset = GetVector3("DefaultMoveOffset", Vector3.zero); DefaultRotateOffset = GetVector3("DefaultRotateOffset", Vector3.zero); ShapeBuildMode = GetEnum("ShapeBuildMode", ShapeMode.Box); DefaultTexGenFlags = GetEnum("DefaultTexGenFlags", defaultTextGenFlagsState); GridVisible = EditorPrefs.GetBool("ShowGrid", true); SnapMode = (SnapMode)EditorPrefs.GetInt("SnapMode", (int)(EditorPrefs.GetBool("ForceSnapToGrid", true) ? SnapMode.GridSnapping : SnapMode.None)); VisibleHelperSurfaces = GetEnum("HelperSurfaces", DefaultHelperSurfaceFlags); ClipMode = GetEnum("ClipMode", ClipMode.RemovePositive); EnableRealtimeCSG = EditorPrefs.GetBool("EnableRealtimeCSG", true); DefaultMaterial = GetMaterial("DefaultMaterial", MaterialUtility.WallMaterial); SnapScale = EditorPrefs.GetFloat("ScaleSnap", 0.1f); SnapRotation = EditorPrefs.GetFloat("RotationSnap", 15.0f); DefaultShapeHeight = EditorPrefs.GetFloat("DefaultShapeHeight", 1.0f); CurveSides = (uint)EditorPrefs.GetInt("CurveSides", 10); SelectionVertex = EditorPrefs.GetBool("SelectionVertex", true); SelectionEdge = EditorPrefs.GetBool("SelectionEdge", true); SelectionSurface = EditorPrefs.GetBool("SelectionSurface", true); HiddenSurfacesNotSelectable = EditorPrefs.GetBool("HiddenSurfacesNotSelectable", true); // HiddenSurfacesOrthoSelectable = EditorPrefs.GetBool("HiddenSurfacesOrthoSelectable", true); ShowTooltips = EditorPrefs.GetBool("ShowTooltips", true); AutoRigidbody = EditorPrefs.GetBool("AutoRigidbody", (CSGModel.DefaultSettings & ModelSettingsFlags.AutoUpdateRigidBody) == ModelSettingsFlags.AutoUpdateRigidBody); DefaultPreserveUVs = EditorPrefs.GetBool("DefaultPreserveUVs", (CSGModel.DefaultSettings & ModelSettingsFlags.PreserveUVs) == ModelSettingsFlags.PreserveUVs); SnapNonCSGObjects = EditorPrefs.GetBool("SnapNonCSGObjects", true); AutoCommitExtrusion = EditorPrefs.GetBool("AutoCommitExtrusion", false); MaxSphereSplits = Mathf.Max(3, EditorPrefs.GetInt("MaxSphereSplits", 9)); CircleSides = Mathf.Max(3, EditorPrefs.GetInt("CircleSides", 18)); MaxCircleSides = Mathf.Max(3, EditorPrefs.GetInt("MaxCircleSides", 144)); CircleOffset = EditorPrefs.GetFloat("CircleOffset", 0); CircleSmoothShading = EditorPrefs.GetBool("CircleSmoothShading", true); CircleSingleSurfaceEnds = EditorPrefs.GetBool("CircleSingleSurfaceEnds", true); CircleDistanceToSide = EditorPrefs.GetBool("CircleDistanceToSide", true); CircleRecenter = EditorPrefs.GetBool("CircleRecenter", true); SphereSplits = Mathf.Max(1, EditorPrefs.GetInt("SphereSplits", 1)); SphereOffset = EditorPrefs.GetFloat("SphereOffset", 0); SphereSmoothShading = EditorPrefs.GetBool("SphereSmoothShading", true); SphereDistanceToSide = EditorPrefs.GetBool("SphereDistanceToSide", true); HemiSphereMode = EditorPrefs.GetBool("HemiSphereMode", false); LinearStairsStepLength = EditorPrefs.GetFloat("LinearStairsStepLength", 0.30f); LinearStairsStepHeight = EditorPrefs.GetFloat("LinearStairsStepHeight", 0.20f); LinearStairsStepWidth = EditorPrefs.GetFloat("LinearStairsStepWidth", 1.0f); LinearStairsTotalSteps = EditorPrefs.GetInt("LinearStairsTotalSteps", 4); LinearStairsLength = EditorPrefs.GetFloat("LinearStairsLength", 16.0f); LinearStairsHeight = EditorPrefs.GetFloat("LinearStairsHeight", 16.0f); LinearStairsLengthOffset = EditorPrefs.GetFloat("LinearStairsLengthOffset", 0.0f); LinearStairsHeightOffset = EditorPrefs.GetFloat("LinearStairsHeightOffset", 0.0f); DistanceUnit = GetEnum("DistanceUnit", DistanceUnit.Meters); ShowSceneInfo = EditorPrefs.GetBool("ShowSceneInfo", false); var sceneViews = SortedSceneViews(); EnsureValidSceneviewNames(sceneViews); var arrayString = EditorPrefs.GetString("Wireframe", string.Empty); if (arrayString.Contains(',')) { LegacyLoadWireframeSettings(sceneViews, arrayString); } else { LoadWireframeSettings(sceneViews, arrayString); } UpdateSnapSettings(); }
public static void Reload() { RealtimeCSG.CSGSettings.LockAxisX = EditorPrefs.GetBool("LockAxisX", false); RealtimeCSG.CSGSettings.LockAxisY = EditorPrefs.GetBool("LockAxisY", false); RealtimeCSG.CSGSettings.LockAxisZ = EditorPrefs.GetBool("LockAxisZ", false); RealtimeCSG.CSGSettings.UniformGrid = EditorPrefs.GetBool("UniformGrid", true); RealtimeCSG.CSGSettings.EditMode = (ToolEditMode)EditorPrefs.GetInt("EditMode", (int)ToolEditMode.Generate); var moveSnapVector = new Vector3(EditorPrefs.GetFloat("MoveSnapX", 1.0f), EditorPrefs.GetFloat("MoveSnapY", 1.0f), EditorPrefs.GetFloat("MoveSnapZ", 1.0f)); RealtimeCSG.CSGSettings.SnapVector = moveSnapVector; var moveOffsetVector = new Vector3(EditorPrefs.GetFloat("DefaultMoveOffsetX", 0.0f), EditorPrefs.GetFloat("DefaultMoveOffsetY", 0.0f), EditorPrefs.GetFloat("DefaultMoveOffsetZ", 0.0f)); RealtimeCSG.CSGSettings.DefaultMoveOffset = moveOffsetVector; var rotateOffsetVector = new Vector3(EditorPrefs.GetFloat("DefaultRotateOffsetX", 0.0f), EditorPrefs.GetFloat("DefaultRotateOffsetY", 0.0f), EditorPrefs.GetFloat("DefaultRotateOffsetZ", 0.0f)); RealtimeCSG.CSGSettings.DefaultRotateOffset = rotateOffsetVector; RealtimeCSG.CSGSettings.ShapeBuildMode = (ShapeMode)EditorPrefs.GetInt("ShapeBuildMode", (int)ShapeMode.Box); RealtimeCSG.CSGSettings.GridVisible = EditorPrefs.GetBool("ShowGrid", true); RealtimeCSG.CSGSettings.SnapToGrid = EditorPrefs.GetBool("ForceSnapToGrid", true); var helperSurfaces = (HelperSurfaceFlags)EditorPrefs.GetInt("HelperSurfaces", (int)DefaultHelperSurfaceFlags); RealtimeCSG.CSGSettings.VisibleHelperSurfaces = helperSurfaces; RealtimeCSG.CSGSettings.ClipMode = (ClipMode)EditorPrefs.GetInt("ClipMode", 0); RealtimeCSG.CSGSettings.EnableRealtimeCSG = EditorPrefs.GetBool("EnableRealtimeCSG", true); var defaultMaterialGUID = EditorPrefs.GetString("DefaultMaterial", null); if (defaultMaterialGUID != null) { var defaultMaterialAssetPath = AssetDatabase.GUIDToAssetPath(defaultMaterialGUID); var materialFromID = AssetDatabase.LoadAssetAtPath <Material>(defaultMaterialAssetPath); if (materialFromID) { DefaultMaterial = materialFromID; } else { DefaultMaterial = MaterialUtility.WallMaterial; } } else { DefaultMaterial = MaterialUtility.WallMaterial; } RealtimeCSG.CSGSettings.SnapScale = EditorPrefs.GetFloat("ScaleSnap", 0.1f); RealtimeCSG.CSGSettings.SnapRotation = EditorPrefs.GetFloat("RotationSnap", 15.0f); RealtimeCSG.CSGSettings.DefaultShapeHeight = EditorPrefs.GetFloat("DefaultShapeHeight", 1.0f); RealtimeCSG.CSGSettings.CurveSides = (uint)EditorPrefs.GetInt("CurveSides", 10); CircleSides = Mathf.Max(3, EditorPrefs.GetInt("CircleSides", 18)); CircleOffset = EditorPrefs.GetFloat("CircleOffset", 0); CircleSmoothShading = EditorPrefs.GetBool("CircleSmoothShading", true); CircleSingleSurfaceEnds = EditorPrefs.GetBool("CircleSingleSurfaceEnds", true); CircleDistanceToSide = EditorPrefs.GetBool("CircleDistanceToSide", true); CircleRecenter = EditorPrefs.GetBool("CircleRecenter", true); SphereSplits = Mathf.Max(1, EditorPrefs.GetInt("SphereSplits", 1)); SphereOffset = EditorPrefs.GetFloat("SphereOffset", 0); SphereSmoothShading = EditorPrefs.GetBool("SphereSmoothShading", true); SphereDistanceToSide = EditorPrefs.GetBool("SphereDistanceToSide", true); HemiSphereMode = EditorPrefs.GetBool("HemiSphereMode", false); LinearStairsStepLength = EditorPrefs.GetFloat("LinearStairsStepLength", 0.30f); LinearStairsStepHeight = EditorPrefs.GetFloat("LinearStairsStepHeight", 0.20f); LinearStairsStepWidth = EditorPrefs.GetFloat("LinearStairsStepWidth", 1.0f); LinearStairsTotalSteps = EditorPrefs.GetInt("LinearStairsTotalSteps", 4); LinearStairsLength = EditorPrefs.GetFloat("LinearStairsLength", 16.0f); LinearStairsHeight = EditorPrefs.GetFloat("LinearStairsHeight", 16.0f); LinearStairsLengthOffset = EditorPrefs.GetFloat("LinearStairsLengthOffset", 0.0f); LinearStairsHeightOffset = EditorPrefs.GetFloat("LinearStairsHeightOffset", 0.0f); var distanceUnit = (DistanceUnit)EditorPrefs.GetInt("DistanceUnit", (int)DistanceUnit.Meters); RealtimeCSG.CSGSettings.DistanceUnit = distanceUnit; var sceneViews = SortedSceneViews(); EnsureValidSceneviewNames(sceneViews); var arrayString = EditorPrefs.GetString("Wireframe", string.Empty); if (arrayString.Contains(',')) { LegacyLoadWireframeSettings(sceneViews, arrayString); } else { LoadWireframeSettings(sceneViews, arrayString); } UpdateSnapSettings(); }