Skip to content

Commit 2ca8ed1

Browse files
authored
Merge pull request #1 from Unity-Technologies/rename-settingscopes-2019-1
Update SettingsProvider API to 2019.1
2 parents 0ac7170 + 6db4ea5 commit 2ca8ed1

25 files changed

+149
-143
lines changed

com.unity.probuilder/Editor/EditorCore/AboutWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sealed class AboutWindow : EditorWindow
3333
const float k_BannerWidth = 480f;
3434
const float k_BannerHeight = 270f;
3535

36-
static Pref<SemVer> s_StoredVersionInfo = new Pref<SemVer>("about.identifier", new SemVer(), SettingsScopes.Project);
36+
static Pref<SemVer> s_StoredVersionInfo = new Pref<SemVer>("about.identifier", new SemVer(), SettingsScope.Project);
3737

3838
const string k_AboutPrefFormat = "M.m.p-T.b";
3939

com.unity.probuilder/Editor/EditorCore/ConfigurableWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ string utilityWindowKey
1313

1414
protected static bool IsUtilityWindow<T>() where T : ConfigurableWindow
1515
{
16-
return ProBuilderSettings.Get<bool>(typeof(T).ToString() + "-isUtilityWindow", SettingsScopes.Project, false);
16+
return ProBuilderSettings.Get<bool>(typeof(T).ToString() + "-isUtilityWindow", SettingsScope.Project, false);
1717
}
1818

1919
public static new T GetWindow<T>(string title, bool focus = true) where T : ConfigurableWindow
@@ -23,7 +23,7 @@ protected static bool IsUtilityWindow<T>() where T : ConfigurableWindow
2323

2424
public virtual void AddItemsToMenu(GenericMenu menu)
2525
{
26-
bool floating = ProBuilderSettings.Get<bool>(utilityWindowKey, SettingsScopes.Project, false);
26+
bool floating = ProBuilderSettings.Get<bool>(utilityWindowKey, SettingsScope.Project, false);
2727
menu.AddItem(new GUIContent("Window/Open as Floating Window", ""), floating, () => SetIsUtilityWindow(true) );
2828
menu.AddItem(new GUIContent("Window/Open as Dockable Window", ""), !floating, () => SetIsUtilityWindow(false) );
2929
}
@@ -42,7 +42,7 @@ protected void DoContextMenu()
4242

4343
void SetIsUtilityWindow(bool isUtilityWindow)
4444
{
45-
ProBuilderSettings.Set<bool>(utilityWindowKey, isUtilityWindow, SettingsScopes.Project);
45+
ProBuilderSettings.Set<bool>(utilityWindowKey, isUtilityWindow, SettingsScope.Project);
4646
var title = titleContent;
4747
Close();
4848
var res = GetWindow(GetType(), isUtilityWindow);

com.unity.probuilder/Editor/EditorCore/EditorMeshHandles.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ class EditorMeshHandles : IDisposable, IHasPreferences
2727
static readonly Color k_WireframeDefault = new Color(94.0f / 255.0f, 119.0f / 255.0f, 155.0f / 255.0f, 1f);
2828

2929
[UserSetting]
30-
static Pref<bool> s_UseUnityColors = new Pref<bool>("graphics.handlesUseUnityColors", true, SettingsScopes.User);
30+
static Pref<bool> s_UseUnityColors = new Pref<bool>("graphics.handlesUseUnityColors", true, SettingsScope.User);
3131
[UserSetting]
32-
static Pref<bool> s_DitherFaceHandle = new Pref<bool>("graphics.ditherFaceHandles", true, SettingsScopes.User);
32+
static Pref<bool> s_DitherFaceHandle = new Pref<bool>("graphics.ditherFaceHandles", true, SettingsScope.User);
3333
[UserSetting]
34-
static Pref<Color> s_SelectedFaceColorPref = new Pref<Color>("graphics.userSelectedFaceColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScopes.User);
34+
static Pref<Color> s_SelectedFaceColorPref = new Pref<Color>("graphics.userSelectedFaceColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScope.User);
3535
[UserSetting]
36-
static Pref<Color> s_WireframeColorPref = new Pref<Color>("graphics.userWireframeColor", new Color(125f / 255f, 155f / 255f, 185f / 255f, 1f), SettingsScopes.User);
36+
static Pref<Color> s_WireframeColorPref = new Pref<Color>("graphics.userWireframeColor", new Color(125f / 255f, 155f / 255f, 185f / 255f, 1f), SettingsScope.User);
3737
[UserSetting]
38-
static Pref<Color> s_UnselectedEdgeColorPref = new Pref<Color>("graphics.userUnselectedEdgeColor", new Color(44f / 255f, 44f / 255f, 44f / 255f, 1f), SettingsScopes.User);
38+
static Pref<Color> s_UnselectedEdgeColorPref = new Pref<Color>("graphics.userUnselectedEdgeColor", new Color(44f / 255f, 44f / 255f, 44f / 255f, 1f), SettingsScope.User);
3939
[UserSetting]
40-
static Pref<Color> s_SelectedEdgeColorPref = new Pref<Color>("graphics.userSelectedEdgeColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScopes.User);
40+
static Pref<Color> s_SelectedEdgeColorPref = new Pref<Color>("graphics.userSelectedEdgeColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScope.User);
4141
[UserSetting]
42-
static Pref<Color> s_UnselectedVertexColorPref = new Pref<Color>("graphics.userUnselectedVertexColor", new Color(44f / 255f, 44f / 255f, 44f / 255f, 1f), SettingsScopes.User);
42+
static Pref<Color> s_UnselectedVertexColorPref = new Pref<Color>("graphics.userUnselectedVertexColor", new Color(44f / 255f, 44f / 255f, 44f / 255f, 1f), SettingsScope.User);
4343
[UserSetting]
44-
static Pref<Color> s_SelectedVertexColorPref = new Pref<Color>("graphics.userSelectedVertexColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScopes.User);
44+
static Pref<Color> s_SelectedVertexColorPref = new Pref<Color>("graphics.userSelectedVertexColor", new Color(0f, 210f / 255f, 239f / 255f, 1f), SettingsScope.User);
4545
[UserSetting]
46-
static Pref<Color> s_PreselectionColorPref = new Pref<Color>("graphics.userPreselectionColor", new Color(179f / 255f, 246f / 255f, 255f / 255f, 1f), SettingsScopes.User);
46+
static Pref<Color> s_PreselectionColorPref = new Pref<Color>("graphics.userPreselectionColor", new Color(179f / 255f, 246f / 255f, 255f / 255f, 1f), SettingsScope.User);
4747

4848
[UserSetting]
49-
static Pref<float> s_WireframeLineSize = new Pref<float>("graphics.wireframeLineSize", .5f, SettingsScopes.User);
49+
static Pref<float> s_WireframeLineSize = new Pref<float>("graphics.wireframeLineSize", .5f, SettingsScope.User);
5050
[UserSetting]
51-
static Pref<float> s_EdgeLineSize = new Pref<float>("graphics.edgeLineSize", 1f, SettingsScopes.User);
51+
static Pref<float> s_EdgeLineSize = new Pref<float>("graphics.edgeLineSize", 1f, SettingsScope.User);
5252
[UserSetting]
53-
static Pref<float> s_VertexPointSize = new Pref<float>("graphics.vertexPointSize", 3f, SettingsScopes.User);
53+
static Pref<float> s_VertexPointSize = new Pref<float>("graphics.vertexPointSize", 3f, SettingsScope.User);
5454

5555
[UserSettingBlock("Graphics")]
5656
static void HandleColorPreferences(string searchContext)

com.unity.probuilder/Editor/EditorCore/EditorMeshUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class EditorMeshUtility
1717
static string k_MeshCacheDirectory = "Assets/ProBuilder Data/ProBuilderMeshCache";
1818

1919
[UserSetting("Mesh Editing", "Auto Resize Colliders", "Automatically resize colliders with mesh bounds as you edit.")]
20-
static Pref<bool> s_AutoResizeCollisions = new Pref<bool>("editor.autoRecalculateCollisions", false, SettingsScopes.Project);
20+
static Pref<bool> s_AutoResizeCollisions = new Pref<bool>("editor.autoRecalculateCollisions", false, SettingsScope.Project);
2121

2222
/// <value>
2323
/// This callback is raised after a ProBuilderMesh has been successfully optimized.

com.unity.probuilder/Editor/EditorCore/EditorToolbar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ sealed class EditorToolbar : ScriptableObject
1313
{
1414
EditorToolbar() { }
1515

16-
Pref<Vector2> m_Scroll = new Pref<Vector2>("editor.scrollPosition", Vector2.zero, SettingsScopes.User);
16+
Pref<Vector2> m_Scroll = new Pref<Vector2>("editor.scrollPosition", Vector2.zero, SettingsScope.User);
1717
public EditorWindow window;
1818

1919
bool isFloating { get { return ProBuilderEditor.instance != null && ProBuilderEditor.instance.isFloatingWindow; } }
2020
bool isIconMode = true;
2121

2222
[UserSetting("Toolbar", "Shift Key Tooltips", "Tooltips will only show when the Shift key is held")]
23-
internal static Pref<bool> s_ShiftOnlyTooltips = new Pref<bool>("editor.shiftOnlyTooltips", false, SettingsScopes.User);
23+
internal static Pref<bool> s_ShiftOnlyTooltips = new Pref<bool>("editor.shiftOnlyTooltips", false, SettingsScope.User);
2424

2525
SimpleTuple<string, double> tooltipTimer = new SimpleTuple<string, double>("", 0.0);
2626
// the element currently being hovered

com.unity.probuilder/Editor/EditorCore/EditorUtility.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ internal enum PivotLocation
5656
static Pref<ColliderType> s_ColliderType = new Pref<ColliderType>("mesh.newShapeColliderType", ColliderType.MeshCollider);
5757

5858
[UserSetting]
59-
static Pref<bool> s_ExperimentalFeatures = new Pref<bool>("experimental.featuresEnabled", false, SettingsScopes.User);
59+
static Pref<bool> s_ExperimentalFeatures = new Pref<bool>("experimental.featuresEnabled", false, SettingsScope.User);
6060

6161
[UserSetting]
62-
static Pref<bool> s_MeshesAreAssets = new Pref<bool>("experimental.meshesAreAssets", false, SettingsScopes.Project);
62+
static Pref<bool> s_MeshesAreAssets = new Pref<bool>("experimental.meshesAreAssets", false, SettingsScope.Project);
6363

6464
internal static bool meshesAreAssets
6565
{

com.unity.probuilder/Editor/EditorCore/Lightmapping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ static class Lightmapping
1818
static Pref<bool> s_AutoUnwrapLightmapUV = new Pref<bool>("lightmapping.autoUnwrapLightmapUV", true);
1919

2020
[UserSetting("General", "Show Missing Lightmap UVs Warning", "Enable or disable a warning log if lightmaps are baked while ProBuilder shapes are missing a valid UV2 channel.")]
21-
static Pref<bool> s_ShowMissingLightmapUVWarning = new Pref<bool>("lightmapping.showMissingLightmapWarning", true, SettingsScopes.User);
21+
static Pref<bool> s_ShowMissingLightmapUVWarning = new Pref<bool>("lightmapping.showMissingLightmapWarning", true, SettingsScope.User);
2222

2323
[UserSetting]
2424
internal static Pref<UnwrapParameters> s_UnwrapParameters = new Pref<UnwrapParameters>("lightmapping.defaultLightmapUnwrapParameters", new UnwrapParameters());
2525

26-
static Pref<UL.GIWorkflowMode> s_GiWorkflowMode = new Pref<UL.GIWorkflowMode>("lightmapping.giWorkflowMode", UL.GIWorkflowMode.Iterative, SettingsScopes.User);
26+
static Pref<UL.GIWorkflowMode> s_GiWorkflowMode = new Pref<UL.GIWorkflowMode>("lightmapping.giWorkflowMode", UL.GIWorkflowMode.Iterative, SettingsScope.User);
2727

2828
static class Styles
2929
{

com.unity.probuilder/Editor/EditorCore/Pref.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ namespace UnityEditor.ProBuilder
44
{
55
public class Pref<T> : UserSetting<T>
66
{
7-
public Pref(string key, T value, SettingsScopes scope = SettingsScopes.Project)
7+
public Pref(string key, T value, SettingsScope scope = SettingsScope.Project)
88
: base(ProBuilderSettings.instance, key, value, scope)
99
{}
1010

11-
public Pref(Settings settings, string key, T value, SettingsScopes scope = SettingsScopes.Project)
11+
public Pref(Settings settings, string key, T value, SettingsScope scope = SettingsScope.Project)
1212
: base(settings, key, value, scope) { }
1313
}
1414
}

0 commit comments

Comments
 (0)