uChema
3 年前
当前提交
f29c7129
共有 37 个文件被更改,包括 2969 次插入 和 1766 次删除
-
999UOP1_Project/Assets/Art/UI/PlaceHolders/HeartBorder.png
-
1UOP1_Project/Assets/Prefabs/Characters/NPCs_Unique/BardHare.prefab
-
68UOP1_Project/Assets/Prefabs/UI/GameplayScene/GameScreen.prefab
-
657UOP1_Project/Assets/Scenes/Managers/Gameplay.unity
-
1UOP1_Project/Assets/ScriptableObjects/Gameplay/GameState.asset
-
1UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ChangeGameStateActionSO.cs
-
26UOP1_Project/Assets/Scripts/Gameplay/GameStateSO.cs
-
1UOP1_Project/Assets/Scripts/Input/InputReader.cs
-
1UOP1_Project/Assets/Scripts/Interaction/InteractionManager.cs
-
2UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsAudioComponent.cs
-
18UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsLanguageComponent.cs
-
8UOP1_Project/Assets/Scripts/UI/Settings/UISettingsController.cs
-
29UOP1_Project/Assets/Scripts/UI/UIHeartDisplay.cs
-
1UOP1_Project/Assets/Scripts/UI/UIManager.cs
-
2UOP1_Project/ProjectSettings/QualitySettings.asset
-
446UOP1_Project/Assets/Art/UI/PlaceHolders/HeartAggro.png
-
120UOP1_Project/Assets/Art/UI/PlaceHolders/HeartAggro.png.meta
-
322UOP1_Project/Assets/Prefabs/UI/GameplayScene/Health System/Heart.prefab
-
14UOP1_Project/Assets/ScriptableObjects/Events/UI/AggroEvent.asset
-
8UOP1_Project/Assets/ScriptableObjects/Events/UI/AggroEvent.asset.meta
-
309UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsGraphicsComponent.cs
-
76UOP1_Project/Assets/Scripts/UI/Settings/UISetButtonNavigation.cs
-
1001UOP1_Project/Assets/Shaders/AggroEffect.shadergraph
-
10UOP1_Project/Assets/Shaders/AggroEffect.shadergraph.meta
-
167UOP1_Project/Assets/Prefabs/UI/GameplayScene/Health System/Heart (5).prefab
-
373UOP1_Project/Assets/Scripts/Systems/Settings/SettingsGraphicsComponent.cs
-
74UOP1_Project/Assets/Scripts/SetButtonNavigation.cs
-
0/UOP1_Project/Assets/Prefabs/UI/GameplayScene/Health System/Heart.prefab.meta
-
0/UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsAudioComponent.cs.meta
-
0/UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsGraphicsComponent.cs.meta
-
0/UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsLanguageComponent.cs.meta
-
0/UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsAudioComponent.cs
-
0/UOP1_Project/Assets/Scripts/Systems/Settings/UISettingsLanguageComponent.cs
-
0/UOP1_Project/Assets/Scripts/UI/Settings/UISetButtonNavigation.cs.meta
-
0/UOP1_Project/Assets/Scripts/CutsceneAudioConfigSetter.cs
-
0/UOP1_Project/Assets/Scripts/CutsceneAudioConfigSetter.cs.meta
999
UOP1_Project/Assets/Art/UI/PlaceHolders/HeartBorder.png
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 73a55dcac24b3ac40bce84252a70e839 |
|||
TextureImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 11 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 0 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
streamingMipmaps: 0 |
|||
streamingMipmapsPriority: 0 |
|||
vTOnly: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: 1 |
|||
aniso: 1 |
|||
mipBias: 0 |
|||
wrapU: 1 |
|||
wrapV: 1 |
|||
wrapW: 0 |
|||
nPOTScale: 0 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 1 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spritePixelsToUnits: 100 |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spriteGenerateFallbackPhysicsShape: 1 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 1 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 8 |
|||
textureShape: 1 |
|||
singleChannelComponent: 0 |
|||
flipbookRows: 1 |
|||
flipbookColumns: 1 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
ignorePngGamma: 0 |
|||
applyGammaDecoding: 0 |
|||
platformSettings: |
|||
- serializedVersion: 3 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Standalone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: WebGL |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: 5e97eb03825dee720800000000000000 |
|||
internalID: 0 |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
secondaryTextures: [] |
|||
spritePackingTag: |
|||
pSDRemoveMatte: 0 |
|||
pSDShowRemoveMatteOption: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &2452212168606274213 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 197942095025170210} |
|||
- component: {fileID: 502051922560774161} |
|||
- component: {fileID: 4366080178884650253} |
|||
m_Layer: 9 |
|||
m_Name: HeartBG |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &197942095025170210 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2452212168606274213} |
|||
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: 6160154980344531226} |
|||
m_RootOrder: 1 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 1, y: 1} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &502051922560774161 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2452212168606274213} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &4366080178884650253 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2452212168606274213} |
|||
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: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: f7832212859f3334bb51bc203948aeb0, type: 3} |
|||
m_Type: 0 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 0 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|||
--- !u!1 &2722643623908019210 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 3687514796907880683} |
|||
- component: {fileID: 5094783884241698675} |
|||
- component: {fileID: 6710324811543529516} |
|||
m_Layer: 9 |
|||
m_Name: AggroBg |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 0 |
|||
--- !u!224 &3687514796907880683 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2722643623908019210} |
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} |
|||
m_LocalPosition: {x: 0, y: 0, z: 0} |
|||
m_LocalScale: {x: 3, y: 3, z: 0} |
|||
m_Children: [] |
|||
m_Father: {fileID: 6160154980344531226} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 1, y: 1} |
|||
m_AnchoredPosition: {x: 0.00000011920929, y: 0} |
|||
m_SizeDelta: {x: -0.00000023841858, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &5094783884241698675 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2722643623908019210} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &6710324811543529516 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 2722643623908019210} |
|||
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: 1, g: 0, b: 0, a: 0.33333334} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: 73a55dcac24b3ac40bce84252a70e839, type: 3} |
|||
m_Type: 0 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 0 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|||
--- !u!1 &3252307297337961723 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 6160154980344531226} |
|||
- component: {fileID: 5838050402550013783} |
|||
- component: {fileID: 3154276167561949981} |
|||
- component: {fileID: 7512214850402593519} |
|||
m_Layer: 9 |
|||
m_Name: Heart |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &6160154980344531226 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
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: |
|||
- {fileID: 3687514796907880683} |
|||
- {fileID: 197942095025170210} |
|||
- {fileID: 7302444323654689616} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 0, y: 0} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &5838050402550013783 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &3154276167561949981 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
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: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: f7832212859f3334bb51bc203948aeb0, type: 3} |
|||
m_Type: 0 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 4 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|||
--- !u!114 &7512214850402593519 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: a540d4fc4c843414499eef42aa822b81, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
_setAggroEvent: {fileID: 11400000, guid: 3c3f87199559eb0418616aedad568b71, type: 2} |
|||
_slidingImage: {fileID: 6606407167209840454} |
|||
_aggroImage: {fileID: 6710324811543529516} |
|||
_bgImage: {fileID: 6710324811543529516} |
|||
--- !u!1 &5861475152475693651 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 7302444323654689616} |
|||
- component: {fileID: 8330133716670309808} |
|||
- component: {fileID: 6606407167209840454} |
|||
m_Layer: 9 |
|||
m_Name: Heart |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &7302444323654689616 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
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: 6160154980344531226} |
|||
m_RootOrder: 2 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 1, y: 1} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &8330133716670309808 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &6606407167209840454 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
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: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: 3fd36e940da953743b7164a5d8298a60, type: 3} |
|||
m_Type: 3 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 0 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 3177d113f09ae42448cde1e1a5067d4f, type: 3} |
|||
m_Name: AggroEvent |
|||
m_EditorClassIdentifier: |
|
|||
fileFormatVersion: 2 |
|||
guid: 3c3f87199559eb0418616aedad568b71 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using TMPro; |
|||
using UnityEngine; |
|||
using UnityEngine.Serialization; |
|||
using UnityEngine.Events; |
|||
using UnityEngine.Rendering.Universal; |
|||
|
|||
[System.Serializable] |
|||
public class ShadowDistanceTier |
|||
{ |
|||
public float Distance; |
|||
public string TierDescription; |
|||
} |
|||
|
|||
public class UISettingsGraphicsComponent : MonoBehaviour |
|||
{ |
|||
[FormerlySerializedAs("ShadowDistanceTierList")] |
|||
[SerializeField] private List<ShadowDistanceTier> _shadowDistanceTierList = new List<ShadowDistanceTier>(); // filled from inspector
|
|||
[FormerlySerializedAs("URPAsset")] |
|||
[SerializeField] private UniversalRenderPipelineAsset _uRPAsset = default; |
|||
|
|||
private int _savedResolutionIndex = default; |
|||
private int _savedAntiAliasingIndex = default; |
|||
private int _savedShadowDistanceTier = default; |
|||
private bool _savedFullscreenState = default; |
|||
|
|||
private int _currentResolutionIndex = default; |
|||
private List<Resolution> _resolutionsList = default; |
|||
[SerializeField] UISettingItemFiller _resolutionsField = default; |
|||
|
|||
/* private int _currentShadowQualityIndex = default; |
|||
private List<string> _shadowQualityList = default; |
|||
[SerializeField] private UISettingItemFiller _shadowQualityField = default;*/ |
|||
|
|||
private int _currentAntiAliasingIndex = default; |
|||
private List<string> _currentAntiAliasingList = default; |
|||
[SerializeField] private UISettingItemFiller _antiAliasingField = default; |
|||
|
|||
private int _currentShadowDistanceTier = default; |
|||
[SerializeField] private UISettingItemFiller _shadowDistanceField = default; |
|||
private bool _isFullscreen = default; |
|||
|
|||
[SerializeField] private UISettingItemFiller _fullscreenField = default; |
|||
|
|||
public event UnityAction<int, int, float, bool> _save = delegate { }; |
|||
|
|||
private Resolution _currentResolution; |
|||
|
|||
[SerializeField] private UIGenericButton _saveButton; |
|||
[SerializeField] private UIGenericButton _resetButton; |
|||
|
|||
void OnEnable() |
|||
{ |
|||
_resolutionsField._nextOption += NextResolution; |
|||
_resolutionsField._previousOption += PreviousResolution; |
|||
|
|||
_shadowDistanceField._nextOption += NextShadowDistanceTier; |
|||
_shadowDistanceField._previousOption += PreviousShadowDistanceTier; |
|||
|
|||
_fullscreenField._nextOption += NextFullscreenState; |
|||
_fullscreenField._previousOption += PreviousFullscreenState; |
|||
|
|||
_antiAliasingField._nextOption += NextAntiAliasingTier; |
|||
_antiAliasingField._previousOption += PreviousAntiAliasingTier; |
|||
|
|||
_saveButton.Clicked += SaveSettings; |
|||
_resetButton.Clicked += ResetSettings; |
|||
|
|||
} |
|||
private void OnDisable() |
|||
{ |
|||
ResetSettings(); |
|||
_resolutionsField._nextOption -= NextResolution; |
|||
_resolutionsField._previousOption -= PreviousResolution; |
|||
|
|||
_shadowDistanceField._nextOption -= NextShadowDistanceTier; |
|||
_shadowDistanceField._previousOption -= PreviousShadowDistanceTier; |
|||
|
|||
_fullscreenField._nextOption -= NextFullscreenState; |
|||
_fullscreenField._previousOption -= PreviousFullscreenState; |
|||
|
|||
_antiAliasingField._nextOption -= NextAntiAliasingTier; |
|||
_antiAliasingField._previousOption -= PreviousAntiAliasingTier; |
|||
|
|||
_saveButton.Clicked -= SaveSettings; |
|||
_resetButton.Clicked -= ResetSettings; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
public void Init() |
|||
{ |
|||
_resolutionsList = GetResolutionsList(); |
|||
_currentShadowDistanceTier = GetCurrentShadowDistanceTier(); |
|||
_currentAntiAliasingList = GetDropdownData(Enum.GetNames(typeof(MsaaQuality))); |
|||
|
|||
_currentResolution = Screen.currentResolution; |
|||
_currentResolutionIndex = GetCurrentResolutionIndex(); |
|||
_isFullscreen = GetCurrentFullscreenState(); |
|||
_currentAntiAliasingIndex = GetCurrentAntialiasing(); |
|||
|
|||
_savedResolutionIndex = _currentResolutionIndex; |
|||
_savedAntiAliasingIndex = _currentAntiAliasingIndex; |
|||
_savedShadowDistanceTier = _currentShadowDistanceTier; |
|||
_savedFullscreenState = _isFullscreen; |
|||
} |
|||
public void Setup() |
|||
{ |
|||
Init(); |
|||
SetResolutionField(); |
|||
SetShadowDistance(); |
|||
SetFullscreen(); |
|||
SetAntiAliasingField(); |
|||
} |
|||
|
|||
#region Resolution
|
|||
void SetResolutionField() |
|||
{ |
|||
string displayText = _resolutionsList[_currentResolutionIndex].ToString(); |
|||
displayText = displayText.Substring(0, displayText.IndexOf("@")); |
|||
|
|||
_resolutionsField.FillSettingField(_resolutionsList.Count, _currentResolutionIndex, displayText); |
|||
|
|||
} |
|||
List<Resolution> GetResolutionsList() |
|||
{ |
|||
List<Resolution> options = new List<Resolution>(); |
|||
for (int i = 0; i < Screen.resolutions.Length; i++) |
|||
{ |
|||
options.Add(Screen.resolutions[i]); |
|||
} |
|||
|
|||
return options; |
|||
} |
|||
int GetCurrentResolutionIndex() |
|||
{ |
|||
if (_resolutionsList == null) |
|||
{ _resolutionsList = GetResolutionsList(); } |
|||
int index = _resolutionsList.FindIndex(o => o.width == _currentResolution.width && o.height == _currentResolution.height); |
|||
return index; |
|||
} |
|||
void NextResolution() |
|||
{ |
|||
_currentResolutionIndex++; |
|||
_currentResolutionIndex = Mathf.Clamp(_currentResolutionIndex, 0, _resolutionsList.Count - 1); |
|||
OnResolutionChange(); |
|||
} |
|||
void PreviousResolution() |
|||
{ |
|||
_currentResolutionIndex--; |
|||
_currentResolutionIndex = Mathf.Clamp(_currentResolutionIndex, 0, _resolutionsList.Count - 1); |
|||
OnResolutionChange(); |
|||
} |
|||
void OnResolutionChange() |
|||
{ |
|||
_currentResolution = _resolutionsList[_currentResolutionIndex]; |
|||
Screen.SetResolution(_currentResolution.width, _currentResolution.height, _isFullscreen); |
|||
SetResolutionField(); |
|||
} |
|||
#endregion
|
|||
|
|||
#region ShadowDistance
|
|||
void SetShadowDistance() |
|||
{ |
|||
_shadowDistanceField.FillSettingField_Localized(_shadowDistanceTierList.Count, _currentShadowDistanceTier, _shadowDistanceTierList[_currentShadowDistanceTier].TierDescription); |
|||
} |
|||
int GetCurrentShadowDistanceTier() |
|||
{ |
|||
int tierIndex = -1; |
|||
if (_shadowDistanceTierList.Exists(o => o.Distance == _uRPAsset.shadowDistance)) |
|||
tierIndex = _shadowDistanceTierList.FindIndex(o => o.Distance == _uRPAsset.shadowDistance); |
|||
else |
|||
{ |
|||
Debug.LogError("Current shadow distance is not in the tier List " + _uRPAsset.shadowDistance); |
|||
} |
|||
return tierIndex; |
|||
|
|||
} |
|||
void NextShadowDistanceTier() |
|||
{ |
|||
_currentShadowDistanceTier++; |
|||
_currentShadowDistanceTier = Mathf.Clamp(_currentShadowDistanceTier, 0, _shadowDistanceTierList.Count); |
|||
OnShadowDistanceChange(); |
|||
} |
|||
void PreviousShadowDistanceTier() |
|||
{ |
|||
_currentShadowDistanceTier--; |
|||
_currentShadowDistanceTier = Mathf.Clamp(_currentShadowDistanceTier, 0, _shadowDistanceTierList.Count); |
|||
OnShadowDistanceChange(); |
|||
} |
|||
|
|||
void OnShadowDistanceChange() |
|||
{ |
|||
_uRPAsset.shadowDistance = _shadowDistanceTierList[_currentShadowDistanceTier].Distance; |
|||
SetShadowDistance(); |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region fullscreen
|
|||
void SetFullscreen() |
|||
{ |
|||
if (_isFullscreen) |
|||
{ |
|||
_fullscreenField.FillSettingField_Localized(2, 1, "On"); |
|||
} |
|||
else |
|||
{ |
|||
_fullscreenField.FillSettingField_Localized(2, 0, "Off"); |
|||
} |
|||
|
|||
} |
|||
bool GetCurrentFullscreenState() |
|||
{ |
|||
return Screen.fullScreen; |
|||
} |
|||
void NextFullscreenState() |
|||
{ |
|||
_isFullscreen = true; |
|||
OnFullscreenChange(); |
|||
} |
|||
void PreviousFullscreenState() |
|||
{ |
|||
_isFullscreen = false; |
|||
OnFullscreenChange(); |
|||
} |
|||
void OnFullscreenChange() |
|||
{ |
|||
Screen.fullScreen = _isFullscreen; |
|||
SetFullscreen(); |
|||
} |
|||
#endregion
|
|||
|
|||
#region Anti Aliasing
|
|||
void SetAntiAliasingField() |
|||
{ |
|||
string optionDisplay = _currentAntiAliasingList[_currentAntiAliasingIndex].Replace("_", ""); |
|||
_antiAliasingField.FillSettingField(_currentAntiAliasingList.Count, _currentAntiAliasingIndex, optionDisplay); |
|||
|
|||
} |
|||
int GetCurrentAntialiasing() |
|||
{ |
|||
return _uRPAsset.msaaSampleCount; |
|||
|
|||
} |
|||
void NextAntiAliasingTier() |
|||
{ |
|||
_currentAntiAliasingIndex++; |
|||
_currentAntiAliasingIndex = Mathf.Clamp(_currentAntiAliasingIndex, 0, _currentAntiAliasingList.Count - 1); |
|||
OnAntiAliasingChange(); |
|||
} |
|||
void PreviousAntiAliasingTier() |
|||
{ |
|||
_currentAntiAliasingIndex--; |
|||
_currentAntiAliasingIndex = Mathf.Clamp(_currentAntiAliasingIndex, 0, _currentAntiAliasingList.Count - 1); |
|||
OnAntiAliasingChange(); |
|||
} |
|||
|
|||
void OnAntiAliasingChange() |
|||
{ |
|||
_uRPAsset.msaaSampleCount = _currentAntiAliasingIndex; |
|||
SetAntiAliasingField(); |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
private List<string> GetDropdownData(string[] optionNames, params string[] customOptions) |
|||
{ |
|||
List<string> options = new List<string>(); |
|||
foreach (string option in optionNames) |
|||
{ |
|||
options.Add(option); |
|||
} |
|||
|
|||
foreach (string option in customOptions) |
|||
{ |
|||
options.Add(option); |
|||
} |
|||
return options; |
|||
} |
|||
|
|||
public void SaveSettings() |
|||
{ |
|||
|
|||
_savedResolutionIndex = _currentResolutionIndex; |
|||
_savedAntiAliasingIndex = _currentAntiAliasingIndex; |
|||
_savedShadowDistanceTier = _currentShadowDistanceTier; |
|||
_savedFullscreenState = _isFullscreen; |
|||
float shadowDistance = _shadowDistanceTierList[_currentShadowDistanceTier].Distance; |
|||
_save.Invoke(_currentResolutionIndex, _currentAntiAliasingIndex, shadowDistance, _isFullscreen); |
|||
} |
|||
public void ResetSettings() |
|||
{ |
|||
_currentResolutionIndex = _savedResolutionIndex; |
|||
OnResolutionChange(); |
|||
_currentAntiAliasingIndex = _savedAntiAliasingIndex; |
|||
OnAntiAliasingChange(); |
|||
_currentShadowDistanceTier = _savedShadowDistanceTier; |
|||
OnShadowDistanceChange(); |
|||
_isFullscreen = _savedFullscreenState; |
|||
OnFullscreenChange(); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEngine.Serialization; |
|||
public class UISetButtonNavigation : MonoBehaviour |
|||
{ |
|||
[FormerlySerializedAs("genericButtons")] |
|||
UIGenericButton[] _genericButtons = default; |
|||
[FormerlySerializedAs("listSettingItems")] |
|||
UISettingItemFiller[] _listSettingItems = default; |
|||
private void OnEnable() |
|||
{ |
|||
if (_listSettingItems == null) |
|||
{ |
|||
_listSettingItems = GetComponentsInChildren<UISettingItemFiller>(); |
|||
} |
|||
if (_listSettingItems.Length > 0) |
|||
if (_listSettingItems[0].GetComponent<MultiInputButton>() != null) |
|||
//select first item
|
|||
_listSettingItems[0].GetComponent<MultiInputButton>().Select(); |
|||
} |
|||
private void Start() |
|||
{ |
|||
_listSettingItems = GetComponentsInChildren<UISettingItemFiller>(); |
|||
_genericButtons = GetComponentsInChildren<UIGenericButton>(); |
|||
MultiInputButton buttonToSelectOnDown = default; |
|||
MultiInputButton buttonToSelectOnUp = default; |
|||
for (int i = 0; i < _listSettingItems.Length; i++) |
|||
{ |
|||
Navigation newNavigation = new Navigation(); |
|||
|
|||
newNavigation.mode = Navigation.Mode.Explicit; |
|||
|
|||
newNavigation.selectOnLeft = _listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation.selectOnLeft; |
|||
newNavigation.selectOnRight = _listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation.selectOnRight; |
|||
|
|||
if (i + 1 < _listSettingItems.Length) |
|||
{ |
|||
buttonToSelectOnDown = _listSettingItems[i + 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
} |
|||
else if (_genericButtons.Length > 0) |
|||
{ |
|||
|
|||
buttonToSelectOnDown = _genericButtons[0].gameObject.GetComponent<MultiInputButton>(); |
|||
SetGenericButtonsNavigations(_listSettingItems[i].gameObject.GetComponent<MultiInputButton>()); |
|||
} |
|||
|
|||
if (i - 1 >= 0) |
|||
buttonToSelectOnUp = _listSettingItems[i - 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
newNavigation.selectOnDown = buttonToSelectOnDown; |
|||
newNavigation.selectOnUp = buttonToSelectOnUp; |
|||
_listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation = newNavigation; |
|||
_listSettingItems[i].SetNavigation(buttonToSelectOnDown, buttonToSelectOnUp); |
|||
} |
|||
} |
|||
void SetGenericButtonsNavigations(MultiInputButton itemUp) |
|||
{ |
|||
for (int i = 0; i < _genericButtons.Length; i++) |
|||
{ |
|||
Navigation newNavigation = new Navigation(); |
|||
newNavigation.mode = Navigation.Mode.Explicit; |
|||
if (i + 1 < _genericButtons.Length) |
|||
newNavigation.selectOnRight = _genericButtons[i + 1].gameObject.GetComponent<MultiInputButton>(); |
|||
if (i - 1 > 0) |
|||
newNavigation.selectOnLeft = _genericButtons[i - 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
newNavigation.selectOnUp = itemUp; |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
} |
1001
UOP1_Project/Assets/Shaders/AggroEffect.shadergraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: e0d01c7bcc3c25b49ad2154d0f695ef5 |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &3252307297337961723 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 6160154980344531226} |
|||
- component: {fileID: 5838050402550013783} |
|||
- component: {fileID: 3154276167561949981} |
|||
- component: {fileID: 7512214850402593519} |
|||
m_Layer: 9 |
|||
m_Name: Heart (5) |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &6160154980344531226 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
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: |
|||
- {fileID: 7302444323654689616} |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 0, y: 0} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &5838050402550013783 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &3154276167561949981 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
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: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: f7832212859f3334bb51bc203948aeb0, type: 3} |
|||
m_Type: 0 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 4 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|||
--- !u!114 &7512214850402593519 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 3252307297337961723} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: a540d4fc4c843414499eef42aa822b81, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
SlidingImage: {fileID: 6606407167209840454} |
|||
--- !u!1 &5861475152475693651 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 7302444323654689616} |
|||
- component: {fileID: 8330133716670309808} |
|||
- component: {fileID: 6606407167209840454} |
|||
m_Layer: 9 |
|||
m_Name: Heart (5) |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!224 &7302444323654689616 |
|||
RectTransform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
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: 6160154980344531226} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
m_AnchorMin: {x: 0, y: 0} |
|||
m_AnchorMax: {x: 1, y: 1} |
|||
m_AnchoredPosition: {x: 0, y: 0} |
|||
m_SizeDelta: {x: 0, y: 0} |
|||
m_Pivot: {x: 0.5, y: 0.5} |
|||
--- !u!222 &8330133716670309808 |
|||
CanvasRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
m_CullTransparentMesh: 1 |
|||
--- !u!114 &6606407167209840454 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 5861475152475693651} |
|||
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: 1, g: 1, b: 1, a: 1} |
|||
m_RaycastTarget: 1 |
|||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} |
|||
m_Maskable: 1 |
|||
m_OnCullStateChanged: |
|||
m_PersistentCalls: |
|||
m_Calls: [] |
|||
m_Sprite: {fileID: 21300000, guid: 3fd36e940da953743b7164a5d8298a60, type: 3} |
|||
m_Type: 3 |
|||
m_PreserveAspect: 1 |
|||
m_FillCenter: 1 |
|||
m_FillMethod: 0 |
|||
m_FillAmount: 1 |
|||
m_FillClockwise: 1 |
|||
m_FillOrigin: 0 |
|||
m_UseSpriteMesh: 0 |
|||
m_PixelsPerUnitMultiplier: 1 |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using TMPro; |
|||
using UnityEngine; |
|||
using UnityEngine.Events; |
|||
using UnityEngine.Rendering.Universal; |
|||
|
|||
[System.Serializable] |
|||
public class ShadowDistanceTier |
|||
{ |
|||
public float Distance; |
|||
public string TierDescription; |
|||
} |
|||
|
|||
public class SettingsGraphicsComponent : MonoBehaviour |
|||
{ |
|||
[SerializeField] private List<ShadowDistanceTier> ShadowDistanceTierList = new List<ShadowDistanceTier>(); // filled from inspector
|
|||
|
|||
[SerializeField] private UniversalRenderPipelineAsset URPAsset = default; |
|||
|
|||
private int _savedResolutionIndex = default; |
|||
private int _savedAntiAliasingIndex = default; |
|||
private int _savedShadowDistanceTier = default; |
|||
private bool _savedFullscreenState = default; |
|||
|
|||
private int _currentResolutionIndex = default; |
|||
private List<Resolution> _resolutionsList = default; |
|||
[SerializeField] UISettingItemFiller _resolutionsField = default; |
|||
|
|||
/* private int _currentShadowQualityIndex = default; |
|||
private List<string> _shadowQualityList = default; |
|||
[SerializeField] private UISettingItemFiller _shadowQualityField = default;*/ |
|||
|
|||
private int _currentAntiAliasingIndex = default; |
|||
private List<string> _currentAntiAliasingList = default; |
|||
[SerializeField] private UISettingItemFiller _antiAliasingField = default; |
|||
|
|||
private int _currentShadowDistanceTier = default; |
|||
[SerializeField] private UISettingItemFiller _shadowDistanceField = default; |
|||
private bool _isFullscreen = default; |
|||
|
|||
[SerializeField] private UISettingItemFiller _fullscreenField = default; |
|||
|
|||
public event UnityAction<int, int, float, bool> _save = delegate { }; |
|||
|
|||
private Resolution _currentResolution; |
|||
|
|||
[SerializeField] private UIGenericButton _saveButton; |
|||
[SerializeField] private UIGenericButton _resetButton; |
|||
|
|||
void OnEnable() |
|||
{ |
|||
_resolutionsField._nextOption += NextResolution; |
|||
_resolutionsField._previousOption += PreviousResolution; |
|||
|
|||
_shadowDistanceField._nextOption += NextShadowDistanceTier; |
|||
_shadowDistanceField._previousOption += PreviousShadowDistanceTier; |
|||
|
|||
_fullscreenField._nextOption += NextFullscreenState; |
|||
_fullscreenField._previousOption += PreviousFullscreenState; |
|||
|
|||
_antiAliasingField._nextOption += NextAntiAliasingTier; |
|||
_antiAliasingField._previousOption += PreviousAntiAliasingTier; |
|||
|
|||
_saveButton.Clicked += SaveSettings; |
|||
_resetButton.Clicked += ResetSettings; |
|||
|
|||
} |
|||
private void OnDisable() |
|||
{ |
|||
ResetSettings(); |
|||
_resolutionsField._nextOption -= NextResolution; |
|||
_resolutionsField._previousOption -= PreviousResolution; |
|||
|
|||
_shadowDistanceField._nextOption -= NextShadowDistanceTier; |
|||
_shadowDistanceField._previousOption -= PreviousShadowDistanceTier; |
|||
|
|||
_fullscreenField._nextOption -= NextFullscreenState; |
|||
_fullscreenField._previousOption -= PreviousFullscreenState; |
|||
|
|||
_antiAliasingField._nextOption -= NextAntiAliasingTier; |
|||
_antiAliasingField._previousOption -= PreviousAntiAliasingTier; |
|||
|
|||
_saveButton.Clicked -= SaveSettings; |
|||
_resetButton.Clicked -= ResetSettings; |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
public void Init() |
|||
{ |
|||
_resolutionsList = GetResolutionsList(); |
|||
_currentShadowDistanceTier = GetCurrentShadowDistanceTier(); |
|||
_currentAntiAliasingList = GetDropdownData(Enum.GetNames(typeof(MsaaQuality))); |
|||
|
|||
_currentResolution = Screen.currentResolution; |
|||
_currentResolutionIndex = GetCurrentResolutionIndex(); |
|||
_isFullscreen = GetCurrentFullscreenState(); |
|||
_currentAntiAliasingIndex = GetCurrentAntialiasing(); |
|||
|
|||
_savedResolutionIndex = _currentResolutionIndex; |
|||
_savedAntiAliasingIndex = _currentAntiAliasingIndex; |
|||
_savedShadowDistanceTier = _currentShadowDistanceTier; |
|||
_savedFullscreenState = _isFullscreen; |
|||
} |
|||
public void Setup() |
|||
{ |
|||
Init(); |
|||
SetResolutionField(); |
|||
SetShadowDistance(); |
|||
SetFullscreen(); |
|||
SetAntiAliasingField(); |
|||
} |
|||
|
|||
#region Resolution
|
|||
void SetResolutionField() |
|||
{ |
|||
string displayText = _resolutionsList[_currentResolutionIndex].ToString(); |
|||
displayText = displayText.Substring(0, displayText.IndexOf("@")); |
|||
|
|||
_resolutionsField.FillSettingField(_resolutionsList.Count, _currentResolutionIndex, displayText); |
|||
|
|||
} |
|||
List<Resolution> GetResolutionsList() |
|||
{ |
|||
List<Resolution> options = new List<Resolution>(); |
|||
for (int i = 0; i < Screen.resolutions.Length; i++) |
|||
{ |
|||
options.Add(Screen.resolutions[i]); |
|||
} |
|||
|
|||
return options; |
|||
} |
|||
int GetCurrentResolutionIndex() |
|||
{ |
|||
if (_resolutionsList == null) |
|||
{ _resolutionsList = GetResolutionsList(); } |
|||
int index = _resolutionsList.FindIndex(o => o.width == _currentResolution.width && o.height == _currentResolution.height); |
|||
return index; |
|||
} |
|||
void NextResolution() |
|||
{ |
|||
_currentResolutionIndex++; |
|||
_currentResolutionIndex = Mathf.Clamp(_currentResolutionIndex, 0, _resolutionsList.Count - 1); |
|||
OnResolutionChange(); |
|||
} |
|||
void PreviousResolution() |
|||
{ |
|||
_currentResolutionIndex--; |
|||
_currentResolutionIndex = Mathf.Clamp(_currentResolutionIndex, 0, _resolutionsList.Count - 1); |
|||
OnResolutionChange(); |
|||
} |
|||
void OnResolutionChange() |
|||
{ |
|||
_currentResolution = _resolutionsList[_currentResolutionIndex]; |
|||
Screen.SetResolution(_currentResolution.width, _currentResolution.height, _isFullscreen); |
|||
SetResolutionField(); |
|||
} |
|||
#endregion
|
|||
|
|||
#region ShadowDistance
|
|||
void SetShadowDistance() |
|||
{ |
|||
_shadowDistanceField.FillSettingField_Localized(ShadowDistanceTierList.Count, _currentShadowDistanceTier, ShadowDistanceTierList[_currentShadowDistanceTier].TierDescription); |
|||
} |
|||
int GetCurrentShadowDistanceTier() |
|||
{ |
|||
int tierIndex = -1; |
|||
if (ShadowDistanceTierList.Exists(o => o.Distance == URPAsset.shadowDistance)) |
|||
tierIndex = ShadowDistanceTierList.FindIndex(o => o.Distance == URPAsset.shadowDistance); |
|||
else |
|||
{ |
|||
Debug.LogError("Current shadow distance is not in the tier List " + URPAsset.shadowDistance); |
|||
} |
|||
return tierIndex; |
|||
|
|||
} |
|||
void NextShadowDistanceTier() |
|||
{ |
|||
_currentShadowDistanceTier++; |
|||
_currentShadowDistanceTier = Mathf.Clamp(_currentShadowDistanceTier, 0, ShadowDistanceTierList.Count); |
|||
OnShadowDistanceChange(); |
|||
} |
|||
void PreviousShadowDistanceTier() |
|||
{ |
|||
_currentShadowDistanceTier--; |
|||
_currentShadowDistanceTier = Mathf.Clamp(_currentShadowDistanceTier, 0, ShadowDistanceTierList.Count); |
|||
OnShadowDistanceChange(); |
|||
} |
|||
|
|||
void OnShadowDistanceChange() |
|||
{ |
|||
URPAsset.shadowDistance = ShadowDistanceTierList[_currentShadowDistanceTier].Distance; |
|||
SetShadowDistance(); |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region fullscreen
|
|||
void SetFullscreen() |
|||
{ |
|||
if (_isFullscreen) |
|||
{ |
|||
_fullscreenField.FillSettingField_Localized(2, 1, "On"); |
|||
} |
|||
else |
|||
{ |
|||
_fullscreenField.FillSettingField_Localized(2, 0, "Off"); |
|||
} |
|||
|
|||
} |
|||
bool GetCurrentFullscreenState() |
|||
{ |
|||
return Screen.fullScreen; |
|||
} |
|||
void NextFullscreenState() |
|||
{ |
|||
_isFullscreen = true; |
|||
OnFullscreenChange(); |
|||
} |
|||
void PreviousFullscreenState() |
|||
{ |
|||
_isFullscreen = false; |
|||
OnFullscreenChange(); |
|||
} |
|||
void OnFullscreenChange() |
|||
{ |
|||
Screen.fullScreen = _isFullscreen; |
|||
SetFullscreen(); |
|||
} |
|||
#endregion
|
|||
|
|||
#region Anti Aliasing
|
|||
void SetAntiAliasingField() |
|||
{ |
|||
string optionDisplay = _currentAntiAliasingList[_currentAntiAliasingIndex].Replace("_", ""); |
|||
_antiAliasingField.FillSettingField(_currentAntiAliasingList.Count, _currentAntiAliasingIndex, optionDisplay); |
|||
|
|||
} |
|||
int GetCurrentAntialiasing() |
|||
{ |
|||
return URPAsset.msaaSampleCount; |
|||
|
|||
} |
|||
void NextAntiAliasingTier() |
|||
{ |
|||
_currentAntiAliasingIndex++; |
|||
_currentAntiAliasingIndex = Mathf.Clamp(_currentAntiAliasingIndex, 0, _currentAntiAliasingList.Count - 1); |
|||
OnAntiAliasingChange(); |
|||
} |
|||
void PreviousAntiAliasingTier() |
|||
{ |
|||
_currentAntiAliasingIndex--; |
|||
_currentAntiAliasingIndex = Mathf.Clamp(_currentAntiAliasingIndex, 0, _currentAntiAliasingList.Count - 1); |
|||
OnAntiAliasingChange(); |
|||
} |
|||
|
|||
void OnAntiAliasingChange() |
|||
{ |
|||
URPAsset.msaaSampleCount = _currentAntiAliasingIndex; |
|||
SetAntiAliasingField(); |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
private List<string> GetDropdownData(string[] optionNames, params string[] customOptions) |
|||
{ |
|||
List<string> options = new List<string>(); |
|||
foreach (string option in optionNames) |
|||
{ |
|||
options.Add(option); |
|||
} |
|||
|
|||
foreach (string option in customOptions) |
|||
{ |
|||
options.Add(option); |
|||
} |
|||
return options; |
|||
} |
|||
|
|||
public void SaveSettings() |
|||
{ |
|||
|
|||
_savedResolutionIndex = _currentResolutionIndex; |
|||
_savedAntiAliasingIndex = _currentAntiAliasingIndex; |
|||
_savedShadowDistanceTier = _currentShadowDistanceTier; |
|||
_savedFullscreenState = _isFullscreen; |
|||
float shadowDistance = ShadowDistanceTierList[_currentShadowDistanceTier].Distance; |
|||
_save.Invoke(_currentResolutionIndex, _currentAntiAliasingIndex, shadowDistance, _isFullscreen); |
|||
} |
|||
public void ResetSettings() |
|||
{ |
|||
_currentResolutionIndex = _savedResolutionIndex; |
|||
OnResolutionChange(); |
|||
_currentAntiAliasingIndex = _savedAntiAliasingIndex; |
|||
OnAntiAliasingChange(); |
|||
_currentShadowDistanceTier = _savedShadowDistanceTier; |
|||
OnShadowDistanceChange(); |
|||
_isFullscreen = _savedFullscreenState; |
|||
OnFullscreenChange(); |
|||
} |
|||
|
|||
|
|||
/* |
|||
#region ShadowQuality
|
|||
void SetShadowQualityField() |
|||
{ |
|||
_currentShadowQualityIndex = GetCurrentShadowQualityIndex(); |
|||
_shadowQualityList = GetDropdownData(Enum.GetNames(typeof(UnityEngine.Rendering.Universal.ShadowQuality))); |
|||
_shadowQualityField.FillSettingField_Localized(_shadowQualityList.Count, _currentShadowQualityIndex, _shadowQualityList[_currentShadowQualityIndex]); |
|||
|
|||
} |
|||
int GetCurrentShadowQualityIndex() |
|||
{ |
|||
UnityEngine.Rendering.Universal.ShadowQuality shadowQuality = UnityEngine.Rendering.Universal.ShadowQuality.Disabled; |
|||
if (URPAsset.supportsMainLightShadows && URPAsset.supportsSoftShadows) |
|||
{ |
|||
shadowQuality = UnityEngine.Rendering.Universal.ShadowQuality.SoftShadows; |
|||
|
|||
} |
|||
else if (URPAsset.supportsMainLightShadows) |
|||
{ |
|||
shadowQuality = UnityEngine.Rendering.Universal.ShadowQuality.HardShadows; |
|||
} |
|||
else |
|||
{ |
|||
shadowQuality = UnityEngine.Rendering.Universal.ShadowQuality.Disabled; |
|||
} |
|||
return (int)shadowQuality; |
|||
} |
|||
void SetNextShadowQuality() |
|||
{ |
|||
_currentShadowQualityIndex++; |
|||
_currentShadowQualityIndex = Mathf.Clamp(_currentShadowQualityIndex, 0, _shadowQualityList.Count - 1); |
|||
OnShadowQualityChange(); |
|||
} |
|||
void SetPreviousShadowQuality() |
|||
{ |
|||
_currentShadowQualityIndex--; |
|||
_currentShadowQualityIndex = Mathf.Clamp(_currentShadowQualityIndex, 0, _shadowQualityList.Count - 1); |
|||
OnShadowQualityChange(); |
|||
} |
|||
void OnShadowQualityChange() |
|||
{ |
|||
UnityEngine.Rendering.Universal.ShadowQuality shadowQuality = (UnityEngine.Rendering.Universal.ShadowQuality)_currentShadowQualityIndex; |
|||
|
|||
switch (shadowQuality) |
|||
{ |
|||
|
|||
case UnityEngine.Rendering.Universal.ShadowQuality.SoftShadows: |
|||
URPAsset.shadow = true; |
|||
URPAsset.supportsSoftShadows = true; |
|||
break; |
|||
|
|||
case UnityEngine.Rendering.Universal.ShadowQuality.HardShadows: |
|||
URPAsset.supportsMainLightShadows = true; |
|||
URPAsset.supportsSoftShadows = false; |
|||
break; |
|||
case UnityEngine.Rendering.Universal.ShadowQuality.Disabled: |
|||
URPAsset.supportsMainLightShadows = false; |
|||
URPAsset.supportsSoftShadows = false; |
|||
break; |
|||
} |
|||
SetShadowQualityField(); |
|||
} |
|||
|
|||
#endregion
|
|||
*/ |
|||
|
|||
|
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
public class SetButtonNavigation : MonoBehaviour |
|||
{ |
|||
UIGenericButton[] genericButtons; |
|||
UISettingItemFiller[] listSettingItems; |
|||
private void Start() |
|||
{ |
|||
listSettingItems = GetComponentsInChildren<UISettingItemFiller>(); |
|||
|
|||
genericButtons = GetComponentsInChildren<UIGenericButton>(); |
|||
MultiInputButton buttonToSelectOnDown = default; |
|||
MultiInputButton buttonToSelectOnUp = default; |
|||
for (int i = 0; i < listSettingItems.Length; i++) |
|||
{ |
|||
Navigation newNavigation = new Navigation(); |
|||
|
|||
newNavigation.mode = Navigation.Mode.Explicit; |
|||
|
|||
newNavigation.selectOnLeft = listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation.selectOnLeft; |
|||
newNavigation.selectOnRight = listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation.selectOnRight; |
|||
|
|||
if (i + 1 < listSettingItems.Length) |
|||
{ |
|||
buttonToSelectOnDown = listSettingItems[i + 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
} |
|||
else if (genericButtons.Length > 0) |
|||
{ |
|||
|
|||
buttonToSelectOnDown = genericButtons[0].gameObject.GetComponent<MultiInputButton>(); |
|||
SetGenericButtonsNavigations(listSettingItems[i].gameObject.GetComponent<MultiInputButton>()); |
|||
} |
|||
|
|||
if (i - 1 >= 0) |
|||
buttonToSelectOnUp = listSettingItems[i - 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
newNavigation.selectOnDown = buttonToSelectOnDown; |
|||
newNavigation.selectOnUp = buttonToSelectOnUp; |
|||
listSettingItems[i].gameObject.GetComponent<MultiInputButton>().navigation = newNavigation; |
|||
listSettingItems[i].SetNavigation(buttonToSelectOnDown, buttonToSelectOnUp); |
|||
} |
|||
} |
|||
private void OnEnable() |
|||
{ |
|||
if (listSettingItems == null) |
|||
{ |
|||
listSettingItems = GetComponentsInChildren<UISettingItemFiller>(); |
|||
} |
|||
if (listSettingItems.Length > 0) |
|||
if (listSettingItems[0].GetComponent<MultiInputButton>() != null) |
|||
//select first item
|
|||
listSettingItems[0].GetComponent<MultiInputButton>().Select(); |
|||
} |
|||
void SetGenericButtonsNavigations(MultiInputButton itemUp) |
|||
{ |
|||
for (int i = 0; i < genericButtons.Length; i++) |
|||
{ |
|||
Navigation newNavigation = new Navigation(); |
|||
newNavigation.mode = Navigation.Mode.Explicit; |
|||
if (i + 1 < genericButtons.Length) |
|||
newNavigation.selectOnRight = genericButtons[i + 1].gameObject.GetComponent<MultiInputButton>(); |
|||
if (i - 1 > 0) |
|||
newNavigation.selectOnLeft = genericButtons[i - 1].gameObject.GetComponent<MultiInputButton>(); |
|||
|
|||
newNavigation.selectOnUp = itemUp; |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
} |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue