浏览代码

Added Game Options / Updated to 2019.3.0f / HDRP 7.1.8

/main
Thomas ICHÉ 5 年前
当前提交
d0f1af76
共有 78 个文件被更改,包括 2674 次插入494 次删除
  1. 934
      Assets/VisualEffectSamples.unity
  2. 4
      Packages/manifest.json
  3. 17
      Packages/net.peeweek.game-options/Editor/MenuItems.cs
  4. 291
      Packages/net.peeweek.game-options/Prefabs/Game Options Panel.prefab
  5. 36
      Packages/net.peeweek.game-options/Prefabs/GameOptionEntryBool Variant.prefab
  6. 51
      Packages/net.peeweek.game-options/Prefabs/GameOptionEntryDropDown Variant.prefab
  7. 32
      Packages/net.peeweek.game-options/Prefabs/GameOptionEntrySlider Variant.prefab
  8. 94
      Packages/net.peeweek.game-options/Prefabs/GameOptionHeader.prefab
  9. 4
      Packages/net.peeweek.game-options/Prefabs/Graphics/Target Framerate DropDown Variant.prefab
  10. 26
      Packages/net.peeweek.game-options/Prefabs/Graphics/VSync Toggle Variant.prefab
  11. 15
      Packages/net.peeweek.game-options/Runtime/GameOptions.asmdef
  12. 51
      Packages/net.peeweek.game-options/Runtime/GameOptions.cs
  13. 2
      ProjectSettings/HDRPProjectSettings.asset
  14. 4
      ProjectSettings/ProjectVersion.txt
  15. 15
      Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs
  16. 5
      Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs
  17. 6
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs
  18. 6
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs
  19. 4
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs
  20. 4
      Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs
  21. 144
      Packages/net.peeweek.game-options/Prefabs/Graphics/Quality DropDown Variant.prefab
  22. 7
      Packages/net.peeweek.game-options/Prefabs/Graphics/Quality DropDown Variant.prefab.meta
  23. 8
      Packages/net.peeweek.game-options/Prefabs/HDRP.meta
  24. 4
      Packages/net.peeweek.game-options/Runtime/AssemblyInfo.cs
  25. 11
      Packages/net.peeweek.game-options/Runtime/AssemblyInfo.cs.meta
  26. 8
      Packages/net.peeweek.game-options/Runtime/Core.meta
  27. 54
      Packages/net.peeweek.game-options/Runtime/GameOption.cs
  28. 11
      Packages/net.peeweek.game-options/Runtime/GameOption.cs.meta
  29. 8
      Packages/net.peeweek.game-options/Runtime/HDRP.meta
  30. 8
      Packages/net.peeweek.game-options/Runtime/Utility.meta
  31. 503
      Packages/net.peeweek.game-options/Prefabs/HDRP/Game Options Panel HDRP Variant.prefab
  32. 7
      Packages/net.peeweek.game-options/Prefabs/HDRP/Game Options Panel HDRP Variant.prefab.meta
  33. 145
      Packages/net.peeweek.game-options/Prefabs/HDRP/HDRP AntiAliasing Dropdown Variant.prefab
  34. 7
      Packages/net.peeweek.game-options/Prefabs/HDRP/HDRP AntiAliasing Dropdown Variant.prefab.meta
  35. 85
      Packages/net.peeweek.game-options/Runtime/Core/GraphicOption.cs
  36. 48
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownFullScreenMode.cs
  37. 42
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownQuality.cs
  38. 11
      Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownQuality.cs.meta
  39. 28
      Packages/net.peeweek.game-options/Runtime/Core/UI/HighlightEntry.cs
  40. 11
      Packages/net.peeweek.game-options/Runtime/Core/UI/HighlightEntry.cs.meta
  41. 38
      Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTargetFramerate.cs
  42. 48
      Packages/net.peeweek.game-options/Runtime/Core/UI/ToggleVSync.cs
  43. 57
      Packages/net.peeweek.game-options/Runtime/HDRP/HDRPCameraOption.cs
  44. 11
      Packages/net.peeweek.game-options/Runtime/HDRP/HDRPCameraOption.cs.meta
  45. 21
      Packages/net.peeweek.game-options/Runtime/HDRP/HDRPGameOptionsManagedCamera.cs
  46. 11
      Packages/net.peeweek.game-options/Runtime/HDRP/HDRPGameOptionsManagedCamera.cs.meta
  47. 8
      Packages/net.peeweek.game-options/Runtime/HDRP/UI.meta
  48. 48
      Packages/net.peeweek.game-options/Runtime/HDRP/UI/HDRPAntiAliasingDropdown.cs
  49. 11
      Packages/net.peeweek.game-options/Runtime/HDRP/UI/HDRPAntiAliasingDropdown.cs.meta
  50. 63
      Packages/net.peeweek.game-options/Runtime/Utility/DropDownAutoScrollOnChange.cs
  51. 11
      Packages/net.peeweek.game-options/Runtime/Utility/DropDownAutoScrollOnChange.cs.meta
  52. 90
      Packages/net.peeweek.game-options/Runtime/GraphicOptions.cs
  53. 0
      /Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs
  54. 0
      /Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs.meta
  55. 0
      /Packages/net.peeweek.game-options/Runtime/Core/GraphicOption.cs.meta
  56. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI.meta
  57. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs
  58. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs.meta
  59. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownFullScreenMode.cs.meta
  60. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs
  61. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs.meta
  62. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs
  63. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs.meta
  64. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs
  65. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs.meta
  66. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs
  67. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs.meta
  68. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTargetFramerate.cs.meta
  69. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTextBind.cs
  70. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTextBind.cs.meta
  71. 0
      /Packages/net.peeweek.game-options/Runtime/Core/UI/ToggleVSync.cs.meta

934
Assets/VisualEffectSamples.unity
文件差异内容过多而无法显示
查看文件

4
Packages/manifest.json


{
"dependencies": {
"com.unity.cinemachine": "2.3.5-preview.3",
"com.unity.render-pipelines.high-definition": "7.1.7",
"com.unity.render-pipelines.high-definition": "7.1.8",
"com.unity.timeline": "1.2.9",
"com.unity.timeline": "1.2.10",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

17
Packages/net.peeweek.game-options/Editor/MenuItems.cs


using UnityEngine;
using UnityEditor;
namespace GameOptionsUtility.Editor
namespace GameOptionsUtility
static class MenuItems
internal static class MenuItems
static void CreateDefaultGraphicsOptions()
internal static void CreateDefaultGraphicsOptions()
var asset = ScriptableObject.CreateInstance<GraphicOptions>();
AssetDatabase.CreateAsset(asset, $"Assets/Resources/{nameof(GraphicOptions)}.asset");
var asset = ScriptableObject.CreateInstance<GraphicOption>();
AssetDatabase.CreateAsset(asset, $"Assets/Resources/{nameof(GraphicOption)}.asset");
EditorGUIUtility.PingObject(asset);
Selection.activeObject = asset;
}

static void CreateDefaultAudioOptions()
internal static void CreateDefaultAudioOptions()
var asset = ScriptableObject.CreateInstance<AudioOptions>();
AssetDatabase.CreateAsset(asset, $"Assets/Resources/{nameof(AudioOptions)}.asset");
var asset = ScriptableObject.CreateInstance<AudioOption>();
AssetDatabase.CreateAsset(asset, $"Assets/Resources/{nameof(AudioOption)}.asset");
EditorGUIUtility.PingObject(asset);
Selection.activeObject = asset;
}

291
Packages/net.peeweek.game-options/Prefabs/Game Options Panel.prefab


m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_Pivot: {x: 0, y: 1}
--- !u!222 &8012737719733764359
CanvasRenderer:

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8012737719733764355}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:

m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_SizeDelta: {x: 0, y: 20}
m_SizeDelta: {x: -17, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!222 &8012737720102594858
CanvasRenderer:

m_HandleRect: {fileID: 8012737718898694172}
m_Direction: 0
m_Value: 0
m_Size: 0.9999999
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8012737720292935940}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3351337907275235354}

- {fileID: 286180680593746961}
- {fileID: 5995141257631462231}
- {fileID: 3159204167368531650}
- {fileID: 6206056638489798896}
- {fileID: 4125400877306455389}
- {fileID: 3117207792212204642}

m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_SizeDelta: {x: 20, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_Pivot: {x: 1, y: 1}
--- !u!222 &8012737720684796365
CanvasRenderer:

m_TargetGraphic: {fileID: 8012737720359943308}
m_HandleRect: {fileID: 8012737720359943307}
m_Direction: 2
m_Value: 0.99999976
m_Size: 0.608945
m_Value: 1
m_Size: 0.46284264
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:

m_Script: {fileID: 11500000, guid: 07c447adeba83444780bfd5b469e0a24, type: 3}
m_Name:
m_EditorClassIdentifier:
ApplyGraphics: 1
--- !u!1 &8640587383989323684
GameObject:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 8012737720292935941}
m_Modifications:
- target: {fileID: 3042976469730598717, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_Color.r
value: 0.16981131
objectReference: {fileID: 0}
- target: {fileID: 3042976469730598717, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_Color.g
value: 0.16981131
objectReference: {fileID: 0}
- target: {fileID: 3042976469730598717, guid: 4fa76d53f493254408b8f1430dbb99c2,
- target: {fileID: 3870650777951720138, guid: 4fa76d53f493254408b8f1430dbb99c2,
propertyPath: m_Color.b
value: 0.16981131
propertyPath: m_FontData.m_FontStyle
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3870650777951720138, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_FontData.m_FontStyle
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3888344077973096587, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}

propertyPath: m_Name
value: Target Framerate DropDown
objectReference: {fileID: 0}
- target: {fileID: 8303849751464023101, guid: 1aece9899e7ced74ba3009297e04de95,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9212603613775478290, guid: 1aece9899e7ced74ba3009297e04de95,
type: 3}
propertyPath: m_LocalPosition.x

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1aece9899e7ced74ba3009297e04de95, type: 3}
--- !u!114 &8012737719331743161 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4888742712080869628, guid: 1aece9899e7ced74ba3009297e04de95,
type: 3}
m_PrefabInstance: {fileID: 3236604997478665541}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d0b652f32a2cc243917e4028fa0f046, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &5995141257631462231 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 9212603613775478290, guid: 1aece9899e7ced74ba3009297e04de95,

m_Script: {fileID: 11500000, guid: 0a65a169803a22441b23828cdf7977d0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8012737720042801150 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6108783246797681021, guid: 6d3477c4d1f6bb640a0a7bc823e6e0b5,
type: 3}
m_PrefabInstance: {fileID: 4320138963349010051}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d0b652f32a2cc243917e4028fa0f046, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &5995141256731906320 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7550058594179655571, guid: 6d3477c4d1f6bb640a0a7bc823e6e0b5,

propertyPath: m_Name
value: VSync Toggle
objectReference: {fileID: 0}
- target: {fileID: 5505863204775551019, guid: 8d2637a16f26d3a4cb26406c0db41e12,
- target: {fileID: 8798758740440217967, guid: 8d2637a16f26d3a4cb26406c0db41e12,
propertyPath: m_Text
value: Enable VSync
objectReference: {fileID: 0}
propertyPath: targetFrameRateDropdown
value:
objectReference: {fileID: 8012737719331743161}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8d2637a16f26d3a4cb26406c0db41e12, type: 3}
--- !u!224 &286180680593746961 stripped

m_PrefabInstance: {fileID: 4842926264015469652}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5261621171893170857
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8012737720292935941}
m_Modifications:
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -581
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_SizeDelta.y
value: 96
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7941599386454787652, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
propertyPath: m_Name
value: Quality DropDown
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 58add5d94450e2545ab78e767ddb2618, type: 3}
--- !u!224 &3159204167368531650 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7120956166371454059, guid: 58add5d94450e2545ab78e767ddb2618,
type: 3}
m_PrefabInstance: {fileID: 5261621171893170857}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6135742066520688865
PrefabInstance:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Full Screen Mode DropDown
objectReference: {fileID: 0}
- target: {fileID: 4612770259769001191, guid: bd473b90d7876e84381270669c2f7087,
type: 3}
propertyPath: refreshRateDropdown
value:
objectReference: {fileID: 8012737720042801150}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bd473b90d7876e84381270669c2f7087, type: 3}
--- !u!224 &7706566065114967197 stripped

objectReference: {fileID: 0}
- target: {fileID: 3870650777951720138, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_Text
value: Audio Options
propertyPath: m_FontData.m_FontStyle
value: 1
propertyPath: m_FontData.m_FontStyle
value: 1
propertyPath: m_Text
value: Audio Options
objectReference: {fileID: 0}
- target: {fileID: 3888344077973096587, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}

- target: {fileID: 4112526572911534756, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_RootOrder
value: 6
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4112526572911534756, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}

- target: {fileID: 4112526572911534756, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -576
value: -679
objectReference: {fileID: 0}
- target: {fileID: 4112526572911534756, guid: 4fa76d53f493254408b8f1430dbb99c2,
type: 3}

objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMin.x
propertyPath: m_AnchorMin.x
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685692275176, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}

value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685692275176, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_RootOrder
value: 10
value: 11
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -960
value: -1063
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}

value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685692275176, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685692275176, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 10
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -864
value: -967
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMin.x
propertyPath: m_AnchorMin.x
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -768
value: -871
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

m_Modifications:
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}

value: 0
objectReference: {fileID: 0}
- target: {fileID: 1297834685491472899, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMax.y
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.x
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_RootOrder
value: 7
value: 8
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -672
value: -775
objectReference: {fileID: 0}
- target: {fileID: 4931579547533417242, guid: a54a9e2b987779e4d9ee72eaac4b4fec,
type: 3}

36
Packages/net.peeweek.game-options/Prefabs/GameOptionEntryBool Variant.prefab


m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.6509434, g: 0.6509434, b: 0.6509434, a: 1}
m_Color: {r: 0.8679245, g: 0.8679245, b: 0.8679245, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:

m_Component:
- component: {fileID: 1276828479}
- component: {fileID: 1276828480}
- component: {fileID: 6480578176489365575}
m_Layer: 5
m_Name: Toggle
m_TagString: Untagged

m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_NormalColor: {r: 0.6415094, g: 0.6415094, b: 0.6415094, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_SelectedColor: {r: 1, g: 1, b: 1, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1

m_PersistentCalls:
m_Calls: []
m_IsOn: 1
--- !u!114 &6480578176489365575
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1276828478}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b17b4f0ede176b345af395f45b7e6c9f, type: 3}
m_Name:
m_EditorClassIdentifier:
MenuEntryBackgroundImage: {fileID: 8601889576892527972}
Normal: {r: 0.1254902, g: 0.1254902, b: 0.1254902, a: 1}
Selected: {r: 0.33962262, g: 0.33962262, b: 0.33962262, a: 1}
--- !u!1001 &613121172145577351
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 6930701346793127765, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
propertyPath: m_Name
value: GameOptionEntryBool
value: GameOptionEntryBool Variant
objectReference: {fileID: 0}
- target: {fileID: 6948966462117553428, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}

type: 3}
m_PrefabInstance: {fileID: 613121172145577351}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8601889576892527972 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
m_PrefabInstance: {fileID: 613121172145577351}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:

51
Packages/net.peeweek.game-options/Prefabs/GameOptionEntryDropDown Variant.prefab


- component: {fileID: 1366023718}
- component: {fileID: 1366023717}
- component: {fileID: 1366023716}
- component: {fileID: 1160885386396754804}
m_Layer: 5
m_Name: Dropdown
m_TagString: Untagged

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.26415092, g: 0.26415092, b: 0.26415092, a: 0.99215686}
m_Color: {r: 0.4056604, g: 0.4056604, b: 0.4056604, a: 0.99215686}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:

m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_NormalColor: {r: 0.7264151, g: 0.7264151, b: 0.7264151, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_SelectedColor: {r: 1, g: 1, b: 1, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.41960785}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:

m_PersistentCalls:
m_Calls: []
m_AlphaFadeSpeed: 0.15
--- !u!114 &1160885386396754804
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1366023714}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b17b4f0ede176b345af395f45b7e6c9f, type: 3}
m_Name:
m_EditorClassIdentifier:
MenuEntryBackgroundImage: {fileID: 3398388604042736979}
Normal: {r: 0.1254902, g: 0.1254902, b: 0.1254902, a: 1}
Selected: {r: 0.33962262, g: 0.33962262, b: 0.33962262, a: 1}
--- !u!1 &1643280440
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 1879661270}
- component: {fileID: 1879661269}
- component: {fileID: 1879661268}
- component: {fileID: 2667812003656470357}
m_Layer: 5
m_Name: Template
m_TagString: Untagged

m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &2667812003656470357
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1879661266}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1c514756d7937947a07c73de5951227, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2039768715
GameObject:
m_ObjectHideFlags: 0

- target: {fileID: 6930701346793127765, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
propertyPath: m_Name
value: GameOptionEntryDropDown
value: GameOptionEntryDropDown Variant
objectReference: {fileID: 0}
- target: {fileID: 6948966462117553428, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}

type: 3}
m_PrefabInstance: {fileID: 5821943643772132784}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3398388604042736979 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
m_PrefabInstance: {fileID: 5821943643772132784}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:

32
Packages/net.peeweek.game-options/Prefabs/GameOptionEntrySlider Variant.prefab


- component: {fileID: 717617199}
- component: {fileID: 717617200}
- component: {fileID: 717617201}
- component: {fileID: 6358743955919709531}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged

m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_SelectedColor: {r: 1, g: 0.685069, b: 0, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1

Suffix: '%'
AsPercentage: 1
NumberFormat: F0
--- !u!114 &6358743955919709531
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 717617198}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b17b4f0ede176b345af395f45b7e6c9f, type: 3}
m_Name:
m_EditorClassIdentifier:
MenuEntryBackgroundImage: {fileID: 4997547969469271448}
Normal: {r: 0.1254902, g: 0.1254902, b: 0.1254902, a: 1}
Selected: {r: 0.33962262, g: 0.33962262, b: 0.33962262, a: 1}
--- !u!1 &928162379
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.1254902, g: 0.1254902, b: 0.1254902, a: 1}
m_Color: {r: 0.28627452, g: 0.28627452, b: 0.28627452, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:

type: 3}
m_PrefabInstance: {fileID: 4231389056612869499}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4997547969469271448 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
m_PrefabInstance: {fileID: 4231389056612869499}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:

94
Packages/net.peeweek.game-options/Prefabs/GameOptionHeader.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3842693085313852756
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 128474910830112189}
- component: {fileID: 325788122302737043}
- component: {fileID: 8616988077629608842}
m_Layer: 5
m_Name: Line
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &128474910830112189
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3842693085313852756}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5222927228609314981}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -2}
m_SizeDelta: {x: 0, y: 2}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &325788122302737043
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3842693085313852756}
m_CullTransparentMesh: 0
--- !u!114 &8616988077629608842
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3842693085313852756}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.3, g: 0.3, b: 0.3, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1001 &6185940868021123038
PrefabInstance:
m_ObjectHideFlags: 0

propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
propertyPath: m_Color.r
value: 0.2
objectReference: {fileID: 0}
- target: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
propertyPath: m_Color.g
value: 0.2
objectReference: {fileID: 0}
- target: {fileID: 9214983364259506403, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
propertyPath: m_Color.b
value: 0.2
objectReference: {fileID: 0}
--- !u!224 &5222927228609314981 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2135674710631987067, guid: 1c767a00d4fc8d44a8de55cd23980091,
type: 3}
m_PrefabInstance: {fileID: 6185940868021123038}
m_PrefabAsset: {fileID: 0}

4
Packages/net.peeweek.game-options/Prefabs/Graphics/Target Framerate DropDown Variant.prefab


- target: {fileID: 3504929485197621412, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Text
value: Target Framerate (frames per second)
value: Target Framerate
value: Target Framerate DropDown
value: Target Framerate DropDown Variant
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}

26
Packages/net.peeweek.game-options/Prefabs/Graphics/VSync Toggle Variant.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &8798758740440217967
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2631596636220687238}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d2af8e5a631fd24991bfe567b038767, type: 3}
m_Name:
m_EditorClassIdentifier:
targetFrameRateDropdown: {fileID: 0}
--- !u!1001 &2631596637362247864
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 7542669912858092242, guid: 36fc23dca840baf4cab245f329a4d8a4,
type: 3}
propertyPath: m_Name
value: VSync Toggle
value: VSync Toggle Variant
objectReference: {fileID: 0}
- target: {fileID: 7560855871935002771, guid: 36fc23dca840baf4cab245f329a4d8a4,
type: 3}
propertyPath: m_Text
value: VSync
--- !u!1 &2631596636220687238 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1276828478, guid: 36fc23dca840baf4cab245f329a4d8a4,
type: 3}
m_PrefabInstance: {fileID: 2631596637362247864}
m_PrefabAsset: {fileID: 0}

15
Packages/net.peeweek.game-options/Runtime/GameOptions.asmdef


{
"name": "GameOptions",
"references": [],
"optionalUnityReferences": [],
"references": [
"GUID:457756d89b35d2941b3e7b37b4ece6f1"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,

"defineConstraints": []
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.render-pipelines.high-definition",
"expression": "7.0.0",
"define": "GAME_OPTIONS_HDRP"
}
],
"noEngineReferences": false
}

51
Packages/net.peeweek.game-options/Runtime/GameOptions.cs


using System.Collections;
using System;
public static class GameOptions
public class GameOptions : MonoBehaviour
{
public class Preferences
{

public static GraphicOptions graphics;
public static AudioOptions audio;
[RuntimeInitializeOnLoadMethod]
static void Initialize()
{
var gameObject = new GameObject("Game Options");
gameObject.AddComponent<GameOptions>();
DontDestroyOnLoad(gameObject);
Load();
}
private void Start()
{
Apply();
}
static GameOptions()
static void Load()
Initialize();
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
try
{
foreach(var type in assembly.GetTypes())
{
if(type.IsSubclassOf(typeof(GameOption)) && !type.IsAbstract)
{
GameOption.Add(type);
}
}
}
catch
{
Debug.LogWarning($"Could not load any game option from assembly {assembly.FullName}");
}
}
[RuntimeInitializeOnLoadMethod]
static void Initialize()
public static void Apply()
graphics = GraphicOptions.Load();
graphics.Apply();
audio = AudioOptions.Load();
audio.Apply();
foreach(var gameOption in GameOption.all)
{
gameOption.Apply();
}
}
}
}

2
ProjectSettings/HDRPProjectSettings.asset


m_ProjectSettingFolderPath: HDRP
m_WizardPopupAtStart: 0
m_WizardActiveTab: 0
m_PackageVersionForMaterials: 7.1.7
m_PackageVersionForMaterials: 7.1.8

4
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2019.3.0f5
m_EditorVersionWithRevision: 2019.3.0f5 (44796c9d3c2c)
m_EditorVersion: 2019.3.0f6
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)

15
Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs


namespace GameOptionsUtility
{
public class AudioOptions : ScriptableObject
internal class AudioOption : GameOption
{
public class Preferences
{

if (m_Parameters.Any(o => o.Parameter == paramName))
{
var param = m_Parameters.First(o => o.Parameter == paramName);
return PlayerPrefs.GetFloat(Preferences.parameterPrefix + param, param.Value);
return PlayerPrefs.GetFloat(Preferences.parameterPrefix + paramName, param.Value);
}
else
return 0;

public string Parameter;
public float Value;
}
public static AudioOptions Load()
{
var audioOptions = Resources.Load<AudioOptions>(nameof(AudioOptions));
if (audioOptions == null)
{
audioOptions = CreateInstance<AudioOptions>();
}
return audioOptions;
}
public void Apply()
public override void Apply()
{
foreach(var parameter in m_Parameters)
{

5
Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs


[RequireComponent(typeof(Button))]
public class ButtonApplyOptions : MonoBehaviour
{
public bool ApplyGraphics = true;
private void OnEnable()
{
GetComponent<Button>().onClick.AddListener(Apply);

void Apply()
{
if(ApplyGraphics)
GameOptions.graphics.Apply();
GameOptions.Apply();
}
}
}

6
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs


int i = 0;
foreach (var res in Screen.resolutions)
{
if(res.width == GameOptions.graphics.width && res.height == GameOptions.graphics.height)
if(res.width == GameOption.Get<GraphicOption>().width && res.height == GameOption.Get<GraphicOption>().height)
if (GameOptions.graphics.refreshRate == res.refreshRate)
if (GameOption.Get<GraphicOption>().refreshRate == res.refreshRate)
selected = i;
i++;

void UpdateOptions(int value)
{
GameOptions.graphics.refreshRate = int.Parse(GetComponent<Dropdown>().options[value].text);
GameOption.Get<GraphicOption>().refreshRate = int.Parse(GetComponent<Dropdown>().options[value].text);
}
}

6
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs


if (!dropdown.options.Any(o => o.text == option))
{
dropdown.options.Add(new Dropdown.OptionData(option));
if (res.width == GameOptions.graphics.width && res.height == GameOptions.graphics.height)
if (res.width == GameOption.Get<GraphicOption>().width && res.height == GameOption.Get<GraphicOption>().height)
selected = i;
i++;
}

{
string option = GetComponent<Dropdown>().options[value].text;
string[] values = option.Split('x');
GameOptions.graphics.width = int.Parse(values[0]);
GameOptions.graphics.height = int.Parse(values[1]);
GameOption.Get<GraphicOption>().width = int.Parse(values[0]);
GameOption.Get<GraphicOption>().height = int.Parse(values[1]);
}
}

4
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs


dropdown.options.Add(new Dropdown.OptionData(framerate == -1? InfiniteText : framerate.ToString()));
}
int current = GameOptions.graphics.targetFrameRate;
int current = GameOption.Get<GraphicOption>().targetFrameRate;
GameOptions.graphics.targetFrameRate = TargetFramerates[value];
GameOption.Get<GraphicOption>().targetFrameRate = TargetFramerates[value];
}
}

4
Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs


}
slider.wholeNumbers = IntegerSliderValues;
slider.SetValueWithoutNotify(ParameterToSlider(GameOptions.audio.GetParameter(Parameter)));
slider.SetValueWithoutNotify(ParameterToSlider(GameOption.Get<AudioOption>().GetParameter(Parameter)));
}
private void OnDisable()

void UpdateOptions(float value)
{
GameOptions.audio.SetParameter(Parameter,SliderToParameter(value), ApplyParameter);
GameOption.Get<AudioOption>().SetParameter(Parameter,SliderToParameter(value), ApplyParameter);
}
float ParameterToSlider(float value)

144
Packages/net.peeweek.game-options/Prefabs/Graphics/Quality DropDown Variant.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &3663895412843452346
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6832880182756358787}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c32b486b1c171ec4a826d99255a5998b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &6832880181390369953
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3504929485197621412, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Text
value: Graphics Quality
objectReference: {fileID: 0}
- target: {fileID: 3523361657030796005, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Name
value: Quality DropDown Variant
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -581
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_SizeDelta.y
value: 96
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 22ac6a1da279db94ebffda71a105c766, type: 3}
--- !u!1 &6832880182756358787 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1366023714, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
m_PrefabInstance: {fileID: 6832880181390369953}
m_PrefabAsset: {fileID: 0}

7
Packages/net.peeweek.game-options/Prefabs/Graphics/Quality DropDown Variant.prefab.meta


fileFormatVersion: 2
guid: 58add5d94450e2545ab78e767ddb2618
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/net.peeweek.game-options/Prefabs/HDRP.meta


fileFormatVersion: 2
guid: bed841c5c964ea54b87f511fe8f34827
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

4
Packages/net.peeweek.game-options/Runtime/AssemblyInfo.cs


using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("GameOptions.Editor")]

11
Packages/net.peeweek.game-options/Runtime/AssemblyInfo.cs.meta


fileFormatVersion: 2
guid: 7685114ea45ea8742b281976a6044996
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/net.peeweek.game-options/Runtime/Core.meta


fileFormatVersion: 2
guid: 5e73bfd0cf4a195419f4e5075737ce27
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

54
Packages/net.peeweek.game-options/Runtime/GameOption.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace GameOptionsUtility
{
public abstract class GameOption : ScriptableObject
{
public static List<GameOption> all { get { return s_GameOptions.Values.ToList(); } }
static Dictionary<Type, GameOption> s_GameOptions;
public static T Get<T>() where T : GameOption
{
if (s_GameOptions == null)
s_GameOptions = new Dictionary<Type, GameOption>();
Type t = typeof(T);
if (!s_GameOptions.ContainsKey(t))
Add(t);
return (T)s_GameOptions[t];
}
internal static void Add(Type t)
{
if (t.IsSubclassOf(typeof(GameOption)) && !t.IsAbstract)
{
if (s_GameOptions == null)
s_GameOptions = new Dictionary<Type, GameOption>();
if (!s_GameOptions.ContainsKey(t))
s_GameOptions.Add(t, LoadOrDefault(t));
}
}
static GameOption LoadOrDefault(Type t)
{
GameOption option = Resources.Load<GameOption>(t.Name);
if (option == null)
{
option = (GameOption)CreateInstance(t);
}
return option;
}
public abstract void Apply();
}
}

11
Packages/net.peeweek.game-options/Runtime/GameOption.cs.meta


fileFormatVersion: 2
guid: c9f173a409c60104984f0a9d2898e0bd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/net.peeweek.game-options/Runtime/HDRP.meta


fileFormatVersion: 2
guid: e1285ccd61f479342b6fc390046d1f09
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/net.peeweek.game-options/Runtime/Utility.meta


fileFormatVersion: 2
guid: 92c6fb5868d98604d9799e7a07675897
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

503
Packages/net.peeweek.game-options/Prefabs/HDRP/Game Options Panel HDRP Variant.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &2409003269379756319
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3117207791764329568, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -1155.6
objectReference: {fileID: 0}
- target: {fileID: 3117207791962351148, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -1059.6
objectReference: {fileID: 0}
- target: {fileID: 3117207792212204642, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -963.6
objectReference: {fileID: 0}
- target: {fileID: 3159204167368531650, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -673.6
objectReference: {fileID: 0}
- target: {fileID: 3555777956663233269, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Navigation.m_Mode
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3555777956663233269, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Navigation.m_SelectOnUp
value:
objectReference: {fileID: 6655859485672983886}
- target: {fileID: 4125400877306455389, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -867.6
objectReference: {fileID: 0}
- target: {fileID: 6206056638489798896, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -771.6
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955858, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Name
value: Game Options Panel HDRP Variant
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.x
value: -160
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.y
value: -160
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 8012737718865955859, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 8012737718898694172, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737718898694172, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737719733764356, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737719733764356, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737719733764356, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737719733764356, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737719733764357, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8012737720102594775, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720102594775, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720292935941, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.00036621094
objectReference: {fileID: 0}
- target: {fileID: 8012737720292935941, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.y
value: 1184.6
objectReference: {fileID: 0}
- target: {fileID: 8012737720359943307, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720359943307, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720359943307, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720528820143, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720528820143, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720674481469, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -6.000004
objectReference: {fileID: 0}
- target: {fileID: 8012737720674481469, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.y
value: -188
objectReference: {fileID: 0}
- target: {fileID: 8012737720684796362, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720684796362, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720684796363, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Value
value: 0.99999964
objectReference: {fileID: 0}
- target: {fileID: 8012737720684796363, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_Size
value: 0.09707919
objectReference: {fileID: 0}
- target: {fileID: 8012737720726475844, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720726475844, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8012737720726475844, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836310265211, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836310265211, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836310265211, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836514213520, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836514213520, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836818691449, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836818691449, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836818691449, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836832744670, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748836832744670, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748837154760338, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748837154760338, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748837166716725, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748837166716725, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9020748837166716725, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d01cd2ed5d4e4144fb011b91aba701db, type: 3}
--- !u!224 &5646538894050433050 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8012737720292935941, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
m_PrefabInstance: {fileID: 2409003269379756319}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6655859485672983886 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 9020748836512029777, guid: d01cd2ed5d4e4144fb011b91aba701db,
type: 3}
m_PrefabInstance: {fileID: 2409003269379756319}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &5338066524666798196
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 5646538894050433050}
m_Modifications:
- target: {fileID: 2579412950127336563, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_Name
value: HDRP AntiAliasing Dropdown
objectReference: {fileID: 0}
- target: {fileID: 3046795431566875011, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 8
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -576
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_SizeDelta.y
value: 96
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3400049622281516636, guid: f7ec13daf8ecfe8439bcf2cd92f174e3,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f7ec13daf8ecfe8439bcf2cd92f174e3, type: 3}

7
Packages/net.peeweek.game-options/Prefabs/HDRP/Game Options Panel HDRP Variant.prefab.meta


fileFormatVersion: 2
guid: b3aca2c58eb2ef044a1214e167e81c7d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

145
Packages/net.peeweek.game-options/Prefabs/HDRP/HDRP AntiAliasing Dropdown Variant.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &2146521203135749793
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1382205599194243252}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 097f29772a92be1438562596e1567766, type: 3}
m_Name:
m_EditorClassIdentifier:
ApplyImmediately: 1
--- !u!1001 &1382205597875486358
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3504929485197621412, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Text
value: Anti Aliasing
objectReference: {fileID: 0}
- target: {fileID: 3523361657030796005, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Name
value: HDRP AntiAliasing Dropdown Variant
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -576
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_SizeDelta.y
value: 96
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4324005075986335946, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 22ac6a1da279db94ebffda71a105c766, type: 3}
--- !u!1 &1382205599194243252 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1366023714, guid: 22ac6a1da279db94ebffda71a105c766,
type: 3}
m_PrefabInstance: {fileID: 1382205597875486358}
m_PrefabAsset: {fileID: 0}

7
Packages/net.peeweek.game-options/Prefabs/HDRP/HDRP AntiAliasing Dropdown Variant.prefab.meta


fileFormatVersion: 2
guid: f7ec13daf8ecfe8439bcf2cd92f174e3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

85
Packages/net.peeweek.game-options/Runtime/Core/GraphicOption.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GameOptionsUtility
{
internal class GraphicOption : GameOption
{
public class Preferences
{
public const string prefix = GameOptions.Preferences.prefix + "Graphics.";
public const string fullScreenMode = prefix + "FullScreenMode";
public const string vSync = prefix + "VSync";
public const string targetFrameRate = prefix + "TargetFrameRate";
public const string resolutionWidth = prefix + "ResolutionWidth";
public const string resolutionHeight = prefix + "ResolutionHeight";
public const string refreshRate = prefix + "RefreshRate";
public const string quality = prefix + "Quality";
}
public FullScreenMode fullScreenMode
{
get { return(FullScreenMode)PlayerPrefs.GetInt(Preferences.fullScreenMode, (int)m_DefaultFullScreenMode); }
set { PlayerPrefs.SetInt(Preferences.fullScreenMode, (int)value); }
}
public bool vSync
{
get { return PlayerPrefs.GetInt(Preferences.vSync, m_DefaultVSync? 1 : 0) == 1? true : false; }
set { PlayerPrefs.SetInt(Preferences.vSync, value? 1 : 0); }
}
public int targetFrameRate
{
get { return PlayerPrefs.GetInt(Preferences.targetFrameRate, m_DefaultTargetFrameRate); }
set { PlayerPrefs.SetInt(Preferences.targetFrameRate, value); }
}
public int width
{
get { return PlayerPrefs.GetInt(Preferences.resolutionWidth, m_DefaultNativeResolution ? Screen.width : m_DefaultWidth); }
set { PlayerPrefs.SetInt(Preferences.resolutionWidth, value); }
}
public int height
{
get { return PlayerPrefs.GetInt(Preferences.resolutionHeight, m_DefaultNativeResolution ? Screen.height : m_DefaultHeight); }
set { PlayerPrefs.SetInt(Preferences.resolutionHeight, value); }
}
public int refreshRate
{
get { return PlayerPrefs.GetInt(Preferences.refreshRate, m_DefaultRefreshRate); }
set { PlayerPrefs.SetInt(Preferences.refreshRate, value); }
}
public int quality
{
get { return PlayerPrefs.GetInt(Preferences.quality, QualitySettings.GetQualityLevel()); }
set { PlayerPrefs.SetInt(Preferences.quality, value); QualitySettings.SetQualityLevel(value); }
}
[Header("Defaults")]
[SerializeField]
protected FullScreenMode m_DefaultFullScreenMode = FullScreenMode.FullScreenWindow;
[SerializeField]
protected bool m_DefaultVSync = true;
[SerializeField]
protected int m_DefaultTargetFrameRate = -1;
[SerializeField]
protected bool m_DefaultNativeResolution = true;
[SerializeField]
protected int m_DefaultWidth = 1280;
[SerializeField]
protected int m_DefaultHeight = 720;
[SerializeField]
protected int m_DefaultRefreshRate = 60;
public override void Apply()
{
Screen.SetResolution(width, height, fullScreenMode, refreshRate);
QualitySettings.vSyncCount = vSync ? 1 : 0;
Application.targetFrameRate = targetFrameRate;
}
}
}

48
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownFullScreenMode.cs


using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace GameOptionsUtility
{
[RequireComponent(typeof(Dropdown))]
public class DropDownFullScreenMode : MonoBehaviour
{
public Dropdown refreshRateDropdown;
private void OnEnable()
{
var dropdown = GetComponent<Dropdown>();
InitializeEntries(dropdown);
dropdown.onValueChanged.AddListener(UpdateOptions);
UpdateOptions(dropdown.value);
}
private void OnDisable()
{
GetComponent<Dropdown>().onValueChanged.RemoveListener(UpdateOptions);
}
public void InitializeEntries(Dropdown dropdown)
{
dropdown.options.Clear();
dropdown.options.Add(new Dropdown.OptionData("Full Screen (Exclusive)"));
dropdown.options.Add(new Dropdown.OptionData("Full Screen (Windowed)"));
dropdown.options.Add(new Dropdown.OptionData("Maximized Window"));
dropdown.options.Add(new Dropdown.OptionData("Window"));
dropdown.SetValueWithoutNotify((int)GameOption.Get<GraphicOption>().fullScreenMode);
}
void UpdateOptions(int value)
{
GameOption.Get<GraphicOption>().fullScreenMode = (FullScreenMode)value;
if (refreshRateDropdown != null)
{
refreshRateDropdown.interactable = (value == 0);
refreshRateDropdown.captionText.CrossFadeAlpha(value > 0 ? 0.1f : 1.0f, refreshRateDropdown.colors.fadeDuration, true);
}
}
}
}

42
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownQuality.cs


using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace GameOptionsUtility
{
[RequireComponent(typeof(Dropdown))]
public class DropDownQuality : MonoBehaviour
{
private void OnEnable()
{
var dropdown = GetComponent<Dropdown>();
InitializeEntries(dropdown);
dropdown.onValueChanged.AddListener(UpdateOptions);
UpdateOptions(dropdown.value);
}
private void OnDisable()
{
GetComponent<Dropdown>().onValueChanged.RemoveListener(UpdateOptions);
}
public void InitializeEntries(Dropdown dropdown)
{
dropdown.options.Clear();
foreach(var quality in QualitySettings.names)
dropdown.options.Add(new Dropdown.OptionData(quality));
int current = GameOption.Get<GraphicOption>().quality;
dropdown.SetValueWithoutNotify(current);
}
void UpdateOptions(int value)
{
GameOption.Get<GraphicOption>().quality = value;
}
}
}

11
Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownQuality.cs.meta


fileFormatVersion: 2
guid: c32b486b1c171ec4a826d99255a5998b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

28
Packages/net.peeweek.game-options/Runtime/Core/UI/HighlightEntry.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof(Selectable))]
public class HighlightEntry : MonoBehaviour, ISelectHandler, IDeselectHandler
{
public Image MenuEntryBackgroundImage;
public Color Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f);
public Color Selected = new Color(2.0f, 2.0f, 2.0f, 1.0f);
public void OnEnable()
{
MenuEntryBackgroundImage.color = Normal;
}
public void OnDeselect(BaseEventData eventData)
{
MenuEntryBackgroundImage.color = Normal;
}
public void OnSelect(BaseEventData eventData)
{
MenuEntryBackgroundImage.color = Selected;
}
}

11
Packages/net.peeweek.game-options/Runtime/Core/UI/HighlightEntry.cs.meta


fileFormatVersion: 2
guid: b17b4f0ede176b345af395f45b7e6c9f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

38
Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTargetFramerate.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace GameOptionsUtility
{
[RequireComponent(typeof(Slider))]
public class SliderTargetFramerate : MonoBehaviour
{
public Vector2 MinMaxFramerate = new Vector2(15, 144);
private void OnEnable()
{
var slider = GetComponent<Slider>();
InitializeEntries(slider);
slider.onValueChanged.AddListener(UpdateOptions);
UpdateOptions(slider.value);
}
private void OnDisable()
{
GetComponent<Slider>().onValueChanged.RemoveListener(UpdateOptions);
}
void InitializeEntries(Slider slider)
{
slider.value = GameOption.Get<GraphicOption>().targetFrameRate;
}
void UpdateOptions(float value)
{
GameOption.Get<GraphicOption>().targetFrameRate = (int)value;
}
}
}

48
Packages/net.peeweek.game-options/Runtime/Core/UI/ToggleVSync.cs


using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace GameOptionsUtility
{
[RequireComponent(typeof(Toggle))]
public class ToggleVSync : MonoBehaviour
{
public Dropdown targetFrameRateDropdown;
private void OnEnable()
{
InitializeEntries();
GetComponent<Toggle>().onValueChanged.AddListener(UpdateOptions);
UpdateTargetFramerate(GameOption.Get<GraphicOption>().vSync);
}
private void OnDisable()
{
GetComponent<Toggle>().onValueChanged.RemoveListener(UpdateOptions);
}
public void InitializeEntries()
{
GetComponent<Toggle>().isOn = GameOption.Get<GraphicOption>().vSync;
}
void UpdateOptions(bool value)
{
GameOption.Get<GraphicOption>().vSync = value;
UpdateTargetFramerate(value);
}
void UpdateTargetFramerate(bool value)
{
if (targetFrameRateDropdown != null)
{
targetFrameRateDropdown.interactable = !value;
targetFrameRateDropdown.captionText.CrossFadeAlpha(value ? 0.1f : 1.0f, targetFrameRateDropdown.colors.fadeDuration, true);
}
}
}
}

57
Packages/net.peeweek.game-options/Runtime/HDRP/HDRPCameraOption.cs


#if GAME_OPTIONS_HDRP
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
namespace GameOptionsUtility.HDRP
{
public class HDRPCameraOption : GameOption
{
public class Preferences
{
public const string prefix = GameOptions.Preferences.prefix + "HDRP.";
public const string antialiasing = prefix + "AntiAliasing";
}
static List<HDAdditionalCameraData> s_Cameras;
public HDAdditionalCameraData.AntialiasingMode antiAliasing
{
get { return (HDAdditionalCameraData.AntialiasingMode)PlayerPrefs.GetInt(Preferences.antialiasing, (int)HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing); }
set { PlayerPrefs.SetInt(Preferences.antialiasing, (int)value); }
}
public static void AddCamera(HDAdditionalCameraData camera)
{
if (s_Cameras == null)
s_Cameras = new List<HDAdditionalCameraData>();
if (!s_Cameras.Contains(camera))
s_Cameras.Add(camera);
Get<HDRPCameraOption>().Apply();
}
public static void RemoveCamera(HDAdditionalCameraData camera)
{
if (s_Cameras == null)
s_Cameras = new List<HDAdditionalCameraData>();
if (s_Cameras.Contains(camera))
s_Cameras.Remove(camera);
}
public override void Apply()
{
if (s_Cameras == null)
return;
foreach (var camera in s_Cameras)
{
camera.antialiasing = antiAliasing;
}
}
}
}
#endif

11
Packages/net.peeweek.game-options/Runtime/HDRP/HDRPCameraOption.cs.meta


fileFormatVersion: 2
guid: 28bc2d7284c49294b94b065ca17abef8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

21
Packages/net.peeweek.game-options/Runtime/HDRP/HDRPGameOptionsManagedCamera.cs


#if GAME_OPTIONS_HDRP
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
namespace GameOptionsUtility.HDRP
{
[RequireComponent(typeof(HDAdditionalCameraData))]
public class HDRPGameOptionsManagedCamera : MonoBehaviour
{
private void OnEnable()
{
HDRPCameraOption.AddCamera(GetComponent<HDAdditionalCameraData>());
}
private void OnDisable()
{
HDRPCameraOption.RemoveCamera(GetComponent<HDAdditionalCameraData>());
}
}
}
#endif

11
Packages/net.peeweek.game-options/Runtime/HDRP/HDRPGameOptionsManagedCamera.cs.meta


fileFormatVersion: 2
guid: 8f22350d987b53b468c6eac2a04e973a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Packages/net.peeweek.game-options/Runtime/HDRP/UI.meta


fileFormatVersion: 2
guid: 13388c96dd131a84da09e7a32cf16b13
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

48
Packages/net.peeweek.game-options/Runtime/HDRP/UI/HDRPAntiAliasingDropdown.cs


#if GAME_OPTIONS_HDRP
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Rendering.HighDefinition;
namespace GameOptionsUtility.HDRP
{
[RequireComponent(typeof(Dropdown))]
public class HDRPAntiAliasingDropdown : MonoBehaviour
{
public bool ApplyImmediately = true;
private void OnEnable()
{
var dropdown = GetComponent<Dropdown>();
InitializeEntries(dropdown);
dropdown.onValueChanged.AddListener(UpdateOptions);
UpdateOptions(dropdown.value);
}
private void OnDisable()
{
GetComponent<Dropdown>().onValueChanged.RemoveListener(UpdateOptions);
}
public void InitializeEntries(Dropdown dropdown)
{
dropdown.options.Clear();
dropdown.options.Add(new Dropdown.OptionData("None"));
dropdown.options.Add(new Dropdown.OptionData("FXAA"));
dropdown.options.Add(new Dropdown.OptionData("TAA"));
dropdown.options.Add(new Dropdown.OptionData("SMAA"));
dropdown.SetValueWithoutNotify((int)GameOption.Get<HDRPCameraOption>().antiAliasing);
}
void UpdateOptions(int value)
{
var option = GameOption.Get<HDRPCameraOption>();
option.antiAliasing = (HDAdditionalCameraData.AntialiasingMode)value;
if (ApplyImmediately)
option.Apply();
}
}
}
#endif

11
Packages/net.peeweek.game-options/Runtime/HDRP/UI/HDRPAntiAliasingDropdown.cs.meta


fileFormatVersion: 2
guid: 097f29772a92be1438562596e1567766
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

63
Packages/net.peeweek.game-options/Runtime/Utility/DropDownAutoScrollOnChange.cs


/* DropDownAutoScrollOnChange
* --------------------------
* Updates scrolling when selection changes inside a drop down panel when selection changes.
* This scripts patches the inability of ScrollRects to handle correct scrolling upon selection change.
*
* Adepted From:
* https://answers.unity.com/questions/1169028/unity-dropdown-doesnt-scroll-when-navigating-with.html
*/
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace GameOptionsUtility.Utility
{
[RequireComponent(typeof(ScrollRect))]
internal class DropDownAutoScrollOnChange : MonoBehaviour
{
RectTransform scrollRectTransform;
RectTransform contentPanel;
RectTransform selectedRectTransform;
GameObject lastSelected;
void Start()
{
scrollRectTransform = GetComponent<RectTransform>();
}
void Update()
{
// Lazy Get
if (contentPanel == null)
contentPanel = GetComponent<ScrollRect>().content;
GameObject selected = EventSystem.current.currentSelectedGameObject;
if (selected == null)
return;
if (selected.transform.parent != contentPanel.transform)
return;
if (selected == lastSelected)
return;
selectedRectTransform = selected.GetComponent<RectTransform>();
float yPos = -(selectedRectTransform.localPosition.y) - (selectedRectTransform.rect.height / 2);
float yContent = contentPanel.anchoredPosition.y;
float maxHeight = scrollRectTransform.rect.height - selectedRectTransform.rect.height;
float delta = yPos - yContent;
if (delta < 0)
yContent = yPos;
else if (delta > maxHeight)
yContent = yPos - maxHeight;
else
return;
contentPanel.anchoredPosition = new Vector2(contentPanel.anchoredPosition.x, yContent);
lastSelected = selected;
}
}
}

11
Packages/net.peeweek.game-options/Runtime/Utility/DropDownAutoScrollOnChange.cs.meta


fileFormatVersion: 2
guid: c1c514756d7937947a07c73de5951227
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

90
Packages/net.peeweek.game-options/Runtime/GraphicOptions.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GameOptionsUtility
{
public class GraphicOptions : ScriptableObject
{
public class Preferences
{
public const string prefix = GameOptions.Preferences.prefix + "Graphics.";
public const string fullScreenMode = prefix + "FullScreenMode";
public const string vSync = prefix + "VSync";
public const string targetFrameRate = prefix + "TargetFrameRate";
public const string resolutionWidth = prefix + "ResolutionWidth";
public const string resolutionHeight = prefix + "ResolutionHeight";
public const string refreshRate = prefix + "RefreshRate";
}
public FullScreenMode fullScreenMode
{
get { return(FullScreenMode)PlayerPrefs.GetInt(Preferences.fullScreenMode, (int)m_DefaultFullScreenMode); }
set { PlayerPrefs.SetInt(Preferences.fullScreenMode, (int)value); }
}
public bool vSync
{
get { return PlayerPrefs.GetInt(Preferences.vSync, m_DefaultVSync? 1 : 0) == 1? true : false; }
set { PlayerPrefs.SetInt(Preferences.vSync, value? 1 : 0); }
}
public int targetFrameRate
{
get { return PlayerPrefs.GetInt(Preferences.targetFrameRate, m_DefaultTargetFrameRate); }
set { PlayerPrefs.SetInt(Preferences.targetFrameRate, value); }
}
public int width
{
get { return PlayerPrefs.GetInt(Preferences.resolutionWidth, m_DefaultNativeResolution ? Screen.width : m_DefaultWidth); }
set { PlayerPrefs.SetInt(Preferences.resolutionWidth, value); }
}
public int height
{
get { return PlayerPrefs.GetInt(Preferences.resolutionHeight, m_DefaultNativeResolution ? Screen.height : m_DefaultHeight); }
set { PlayerPrefs.SetInt(Preferences.resolutionHeight, value); }
}
public int refreshRate
{
get { return PlayerPrefs.GetInt(Preferences.refreshRate, m_DefaultRefreshRate); }
set { PlayerPrefs.SetInt(Preferences.refreshRate, value); }
}
[Header("Defaults")]
[SerializeField]
protected FullScreenMode m_DefaultFullScreenMode = FullScreenMode.FullScreenWindow;
[SerializeField]
protected bool m_DefaultVSync = true;
[SerializeField]
protected int m_DefaultTargetFrameRate = -1;
[SerializeField]
protected bool m_DefaultNativeResolution = true;
[SerializeField]
protected int m_DefaultWidth = 1280;
[SerializeField]
protected int m_DefaultHeight = 720;
[SerializeField]
protected int m_DefaultRefreshRate = 60;
[SerializeField]
protected int m_DefaultMonitor = 0;
public static GraphicOptions Load()
{
var graphics = Resources.Load<GraphicOptions>(nameof(GraphicOptions));
if (graphics == null)
{
graphics = CreateInstance<GraphicOptions>();
}
return graphics;
}
public void Apply()
{
QualitySettings.vSyncCount = vSync ? 1 : 0;
Application.targetFrameRate = targetFrameRate;
Screen.SetResolution(width, height, fullScreenMode, refreshRate);
}
}
}

/Packages/net.peeweek.game-options/Runtime/AudioOptions.cs → /Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs

/Packages/net.peeweek.game-options/Runtime/AudioOptions.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/AudioOption.cs.meta

/Packages/net.peeweek.game-options/Runtime/GraphicOptions.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/GraphicOption.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI.meta

/Packages/net.peeweek.game-options/Runtime/UI/ButtonApplyOptions.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs

/Packages/net.peeweek.game-options/Runtime/UI/ButtonApplyOptions.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/ButtonApplyOptions.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/DropDownFullScreenMode.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownFullScreenMode.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/DropDownRefreshRate.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs

/Packages/net.peeweek.game-options/Runtime/UI/DropDownRefreshRate.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownRefreshRate.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/DropDownResolution.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs

/Packages/net.peeweek.game-options/Runtime/UI/DropDownResolution.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownResolution.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/DropDownTargetFramerate.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs

/Packages/net.peeweek.game-options/Runtime/UI/DropDownTargetFramerate.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/DropDownTargetFramerate.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/SliderAudioParameter.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs

/Packages/net.peeweek.game-options/Runtime/UI/SliderAudioParameter.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderAudioParameter.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/SliderTargetFramerate.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTargetFramerate.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/SliderTextBind.cs → /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTextBind.cs

/Packages/net.peeweek.game-options/Runtime/UI/SliderTextBind.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/SliderTextBind.cs.meta

/Packages/net.peeweek.game-options/Runtime/UI/ToggleVSync.cs.meta → /Packages/net.peeweek.game-options/Runtime/Core/UI/ToggleVSync.cs.meta

正在加载...
取消
保存