public override void LoadPreferences() { if (GetEditorPrefs <string>("Version", "PreDT") == "PreDT") { DeletePreDTSettings(); SavePreferences(); } base.LoadPreferences(); CurvyGlobalManager.DefaultInterpolation = GetEditorPrefs <CurvyInterpolation>("DefaultInterpolation", CurvyGlobalManager.DefaultInterpolation); CurvyGlobalManager.DefaultGizmoColor = GetEditorPrefs <Color>("GizmoColor", CurvyGlobalManager.DefaultGizmoColor); CurvyGlobalManager.DefaultGizmoSelectionColor = GetEditorPrefs <Color>("GizmoSelectionColor", CurvyGlobalManager.DefaultGizmoSelectionColor); CurvyGlobalManager.GizmoControlPointSize = GetEditorPrefs <float>("GizmoControlPointSize", CurvyGlobalManager.GizmoControlPointSize); CurvyGlobalManager.GizmoOrientationLength = GetEditorPrefs <float>("GizmoOrientationLength", CurvyGlobalManager.GizmoOrientationLength); CurvyGlobalManager.GizmoOrientationColor = GetEditorPrefs <Color>("GizmoOrientationColor", CurvyGlobalManager.GizmoOrientationColor); CurvyGlobalManager.Gizmos = GetEditorPrefs <CurvySplineGizmos>("Gizmos", CurvyGlobalManager.Gizmos); SnapValuePrecision = GetEditorPrefs <bool>("SnapValuePrecision", true); CurvyGlobalManager.MaxCachePPU = Mathf.Max(1, GetEditorPrefs <int>("MaxCachePPU", CurvyGlobalManager.MaxCachePPU)); CurvyGlobalManager.SceneViewResolution = Mathf.Clamp01(GetEditorPrefs <float>("SceneViewResolution", CurvyGlobalManager.SceneViewResolution)); CurvyGlobalManager.HideManager = GetEditorPrefs <bool>("HideManager", CurvyGlobalManager.HideManager); UseTiny2DHandles = GetEditorPrefs <bool>("UseTiny2DHandles", UseTiny2DHandles); ShowGlobalToolbar = GetEditorPrefs <bool>("ShowGlobalToolbar", ShowGlobalToolbar); CurvyGlobalManager.SplineLayer = GetEditorPrefs <int>("SplineLayer", CurvyGlobalManager.SplineLayer); CurvyGlobalManager.SaveRuntimeSettings(); mCGAutoModuleDetails = GetEditorPrefs <bool>("CGAutoModuleDetails", mCGAutoModuleDetails); mCGSynchronizeSelection = GetEditorPrefs <bool>("CGSynchronizeSelection", mCGSynchronizeSelection); mCGShowHelp = GetEditorPrefs <bool>("CGShowHelp", mCGShowHelp); mCGGraphSnapping = GetEditorPrefs <int>("CGGraphSnapping", mCGGraphSnapping); mBezierMode = GetEditorPrefs <CurvyBezierModeEnum>("BezierMode", mBezierMode); mAdvBezierMode = GetEditorPrefs <CurvyAdvBezierModeEnum>("AdvBezierMode", mAdvBezierMode); mCustomizationRootPath = GetEditorPrefs <string>("CustomizationRootPath", mCustomizationRootPath); mShowAboutOnLoad = GetEditorPrefs <bool>("ShowAboutOnLoad", mShowAboutOnLoad); DT._UseSnapValuePrecision = SnapValuePrecision; }
public override void ResetPreferences() { base.ResetPreferences(); CurvyGlobalManager.DefaultInterpolation = CurvyInterpolation.CatmullRom; CurvyGlobalManager.DefaultGizmoColor = new Color(0.71f, 0.71f, 0.71f); CurvyGlobalManager.DefaultGizmoSelectionColor = new Color(0.15f, 0.35f, 0.68f); CurvyGlobalManager.GizmoControlPointSize = 0.15f; CurvyGlobalManager.GizmoOrientationLength = 1f; CurvyGlobalManager.GizmoOrientationColor = new Color(0.75f, 0.75f, 0.4f); CurvyGlobalManager.MaxCachePPU = 8; CurvyGlobalManager.SceneViewResolution = 0.5f; CurvyGlobalManager.SplineLayer = 0; CustomizationRootPath = "Packages/Curvy Customization"; SnapValuePrecision = true; UseTiny2DHandles = true; ShowGlobalToolbar = true; CurvyGlobalManager.SaveRuntimeSettings(); }
public override void SavePreferences() { base.SavePreferences(); SetEditorPrefs <CurvyInterpolation>("DefaultInterpolation", CurvyGlobalManager.DefaultInterpolation); SetEditorPrefs <Color>("GizmoColor", CurvyGlobalManager.DefaultGizmoColor); SetEditorPrefs <Color>("GizmoSelectionColor", CurvyGlobalManager.DefaultGizmoSelectionColor); SetEditorPrefs <float>("GizmoControlPointSize", CurvyGlobalManager.GizmoControlPointSize); SetEditorPrefs <float>("GizmoOrientationLength", CurvyGlobalManager.GizmoOrientationLength); SetEditorPrefs <Color>("GizmoOrientationColor", CurvyGlobalManager.GizmoOrientationColor); SetEditorPrefs <CurvySplineGizmos>("Gizmos", CurvyGlobalManager.Gizmos); SetEditorPrefs <bool>("SnapValuePrecision", SnapValuePrecision); SetEditorPrefs <int>("MaxCachePPU", CurvyGlobalManager.MaxCachePPU); SetEditorPrefs <float>("SceneViewResolution", CurvyGlobalManager.SceneViewResolution); SetEditorPrefs <bool>("UseTiny2DHandles", UseTiny2DHandles); SetEditorPrefs <bool>("ShowGlobalToolbar", ShowGlobalToolbar); SetEditorPrefs <int>("SplineLayer", CurvyGlobalManager.SplineLayer); CurvyGlobalManager.SaveRuntimeSettings(); DT._UseSnapValuePrecision = SnapValuePrecision; SetEditorPrefs <string>("CustomizationRootPath", mCustomizationRootPath); }