diff --git a/.gitignore b/.gitignore index b658f5e..7cc5f27 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /virtuanessrc097-master /AxibugEmuOnline.Server/config.cfg /AxibugEmuOnline.Server/bin/ +/AxibugEmuOnline.Client/.editorconfig diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Coffee/UIExtensions/UIEffect/Materials/UI-Effect.mat b/AxibugEmuOnline.Client/Assets/Plugins/Coffee/UIExtensions/UIEffect/Materials/UI-Effect.mat index f6fe4b8..3c3817e 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Coffee/UIExtensions/UIEffect/Materials/UI-Effect.mat +++ b/AxibugEmuOnline.Client/Assets/Plugins/Coffee/UIExtensions/UIEffect/Materials/UI-Effect.mat @@ -2,20 +2,24 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &-7922399114787830828 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-MediumBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -27,6 +31,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -38,22 +43,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &-2858933974303803426 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-FastBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -65,6 +75,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -76,22 +87,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &2100000 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 8 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -103,6 +119,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -114,22 +131,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21011258686512032 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -141,6 +163,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -152,22 +175,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21026428964303540 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -179,6 +207,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -190,22 +219,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21027069994720160 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -217,6 +251,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -228,22 +263,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21039963853110620 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -255,6 +295,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -266,22 +307,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21051553669005610 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -293,6 +339,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -304,22 +351,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21052465468044756 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -331,6 +383,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -342,22 +395,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21066333305903936 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -369,6 +427,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -380,22 +439,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21075981732791042 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -407,6 +471,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -418,22 +483,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21088090490190524 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -441,6 +511,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -452,22 +523,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21101263305935548 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -475,6 +551,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -486,22 +563,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21104109730402914 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -509,6 +591,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -520,22 +603,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21105261449943414 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -543,6 +631,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -554,22 +643,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21109508837310648 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -577,6 +671,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -588,22 +683,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21111652731778514 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -611,6 +711,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -622,22 +723,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21116803245207008 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -645,6 +751,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -656,22 +763,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21122981926976530 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -683,6 +795,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -694,22 +807,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21123846122543778 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -717,6 +835,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -728,22 +847,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21131018956888464 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -755,6 +879,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -766,22 +891,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21137937571243814 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -789,6 +919,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -800,22 +931,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21145977231806290 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -823,6 +959,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -834,22 +971,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21149323267498812 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -857,6 +999,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -868,22 +1011,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21166942708938158 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -891,6 +1039,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -902,22 +1051,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21175420890653266 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -925,6 +1079,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -936,22 +1091,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21185002339311568 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -963,6 +1123,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -974,22 +1135,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21186453925202086 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -997,6 +1163,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1008,22 +1175,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21192233312017768 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1035,6 +1207,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1046,22 +1219,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21197897579119900 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1069,6 +1247,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1080,22 +1259,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21199877168527062 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1103,6 +1287,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1114,22 +1299,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21212477583257292 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1137,6 +1327,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1148,22 +1339,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21232036731743694 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1171,6 +1367,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1182,22 +1379,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21240296032697190 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1205,6 +1407,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1216,22 +1419,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21255923207793296 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1239,6 +1447,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1250,22 +1459,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21258387908413332 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1273,6 +1487,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1284,22 +1499,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21271924954905420 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1311,6 +1531,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1322,22 +1543,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21293088704516238 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1345,6 +1571,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1356,22 +1583,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21302104002556128 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1379,6 +1611,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1390,22 +1623,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21303963782861626 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1413,6 +1651,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1424,22 +1663,30 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21305736874167728 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: DETAILBLUR EX FILL + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - DETAILBLUR + - EX + - FILL + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1451,6 +1698,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1462,22 +1710,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21306681885004364 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1485,6 +1738,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1496,22 +1750,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21320668284859588 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1519,6 +1778,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1530,22 +1790,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21330216548013380 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1553,6 +1818,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1564,22 +1830,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21336195750137204 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1591,6 +1862,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1602,22 +1874,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21348001306660082 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1625,6 +1902,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1636,22 +1914,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21348190401746968 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1659,6 +1942,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1670,22 +1954,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21359290647485348 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1693,6 +1982,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1704,22 +1994,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21361395707633912 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1727,6 +2022,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1738,22 +2034,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21364950658099354 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1761,6 +2062,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1772,22 +2074,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21378012982496048 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1795,6 +2102,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1806,22 +2114,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21378149258337820 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1829,6 +2142,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1840,22 +2154,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21380371216467826 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1863,6 +2182,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1874,22 +2194,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21380512493198096 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1897,6 +2222,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1908,22 +2234,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21405390060167114 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1935,6 +2266,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1946,22 +2278,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21409008212681998 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -1969,6 +2306,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -1980,22 +2318,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21415477525834930 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2003,6 +2346,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2014,22 +2358,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21430195719184000 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2037,6 +2386,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2048,22 +2398,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21437925998559310 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2071,6 +2426,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2082,22 +2438,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21440092419426906 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2105,6 +2466,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2116,22 +2478,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21444967751105098 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2139,6 +2506,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2150,22 +2518,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21448049851552048 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-MediumBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2177,6 +2550,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2188,22 +2562,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21450770079124654 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2215,6 +2594,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2226,22 +2606,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21453664544427490 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2249,6 +2634,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2260,22 +2646,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21467518254157304 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2287,6 +2678,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2298,22 +2690,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21471923136759810 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2321,6 +2718,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2332,22 +2730,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21481346700311234 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2359,6 +2762,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2370,22 +2774,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21510007115466990 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Add-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2397,6 +2806,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2408,22 +2818,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21512057394810148 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2435,6 +2850,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2446,22 +2862,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21512499159998750 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2469,6 +2890,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2480,22 +2902,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21532343593189452 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2503,6 +2930,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2514,22 +2942,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21533667629458412 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2541,6 +2974,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2552,22 +2986,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21541535114347366 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2579,6 +3018,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2590,22 +3030,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21542047413524304 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2613,6 +3058,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2624,22 +3070,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21544716102375364 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2647,6 +3098,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2658,22 +3110,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21545629178218474 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2681,6 +3138,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2692,22 +3150,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21560746059913494 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2715,6 +3178,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2726,22 +3190,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21563344409783084 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2753,6 +3222,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2764,22 +3234,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21569565423378676 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2787,6 +3262,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2798,22 +3274,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21576230583202306 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2821,6 +3302,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2832,22 +3314,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21579131057152204 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2855,6 +3342,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2866,22 +3354,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21588405465634874 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2889,6 +3382,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2900,22 +3394,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21597123945508062 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2923,6 +3422,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2934,22 +3434,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21600722614953990 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2957,6 +3462,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -2968,22 +3474,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21605587663562914 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -2991,6 +3502,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3002,22 +3514,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21610745492908456 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Add-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3025,6 +3542,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3036,22 +3554,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21613427633448394 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3059,6 +3582,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3070,22 +3594,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21626828109100462 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3093,6 +3622,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3104,22 +3634,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21635119553697766 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-FastBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3131,6 +3666,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3142,22 +3678,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21639588145429544 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3165,6 +3706,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3176,22 +3718,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21653387824655390 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3203,6 +3750,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3214,22 +3762,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21661642508956528 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3237,6 +3790,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3248,22 +3802,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21661871162831128 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3271,6 +3830,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3282,22 +3842,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21663013170243334 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3305,6 +3870,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3316,22 +3882,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21666358306453470 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3339,6 +3910,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3350,22 +3922,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21668316807213568 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3373,6 +3950,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3384,22 +3962,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21672675497823216 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3407,6 +3990,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3418,22 +4002,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21695855126676214 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3441,6 +4030,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3452,22 +4042,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21696752101198370 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3475,6 +4070,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3486,22 +4082,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21701854708980174 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3509,6 +4110,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3520,22 +4122,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21705644928765800 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3543,6 +4150,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3554,22 +4162,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21706452675254552 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3581,6 +4194,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3592,22 +4206,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21709795224992298 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3619,6 +4238,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3630,22 +4250,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21724091816847400 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3653,6 +4278,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3664,22 +4290,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21732181610132420 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3691,6 +4322,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3702,22 +4334,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21737775158534176 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3725,6 +4362,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3736,22 +4374,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21738761090841570 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3759,6 +4402,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3770,22 +4414,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21745487242921564 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3793,6 +4442,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3804,22 +4454,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21758506112687914 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3831,6 +4486,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3842,22 +4498,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21770831153649604 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3865,6 +4526,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3876,22 +4538,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21774372728878936 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3899,6 +4566,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3910,22 +4578,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21778934727406118 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3937,6 +4610,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3948,22 +4622,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21783431032102164 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -3971,6 +4650,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -3982,22 +4662,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21786341683153736 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4009,6 +4694,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4020,22 +4706,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21788043290438114 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Add-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4043,6 +4734,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4054,22 +4746,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21793963511044070 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4081,6 +4778,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4092,22 +4790,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21795397433206836 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4115,6 +4818,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4126,22 +4830,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21800671795679014 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4149,6 +4858,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4160,22 +4870,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21806928481719972 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Subtract-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4183,6 +4898,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4194,22 +4910,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21812566947609066 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4221,6 +4942,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4232,22 +4954,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21846284721920408 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4255,6 +4982,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4266,22 +4994,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21849905517297320 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4289,6 +5022,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4300,22 +5034,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21856943469927286 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4323,6 +5062,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4334,22 +5074,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21857184430936670 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4361,6 +5106,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4372,22 +5118,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21866767477205256 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Subtract-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4395,6 +5146,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4406,22 +5158,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21875683972062094 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Subtract m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4429,6 +5186,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4440,22 +5198,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21876982461912130 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Fill-FastBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4463,6 +5226,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4474,22 +5238,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21901242579300618 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Mono-Add m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4497,6 +5266,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4508,22 +5278,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21905403339881664 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4535,6 +5310,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4546,22 +5322,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21913035326537372 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4569,6 +5350,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4580,22 +5362,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21919113364331978 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Subtract-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4603,6 +5390,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4614,22 +5402,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21930548911372394 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Pixel-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4637,6 +5430,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4648,22 +5442,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21932619879041906 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Fill m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4671,6 +5470,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4682,22 +5482,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21936983168141514 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Cutoff-Add-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4705,6 +5510,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4716,22 +5522,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21960190213409036 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Hue-Fill-DetailBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4739,6 +5550,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4750,22 +5562,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &21970657036975932 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-MediumBlur m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 5 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4777,6 +5594,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4788,22 +5606,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &3053942024298246613 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Nega-Fill-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4815,6 +5638,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4826,22 +5650,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &6699891064212050928 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Grayscale-Fill-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4853,6 +5682,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4864,22 +5694,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &8212491840734312675 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Sepia-Fill-DetailBlur-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4891,6 +5726,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4902,22 +5738,27 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!21 &8343957003602954640 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 9 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: UI-Effect-Fill-Ex m_Shader: {fileID: 4800000, guid: b868e81d0156245e08c8646b4fb68d7a, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -4929,6 +5770,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _ColorMask: 15 - _Stencil: 0 @@ -4940,3 +5782,4 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab index 712e88c..93e3fe9 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab @@ -1476,7 +1476,7 @@ MonoBehaviour: m_MinHeight: -1 m_PreferredWidth: -1 m_PreferredHeight: -1 - m_FlexibleWidth: 20 + m_FlexibleWidth: 5 m_FlexibleHeight: -1 m_LayoutPriority: 1 --- !u!1 &6998597834321643812 @@ -1612,7 +1612,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} + m_SizeDelta: {x: 20, y: -20} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2285457357903007277 CanvasRenderer: @@ -1642,8 +1642,8 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 0 + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -1936,16 +1936,16 @@ MonoBehaviour: m_Font: {fileID: 12800000, guid: 33a3bdf8f6bd1ec4eba7c4bc58183212, type: 3} m_FontSize: 20 m_FontStyle: 0 - m_BestFit: 0 + m_BestFit: 1 m_MinSize: 2 - m_MaxSize: 40 - m_Alignment: 3 + m_MaxSize: 20 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 99 + m_Text: 0 --- !u!114 &5172613673109503612 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1961,9 +1961,9 @@ MonoBehaviour: m_IgnoreLayout: 0 m_MinWidth: -1 m_MinHeight: -1 - m_PreferredWidth: -1 + m_PreferredWidth: 50 m_PreferredHeight: -1 - m_FlexibleWidth: 1 + m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 --- !u!1 &8884391103430529053 diff --git a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity index d5960d7..22460e5 100644 --- a/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity +++ b/AxibugEmuOnline.Client/Assets/Scene/AxibugEmuOnline.Client.unity @@ -15800,6 +15800,30 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1599240741} m_Modifications: + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 231194784974113132, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 321727879374672331, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -15832,6 +15856,38 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 391878975413806388, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 736530578155193984, guid: 1de15a80c8c1aa94486563740a15d91c, type: 3} propertyPath: m_AnchorMax.x value: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/App.cs.meta b/AxibugEmuOnline.Client/Assets/Script/App.cs.meta index 308de77..2c1bfbd 100644 --- a/AxibugEmuOnline.Client/Assets/Script/App.cs.meta +++ b/AxibugEmuOnline.Client/Assets/Script/App.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 37a06c0960dd38d48a93b9642efa11f6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: d8c50df5df7b4834c84889fbdad9eb9b \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain.meta new file mode 100644 index 0000000..9b24a61 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bad0f9bf28f67de428fed5977006db1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs new file mode 100644 index 0000000..5b3d8af --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs @@ -0,0 +1,180 @@ +using AxibugEmuOnline.Client.Manager; +using AxibugEmuOnline.Client.Network; +using System.Collections; +using System.IO; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.Networking; +using static AxibugEmuOnline.Client.HttpAPI; +using static AxibugEmuOnline.Client.Manager.LogManager; + +namespace AxibugEmuOnline.Client.ClientCore +{ + public static class App + { + public static string TokenStr; + public static string IP; + public static int Port; + public static LogManager log; + public static NetworkHelper network; + public static AppLogin login; + public static AppChat chat; + public static UserDataManager user; + //public static AppNetGame netgame; + public static AppEmu emu; + public static RomLib nesRomLib; + public static HttpAPI httpAPI; + public static CacheManager CacheMgr; + public static AppRoom roomMgr; + public static AppSettings settings; + public static FilterManager filter; + public static AppShare share; + #region Mono + public static TickLoop tickLoop; + private static CoroutineRunner coRunner; + #endregion + +#if UNITY_PSP2 + public static string PersistentDataPath => "ux0:data/AxibugEmu"; +#else + public static string PersistentDataPath => Application.persistentDataPath; +#endif + public static void Init(Initer initer) + { + settings = new AppSettings(); + + log = new LogManager(); + LogManager.OnLog += OnNoSugarNetLog; + network = new NetworkHelper(); + login = new AppLogin(); + chat = new AppChat(); + user = new UserDataManager(); + emu = new AppEmu(); + //netgame = new AppNetGame(); + httpAPI = new HttpAPI(); + nesRomLib = new RomLib(EnumPlatform.NES); + CacheMgr = new CacheManager(); + roomMgr = new AppRoom(); + share = new AppShare(); + filter = new FilterManager(initer.m_filterVolume, initer.m_filterPreview, initer.m_xmbBg); + var go = new GameObject("[AppAxibugEmuOnline]"); + GameObject.DontDestroyOnLoad(go); + tickLoop = go.AddComponent(); + coRunner = go.AddComponent(); + + if (UnityEngine.Application.platform == RuntimePlatform.PSP2) + { + //PSV 等平台需要手动创建目录 + PersistentDataPathDir(); + } + + var importNode = GameObject.Find("IMPORTENT"); + if (importNode != null) GameObject.DontDestroyOnLoad(importNode); + + StartCoroutine(AppTickFlow()); + RePullNetInfo(); + } + + private static void PersistentDataPathDir() + { + if (!Directory.Exists(PersistentDataPath)) + { + Directory.CreateDirectory(PersistentDataPath); + } + } + + private static IEnumerator AppTickFlow() + { + while (true) + { + Tick(); + yield return null; + } + } + + public static void RePullNetInfo() + { + StartCoroutine(StartNetInit()); + } + + static IEnumerator StartNetInit() + { + if (App.network.isConnected) + yield break; + + int platform = 0; + bool bTest = false; + if (bTest) + { + yield return null; + Connect("192.168.0.47", 10492); + yield break; + } + + UnityWebRequest request = UnityWebRequest.Get($"{App.httpAPI.WebSiteApi}/CheckStandInfo?platform={platform}&version={Application.version}"); + yield return request.SendWebRequest(); + + if (request.result != UnityWebRequest.Result.Success) + yield break; + + App.log.Debug($"ApiResp => {request.downloadHandler.text}"); + Resp_CheckStandInfo resp = JsonUtility.FromJson(request.downloadHandler.text); + //需要更新 + if (resp.needUpdateClient == 1) + { + //TODO + } + + yield return null; + //Connect("127.0.0.1", 10492); + Connect(resp.serverIp, resp.serverPort); + } + + private static void Tick() + { + nesRomLib.ExecuteFetchRomInfo(); + } + + public static Coroutine StartCoroutine(IEnumerator itor) + { + return coRunner.StartCoroutine(itor); + } + + public static void StopCoroutine(Coroutine cor) + { + coRunner.StopCoroutine(cor); + } + + public static void Connect(string IP, int port) + { + Task task = new Task(() => + { + network.Init(IP, port); + }); + task.Start(); + } + + public static void Close() + { + App.log.Info("停止"); + } + static void OnNoSugarNetLog(int LogLevel, string msg) + { + E_LogType logType = (E_LogType)LogLevel; + switch (logType) + { + case E_LogType.Debug: + case E_LogType.Info: + Debug.Log("[AxiEmu]:" + msg); + break; + case E_LogType.Warning: + Debug.LogWarning("[AxiEmu]:" + msg); + break; + case E_LogType.Error: + Debug.LogError("[AxiEmu]:" + msg); + break; + } + } + + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs.meta new file mode 100644 index 0000000..308de77 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37a06c0960dd38d48a93b9642efa11f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AxibugEmuOnline.Client.asmdef b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/AxibugEmuOnline.Client.asmdef rename to AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef diff --git a/AxibugEmuOnline.Client/Assets/Script/AxibugEmuOnline.Client.asmdef.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/AxibugEmuOnline.Client.asmdef.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/AxibugEmuOnline.Client.asmdef.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Common.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/Helper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/Helper.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/Helper.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/Helper.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/Helper.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/Helper.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/Helper.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/Helper.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/PC_XBOXKEY.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PC_XBOXKEY.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/PC_XBOXKEY.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PC_XBOXKEY.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/PC_XBOXKEY.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PC_XBOXKEY.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/PC_XBOXKEY.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PC_XBOXKEY.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/PSVitaKey.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PSVitaKey.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/PSVitaKey.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PSVitaKey.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/PSVitaKey.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PSVitaKey.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/PSVitaKey.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/PSVitaKey.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/ProtoBufHelper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/ProtoBufHelper.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/ProtoBufHelper.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/ProtoBufHelper.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Common/ProtoBufHelper.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Common/ProtoBufHelper.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Common/ProtoBufHelper.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Common/ProtoBufHelper.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Event.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EEvent.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EEvent.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EEvent.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event/EEvent.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EEvent.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/EventInvoker.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EventInvoker.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Event/EventInvoker.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EventInvoker.cs index 0aa0194..7f28e47 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Event/EventInvoker.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EventInvoker.cs @@ -1,10 +1,10 @@ -namespace AxibugEmuOnline.Client -{ - public static class EventInvoker - { - public delegate void OnFilterPresetRemovedHandle(FilterManager.Filter filter, FilterManager.FilterPreset removedPreset); - public static event OnFilterPresetRemovedHandle OnFilterPresetRemoved; - public static void RaiseFilterPresetRemoved(FilterManager.Filter filter, FilterManager.FilterPreset removedPreset) - => OnFilterPresetRemoved.Invoke(filter, removedPreset); - } -} +namespace AxibugEmuOnline.Client +{ + public static class EventInvoker + { + public delegate void OnFilterPresetRemovedHandle(FilterManager.Filter filter, FilterManager.FilterPreset removedPreset); + public static event OnFilterPresetRemovedHandle OnFilterPresetRemoved; + public static void RaiseFilterPresetRemoved(FilterManager.Filter filter, FilterManager.FilterPreset removedPreset) + => OnFilterPresetRemoved.Invoke(filter, removedPreset); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/EventInvoker.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EventInvoker.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event/EventInvoker.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/EventInvoker.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/Eventer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/Eventer.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event/Eventer.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/Eventer.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Event/Eventer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Event/Eventer.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Event/Eventer.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Event/Eventer.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FilterEffect.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FilterEffect.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FilterEffect.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FilterEffect.cs index 95d9add..5d97e11 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Filter/FilterEffect.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FilterEffect.cs @@ -1,96 +1,96 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEngine; -using UnityEngine.Rendering.PostProcessing; - -namespace AxibugEmuOnline.Client -{ - public abstract class FilterEffect : PostProcessEffectSettings - { - private List m_editableParamList; - - public IReadOnlyCollection EditableParam => m_editableParamList.AsReadOnly(); - - public abstract string Name { get; } - - public FilterEffect() - { - GetEditableFilterParamters(); - } - protected void GetEditableFilterParamters() - { - var parameters = (from t in GetType().GetFields(BindingFlags.Instance | BindingFlags.Public) - where t.FieldType.IsSubclassOf(typeof(ParameterOverride)) - where t.DeclaringType.IsSubclassOf(typeof(FilterEffect)) - orderby t.MetadataToken - select t); - - m_editableParamList = new List(); - foreach (var param in parameters) - { - var paramObj = (ParameterOverride)param.GetValue(this); - var rangeAtt = param.GetCustomAttribute(); - float min = 0; - float max = 10; - if (rangeAtt != null) - { - min = rangeAtt.min; max = rangeAtt.max; - } - - var editableParam = new EditableParamerter(param.Name, paramObj, min, max); - m_editableParamList.Add(editableParam); - } - } - - public class EditableParamerter - { - private ParameterOverride m_paramObject; - private FieldInfo valueFieldInfo; - - public Type ValueType { get; private set; } - public string Name { get; private set; } - public object Value - { - get => valueFieldInfo.GetValue(m_paramObject); - set - { - valueFieldInfo.SetValue(m_paramObject, value); - m_paramObject.overrideState = true; - } - } - public object MinValue { get; private set; } - public object MaxValue { get; private set; } - - public EditableParamerter(string name, ParameterOverride paramObject, object minValue, object maxValue) - { - m_paramObject = paramObject; - Name = name; - - var paramType = paramObject.GetType(); - - valueFieldInfo = paramType.GetField("value", BindingFlags.Public | BindingFlags.Instance); - if (valueFieldInfo != null) - { - ValueType = valueFieldInfo.FieldType; - } - else - { - ValueType = typeof(object); - } - - MinValue = minValue; - MaxValue = maxValue; - } - - public void ResetToDefault() => m_paramObject.overrideState = false; - - - public void Apply(object overrideValue) - { - Value = overrideValue; - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +namespace AxibugEmuOnline.Client +{ + public abstract class FilterEffect : PostProcessEffectSettings + { + private List m_editableParamList; + + public IReadOnlyCollection EditableParam => m_editableParamList.AsReadOnly(); + + public abstract string Name { get; } + + public FilterEffect() + { + GetEditableFilterParamters(); + } + protected void GetEditableFilterParamters() + { + var parameters = (from t in GetType().GetFields(BindingFlags.Instance | BindingFlags.Public) + where t.FieldType.IsSubclassOf(typeof(ParameterOverride)) + where t.DeclaringType.IsSubclassOf(typeof(FilterEffect)) + orderby t.MetadataToken + select t); + + m_editableParamList = new List(); + foreach (var param in parameters) + { + var paramObj = (ParameterOverride)param.GetValue(this); + var rangeAtt = param.GetCustomAttribute(); + float min = 0; + float max = 10; + if (rangeAtt != null) + { + min = rangeAtt.min; max = rangeAtt.max; + } + + var editableParam = new EditableParamerter(param.Name, paramObj, min, max); + m_editableParamList.Add(editableParam); + } + } + + public class EditableParamerter + { + private ParameterOverride m_paramObject; + private FieldInfo valueFieldInfo; + + public Type ValueType { get; private set; } + public string Name { get; private set; } + public object Value + { + get => valueFieldInfo.GetValue(m_paramObject); + set + { + valueFieldInfo.SetValue(m_paramObject, value); + m_paramObject.overrideState = true; + } + } + public object MinValue { get; private set; } + public object MaxValue { get; private set; } + + public EditableParamerter(string name, ParameterOverride paramObject, object minValue, object maxValue) + { + m_paramObject = paramObject; + Name = name; + + var paramType = paramObject.GetType(); + + valueFieldInfo = paramType.GetField("value", BindingFlags.Public | BindingFlags.Instance); + if (valueFieldInfo != null) + { + ValueType = valueFieldInfo.FieldType; + } + else + { + ValueType = typeof(object); + } + + MinValue = minValue; + MaxValue = maxValue; + } + + public void ResetToDefault() => m_paramObject.overrideState = false; + + + public void Apply(object overrideValue) + { + Value = overrideValue; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FilterEffect.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FilterEffect.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FilterEffect.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FilterEffect.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs index 70bc32a..098722d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs @@ -1,106 +1,106 @@ -using AxibugEmuOnline.Client; -using UnityEngine; -using UnityEngine.Rendering.PostProcessing; - -[System.Serializable] -[PostProcess(typeof(FixingPixelArtGrilleRenderer), PostProcessEvent.BeforeStack, "Filter/FixingPixelArtGrille")] -public sealed class FixingPixelArtGrille : FilterEffect -{ - public override string Name => nameof(FixingPixelArtGrille); - - public ParameterOverride MaskStyle = new ParameterOverride { value = EnumMaskStyle.ApertureGrille }; - - [Tooltip("Emulated input resolution\nOptimize for resize")] - public Vector2Parameter DrawResolution = new Vector2Parameter - { - value = new Vector2(272, 240) - }; - - [Tooltip("Hardness of scanline")] - [Range(-32, 0)] - public FloatParameter HardScan = new FloatParameter { value = -10 }; - - [Tooltip("Hardness of pixels in scanline")] - [Range(-6, 0)] - public FloatParameter HardPix = new FloatParameter { value = -2 }; - - [Tooltip("Hardness of short vertical bloom")] - [Range(-8, 0)] - public FloatParameter HardBloomScan = new FloatParameter { value = -4.0f }; - - [Tooltip("Hardness of short horizontal bloom")] - [Range(-4, 0)] - public FloatParameter HardBloomPix = new FloatParameter { value = -1.5f }; - - [Tooltip("Amount of small bloom effect")] - [Range(0, 1)] - public FloatParameter BloomAmount = new FloatParameter { value = 1 / 16f }; - - [Tooltip("Display warp")] - public Vector2Parameter Warp = new Vector2Parameter { value = new Vector2(1f / 64f, 1f / 24f) }; - - [Tooltip("Amount of shadow mask Light")] - [Range(1, 3)] - public FloatParameter MaskLight = new FloatParameter { value = 1.5f }; - [Range(0.1f, 1)] - [Tooltip("Amount of shadow mask Dark")] - public FloatParameter MaskDrak = new FloatParameter { value = 0.5f }; - - public enum EnumMaskStyle - { - TVStyle, - ApertureGrille, - StretchedVGA, - VGAStyle - } -} - -public sealed class FixingPixelArtGrilleRenderer : PostProcessEffectRenderer -{ - private Shader shader; - private Material material; - - public override void Init() - { - shader = Shader.Find("PostEffect/FixingPixcelArtGrille"); - material = new Material(shader); - } - - public override void Render(PostProcessRenderContext context) - { - material.SetVector("_iResolution", new Vector4(Screen.width, Screen.height, 0, 0)); - var res = settings.DrawResolution; - material.SetVector("_res", new Vector4(res.value.x, res.value.y, 0, 0)); - material.SetFloat("_hardScan", settings.HardScan.value); - material.SetFloat("_hardPix", settings.HardPix.value); - material.SetFloat("_hardBloomScan", settings.HardBloomScan.value); - material.SetFloat("_hardBloomPix", settings.HardBloomPix.value); - material.SetFloat("_bloomAmount", settings.BloomAmount.value); - material.SetVector("_warp", settings.Warp.value); - material.SetFloat("_maskDark", settings.MaskDrak.value); - material.SetFloat("_maskLight", settings.MaskLight.value); - - material.DisableKeyword("_MASKSTYLE_VGASTYLE"); - material.DisableKeyword("_MASKSTYLE_TVSTYLE"); - material.DisableKeyword("_MASKSTYLE_APERTUREGRILLE"); - material.DisableKeyword("_MASKSTYLE_STRETCHEDVGA"); - - switch (settings.MaskStyle.value) - { - case FixingPixelArtGrille.EnumMaskStyle.VGAStyle: - material.EnableKeyword("_MASKSTYLE_VGASTYLE"); - break; - case FixingPixelArtGrille.EnumMaskStyle.TVStyle: - material.EnableKeyword("_MASKSTYLE_TVSTYLE"); - break; - case FixingPixelArtGrille.EnumMaskStyle.ApertureGrille: - material.EnableKeyword("_MASKSTYLE_APERTUREGRILLE"); - break; - case FixingPixelArtGrille.EnumMaskStyle.StretchedVGA: - material.EnableKeyword("_MASKSTYLE_STRETCHEDVGA"); - break; - } - - context.command.Blit(context.source, context.destination, material); - } +using AxibugEmuOnline.Client; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +[System.Serializable] +[PostProcess(typeof(FixingPixelArtGrilleRenderer), PostProcessEvent.BeforeStack, "Filter/FixingPixelArtGrille")] +public sealed class FixingPixelArtGrille : FilterEffect +{ + public override string Name => nameof(FixingPixelArtGrille); + + public ParameterOverride MaskStyle = new ParameterOverride { value = EnumMaskStyle.ApertureGrille }; + + [Tooltip("Emulated input resolution\nOptimize for resize")] + public Vector2Parameter DrawResolution = new Vector2Parameter + { + value = new Vector2(272, 240) + }; + + [Tooltip("Hardness of scanline")] + [Range(-32, 0)] + public FloatParameter HardScan = new FloatParameter { value = -10 }; + + [Tooltip("Hardness of pixels in scanline")] + [Range(-6, 0)] + public FloatParameter HardPix = new FloatParameter { value = -2 }; + + [Tooltip("Hardness of short vertical bloom")] + [Range(-8, 0)] + public FloatParameter HardBloomScan = new FloatParameter { value = -4.0f }; + + [Tooltip("Hardness of short horizontal bloom")] + [Range(-4, 0)] + public FloatParameter HardBloomPix = new FloatParameter { value = -1.5f }; + + [Tooltip("Amount of small bloom effect")] + [Range(0, 1)] + public FloatParameter BloomAmount = new FloatParameter { value = 1 / 16f }; + + [Tooltip("Display warp")] + public Vector2Parameter Warp = new Vector2Parameter { value = new Vector2(1f / 64f, 1f / 24f) }; + + [Tooltip("Amount of shadow mask Light")] + [Range(1, 3)] + public FloatParameter MaskLight = new FloatParameter { value = 1.5f }; + [Range(0.1f, 1)] + [Tooltip("Amount of shadow mask Dark")] + public FloatParameter MaskDrak = new FloatParameter { value = 0.5f }; + + public enum EnumMaskStyle + { + TVStyle, + ApertureGrille, + StretchedVGA, + VGAStyle + } +} + +public sealed class FixingPixelArtGrilleRenderer : PostProcessEffectRenderer +{ + private Shader shader; + private Material material; + + public override void Init() + { + shader = Shader.Find("PostEffect/FixingPixcelArtGrille"); + material = new Material(shader); + } + + public override void Render(PostProcessRenderContext context) + { + material.SetVector("_iResolution", new Vector4(Screen.width, Screen.height, 0, 0)); + var res = settings.DrawResolution; + material.SetVector("_res", new Vector4(res.value.x, res.value.y, 0, 0)); + material.SetFloat("_hardScan", settings.HardScan.value); + material.SetFloat("_hardPix", settings.HardPix.value); + material.SetFloat("_hardBloomScan", settings.HardBloomScan.value); + material.SetFloat("_hardBloomPix", settings.HardBloomPix.value); + material.SetFloat("_bloomAmount", settings.BloomAmount.value); + material.SetVector("_warp", settings.Warp.value); + material.SetFloat("_maskDark", settings.MaskDrak.value); + material.SetFloat("_maskLight", settings.MaskLight.value); + + material.DisableKeyword("_MASKSTYLE_VGASTYLE"); + material.DisableKeyword("_MASKSTYLE_TVSTYLE"); + material.DisableKeyword("_MASKSTYLE_APERTUREGRILLE"); + material.DisableKeyword("_MASKSTYLE_STRETCHEDVGA"); + + switch (settings.MaskStyle.value) + { + case FixingPixelArtGrille.EnumMaskStyle.VGAStyle: + material.EnableKeyword("_MASKSTYLE_VGASTYLE"); + break; + case FixingPixelArtGrille.EnumMaskStyle.TVStyle: + material.EnableKeyword("_MASKSTYLE_TVSTYLE"); + break; + case FixingPixelArtGrille.EnumMaskStyle.ApertureGrille: + material.EnableKeyword("_MASKSTYLE_APERTUREGRILLE"); + break; + case FixingPixelArtGrille.EnumMaskStyle.StretchedVGA: + material.EnableKeyword("_MASKSTYLE_STRETCHEDVGA"); + break; + } + + context.command.Blit(context.source, context.destination, material); + } } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader index cfc2a22..2a3a68d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader @@ -1,293 +1,293 @@ - -Shader "PostEffect/FixingPixcelArtGrille" -{ - Properties - { - _MainTex ("Base (RGB)", 2D) = "white" {} - } - SubShader - { - Pass - { - CGPROGRAM - - #pragma shader_feature_local _MASKSTYLE_TVSTYLE _MASKSTYLE_APERTUREGRILLE _MASKSTYLE_STRETCHEDVGA _MASKSTYLE_VGASTYLE - #pragma vertex vert_img - #pragma fragment frag - #include "UnityCG.cginc" - - sampler2D _MainTex; - float4 _MainTex_TexelSize; - - // - // PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER - // - // by Timothy Lottes - // - // This is more along the style of a really good CGA arcade monitor. - // With RGB inputs instead of NTSC. - // The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. - // - // Left it unoptimized to show the theory behind the algorithm. - // - // It is an example what I personally would want as a display option for pixel art games. - // Please take and use, change, or whatever. - // - - float2 _iResolution = float2(1920,1080); - - // Emulated input resolution. - // Optimize for resize. - float2 _res = float2(272.0,240.0); - - // Hardness of scanline. - // -8.0 = soft - // -16.0 = medium - float _hardScan = -10.0; - - // Hardness of pixels in scanline. - // -2.0 = soft - // -4.0 = hard - float _hardPix =-2.0; - - // Hardness of short vertical bloom. - // -1.0 = wide to the point of clipping (bad) - // -1.5 = wide - // -4.0 = not very wide at all - float _hardBloomScan = -4.0; - - // Hardness of short horizontal bloom. - // -0.5 = wide to the point of clipping (bad) - // -1.0 = wide - // -2.0 = not very wide at all - float _hardBloomPix = -1.5; - - // Amount of small bloom effect. - // 1.0/1.0 = only bloom - // 1.0/16.0 = what I think is a good amount of small bloom - // 0.0 = no bloom - float _bloomAmount = 1.0/16.0; - - // Display warp. - // 0.0 = none - // 1.0/8.0 = extreme - float2 _warp = float2(1.0/64.0,1.0/24.0); - - // Amount of shadow mask. - float _maskDark = 0.5; - float _maskLight = 1.5; - - //------------------------------------------------------------------------ - - float fract(float x){ - return x-floor(x); - } - - // sRGB to Linear. - // Assuing using sRGB typed textures this should not be needed. - float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} - float3 ToLinear(float3 c){return float3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} - - // Linear to sRGB. - // Assuing using sRGB typed textures this should not be needed. - float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} - float3 ToSrgb(float3 c){return float3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} - - - float3 Test(float3 c){return c*(1.0/64.0)+c*c*c;} - - // Nearest emulated sample given floating point position and texel offset. - // Also zero's off screen. - float3 Fetch( float2 pos,float2 off){ - pos=floor(pos*_res+off)/_res; - if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return float3(0.0,0.0,0.0); - return Test(ToLinear(tex2D(_MainTex,pos.xy).rgb));} - - // Distance in emulated pixels to nearest texel. - float2 Dist(float2 pos){pos=pos*_res;return -((pos-floor(pos))-float2(0.5,0.5));} - - // 1D Gaussian. - float Gaus(float pos,float scale){return exp2(scale*pos*pos);} - - // 3-tap Gaussian filter along horz line. - float3 Horz3(float2 pos,float off){ - float3 b=Fetch(pos,float2(-1.0,off)); - float3 c=Fetch(pos,float2( 0.0,off)); - float3 d=Fetch(pos,float2( 1.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. - float scale=_hardPix; - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - // Return filtered sample. - return (b*wb+c*wc+d*wd)/(wb+wc+wd);} - - // 5-tap Gaussian filter along horz line. - float3 Horz5(float2 pos,float off){ - float3 a=Fetch(pos,float2(-2.0,off)); - float3 b=Fetch(pos,float2(-1.0,off)); - float3 c=Fetch(pos,float2( 0.0,off)); - float3 d=Fetch(pos,float2( 1.0,off)); - float3 e=Fetch(pos,float2( 2.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. - float scale=_hardPix; - float wa=Gaus(dst-2.0,scale); - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - float we=Gaus(dst+2.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} - - // 7-tap Gaussian filter along horz line. - float3 Horz7(float2 pos,float off){ - float3 a=Fetch(pos,float2(-3.0,off)); - float3 b=Fetch(pos,float2(-2.0,off)); - float3 c=Fetch(pos,float2(-1.0,off)); - float3 d=Fetch(pos,float2( 0.0,off)); - float3 e=Fetch(pos,float2( 1.0,off)); - float3 f=Fetch(pos,float2( 2.0,off)); - float3 g=Fetch(pos,float2( 3.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. - float scale=_hardBloomPix; - float wa=Gaus(dst-3.0,scale); - float wb=Gaus(dst-2.0,scale); - float wc=Gaus(dst-1.0,scale); - float wd=Gaus(dst+0.0,scale); - float we=Gaus(dst+1.0,scale); - float wf=Gaus(dst+2.0,scale); - float wg=Gaus(dst+3.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} - - // Return scanline weight. - float Scan(float2 pos,float off){ - float dst=Dist(pos).y; - return Gaus(dst+off,_hardScan);} - - // Return scanline weight for bloom. - float BloomScan(float2 pos,float off){ - float dst=Dist(pos).y; - return Gaus(dst+off,_hardBloomScan);} - - // Allow nearest three lines to effect pixel. - float3 Tri(float2 pos){ - float3 a=Horz3(pos,-1.0); - float3 b=Horz5(pos, 0.0); - float3 c=Horz3(pos, 1.0); - float wa=Scan(pos,-1.0); - float wb=Scan(pos, 0.0); - float wc=Scan(pos, 1.0); - return a*wa+b*wb+c*wc;} - - // Small bloom. - float3 Bloom(float2 pos){ - float3 a=Horz5(pos,-2.0); - float3 b=Horz7(pos,-1.0); - float3 c=Horz7(pos, 0.0); - float3 d=Horz7(pos, 1.0); - float3 e=Horz5(pos, 2.0); - float wa=BloomScan(pos,-2.0); - float wb=BloomScan(pos,-1.0); - float wc=BloomScan(pos, 0.0); - float wd=BloomScan(pos, 1.0); - float we=BloomScan(pos, 2.0); - return a*wa+b*wb+c*wc+d*wd+e*we;} - - // Distortion of scanlines, and end of screen alpha. - float2 Warp(float2 pos){ - - pos=pos*2.0-1.0; - pos*=float2(1.0+(pos.y*pos.y)*_warp.x,1.0+(pos.x*pos.x)*_warp.y); - return pos*0.5+0.5;} - - #if defined(_MASKSTYLE_TVSTYLE) - // Very compressed TV style shadow mask. - float3 Mask(float2 pos){ - float lineee=_maskLight; - float odd=0.0; - if(fract(pos.x/6.0)<0.5)odd=1.0; - if(fract((pos.y+odd)/2.0)<0.5) lineee=_maskDark; - pos.x=fract(pos.x/3.0); - float3 mask=float3(_maskDark,_maskDark,_maskDark); - if(pos.x<0.333)mask.r=_maskLight; - else if(pos.x<0.666)mask.g=_maskLight; - else mask.b=_maskLight; - mask*=lineee; - return mask; - } - #elif defined(_MASKSTYLE_APERTUREGRILLE) - // Aperture-grille. - float3 Mask(float2 pos){ - pos.x=fract(pos.x/3.0); - float3 mask=float3(_maskDark,_maskDark,_maskDark); - if(pos.x<0.333)mask.r=_maskLight; - else if(pos.x<0.666)mask.g=_maskLight; - else mask.b=_maskLight; - return mask;} - #elif defined(_MASKSTYLE_STRETCHEDVGA) - // Stretched VGA style shadow mask (same as prior shaders). - float3 Mask(float2 pos){ - pos.x+=pos.y*3.0; - float3 mask=float3(_maskDark,_maskDark,_maskDark); - pos.x=fract(pos.x/6.0); - if(pos.x<0.333)mask.r=_maskLight; - else if(pos.x<0.666)mask.g=_maskLight; - else mask.b=_maskLight; - return mask;} - #elif defined(_MASKSTYLE_VGASTYLE) - // VGA style shadow mask. - float3 Mask(float2 pos){ - pos.xy=floor(pos.xy*float2(1.0,0.5)); - pos.x+=pos.y*3.0; - float3 mask=float3(_maskDark,_maskDark,_maskDark); - pos.x=fract(pos.x/6.0); - if(pos.x<0.333)mask.r=_maskLight; - else if(pos.x<0.666)mask.g=_maskLight; - else mask.b=_maskLight; - return mask;} - #endif - - - - // Draw dividing bars. - float Bar(float pos,float bar){pos-=bar;return pos*pos<4.0?0.0:1.0;} - - // Entry. - float4 mainImage(float2 fragCoord){ - - float4 fragColor = float4(1,1,1,1); - float2 pos=Warp(fragCoord.xy/_iResolution.xy); - - fragColor.rgb=Tri(pos)*Mask(fragCoord.xy); - - fragColor.rgb+=Bloom(pos)*_bloomAmount; - - fragColor.a=1.0; - fragColor.rgb=ToSrgb(fragColor.rgb); - - return fragColor; - } - - struct v2f - { - float4 pos : POSITION; - float2 uv : TEXCOORD0; - }; - - fixed4 frag (v2f i) : SV_Target - { - float2 pos = _iResolution.xy*i.uv; - fixed4 col = mainImage(pos); - return col; - } - ENDCG - } - } -} - - - + +Shader "PostEffect/FixingPixcelArtGrille" +{ + Properties + { + _MainTex ("Base (RGB)", 2D) = "white" {} + } + SubShader + { + Pass + { + CGPROGRAM + + #pragma shader_feature_local _MASKSTYLE_TVSTYLE _MASKSTYLE_APERTUREGRILLE _MASKSTYLE_STRETCHEDVGA _MASKSTYLE_VGASTYLE + #pragma vertex vert_img + #pragma fragment frag + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_TexelSize; + + // + // PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER + // + // by Timothy Lottes + // + // This is more along the style of a really good CGA arcade monitor. + // With RGB inputs instead of NTSC. + // The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. + // + // Left it unoptimized to show the theory behind the algorithm. + // + // It is an example what I personally would want as a display option for pixel art games. + // Please take and use, change, or whatever. + // + + float2 _iResolution = float2(1920,1080); + + // Emulated input resolution. + // Optimize for resize. + float2 _res = float2(272.0,240.0); + + // Hardness of scanline. + // -8.0 = soft + // -16.0 = medium + float _hardScan = -10.0; + + // Hardness of pixels in scanline. + // -2.0 = soft + // -4.0 = hard + float _hardPix =-2.0; + + // Hardness of short vertical bloom. + // -1.0 = wide to the point of clipping (bad) + // -1.5 = wide + // -4.0 = not very wide at all + float _hardBloomScan = -4.0; + + // Hardness of short horizontal bloom. + // -0.5 = wide to the point of clipping (bad) + // -1.0 = wide + // -2.0 = not very wide at all + float _hardBloomPix = -1.5; + + // Amount of small bloom effect. + // 1.0/1.0 = only bloom + // 1.0/16.0 = what I think is a good amount of small bloom + // 0.0 = no bloom + float _bloomAmount = 1.0/16.0; + + // Display warp. + // 0.0 = none + // 1.0/8.0 = extreme + float2 _warp = float2(1.0/64.0,1.0/24.0); + + // Amount of shadow mask. + float _maskDark = 0.5; + float _maskLight = 1.5; + + //------------------------------------------------------------------------ + + float fract(float x){ + return x-floor(x); + } + + // sRGB to Linear. + // Assuing using sRGB typed textures this should not be needed. + float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} + float3 ToLinear(float3 c){return float3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} + + // Linear to sRGB. + // Assuing using sRGB typed textures this should not be needed. + float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} + float3 ToSrgb(float3 c){return float3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} + + + float3 Test(float3 c){return c*(1.0/64.0)+c*c*c;} + + // Nearest emulated sample given floating point position and texel offset. + // Also zero's off screen. + float3 Fetch( float2 pos,float2 off){ + pos=floor(pos*_res+off)/_res; + if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return float3(0.0,0.0,0.0); + return Test(ToLinear(tex2D(_MainTex,pos.xy).rgb));} + + // Distance in emulated pixels to nearest texel. + float2 Dist(float2 pos){pos=pos*_res;return -((pos-floor(pos))-float2(0.5,0.5));} + + // 1D Gaussian. + float Gaus(float pos,float scale){return exp2(scale*pos*pos);} + + // 3-tap Gaussian filter along horz line. + float3 Horz3(float2 pos,float off){ + float3 b=Fetch(pos,float2(-1.0,off)); + float3 c=Fetch(pos,float2( 0.0,off)); + float3 d=Fetch(pos,float2( 1.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. + float scale=_hardPix; + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + // Return filtered sample. + return (b*wb+c*wc+d*wd)/(wb+wc+wd);} + + // 5-tap Gaussian filter along horz line. + float3 Horz5(float2 pos,float off){ + float3 a=Fetch(pos,float2(-2.0,off)); + float3 b=Fetch(pos,float2(-1.0,off)); + float3 c=Fetch(pos,float2( 0.0,off)); + float3 d=Fetch(pos,float2( 1.0,off)); + float3 e=Fetch(pos,float2( 2.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. + float scale=_hardPix; + float wa=Gaus(dst-2.0,scale); + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + float we=Gaus(dst+2.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} + + // 7-tap Gaussian filter along horz line. + float3 Horz7(float2 pos,float off){ + float3 a=Fetch(pos,float2(-3.0,off)); + float3 b=Fetch(pos,float2(-2.0,off)); + float3 c=Fetch(pos,float2(-1.0,off)); + float3 d=Fetch(pos,float2( 0.0,off)); + float3 e=Fetch(pos,float2( 1.0,off)); + float3 f=Fetch(pos,float2( 2.0,off)); + float3 g=Fetch(pos,float2( 3.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. + float scale=_hardBloomPix; + float wa=Gaus(dst-3.0,scale); + float wb=Gaus(dst-2.0,scale); + float wc=Gaus(dst-1.0,scale); + float wd=Gaus(dst+0.0,scale); + float we=Gaus(dst+1.0,scale); + float wf=Gaus(dst+2.0,scale); + float wg=Gaus(dst+3.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} + + // Return scanline weight. + float Scan(float2 pos,float off){ + float dst=Dist(pos).y; + return Gaus(dst+off,_hardScan);} + + // Return scanline weight for bloom. + float BloomScan(float2 pos,float off){ + float dst=Dist(pos).y; + return Gaus(dst+off,_hardBloomScan);} + + // Allow nearest three lines to effect pixel. + float3 Tri(float2 pos){ + float3 a=Horz3(pos,-1.0); + float3 b=Horz5(pos, 0.0); + float3 c=Horz3(pos, 1.0); + float wa=Scan(pos,-1.0); + float wb=Scan(pos, 0.0); + float wc=Scan(pos, 1.0); + return a*wa+b*wb+c*wc;} + + // Small bloom. + float3 Bloom(float2 pos){ + float3 a=Horz5(pos,-2.0); + float3 b=Horz7(pos,-1.0); + float3 c=Horz7(pos, 0.0); + float3 d=Horz7(pos, 1.0); + float3 e=Horz5(pos, 2.0); + float wa=BloomScan(pos,-2.0); + float wb=BloomScan(pos,-1.0); + float wc=BloomScan(pos, 0.0); + float wd=BloomScan(pos, 1.0); + float we=BloomScan(pos, 2.0); + return a*wa+b*wb+c*wc+d*wd+e*we;} + + // Distortion of scanlines, and end of screen alpha. + float2 Warp(float2 pos){ + + pos=pos*2.0-1.0; + pos*=float2(1.0+(pos.y*pos.y)*_warp.x,1.0+(pos.x*pos.x)*_warp.y); + return pos*0.5+0.5;} + + #if defined(_MASKSTYLE_TVSTYLE) + // Very compressed TV style shadow mask. + float3 Mask(float2 pos){ + float lineee=_maskLight; + float odd=0.0; + if(fract(pos.x/6.0)<0.5)odd=1.0; + if(fract((pos.y+odd)/2.0)<0.5) lineee=_maskDark; + pos.x=fract(pos.x/3.0); + float3 mask=float3(_maskDark,_maskDark,_maskDark); + if(pos.x<0.333)mask.r=_maskLight; + else if(pos.x<0.666)mask.g=_maskLight; + else mask.b=_maskLight; + mask*=lineee; + return mask; + } + #elif defined(_MASKSTYLE_APERTUREGRILLE) + // Aperture-grille. + float3 Mask(float2 pos){ + pos.x=fract(pos.x/3.0); + float3 mask=float3(_maskDark,_maskDark,_maskDark); + if(pos.x<0.333)mask.r=_maskLight; + else if(pos.x<0.666)mask.g=_maskLight; + else mask.b=_maskLight; + return mask;} + #elif defined(_MASKSTYLE_STRETCHEDVGA) + // Stretched VGA style shadow mask (same as prior shaders). + float3 Mask(float2 pos){ + pos.x+=pos.y*3.0; + float3 mask=float3(_maskDark,_maskDark,_maskDark); + pos.x=fract(pos.x/6.0); + if(pos.x<0.333)mask.r=_maskLight; + else if(pos.x<0.666)mask.g=_maskLight; + else mask.b=_maskLight; + return mask;} + #elif defined(_MASKSTYLE_VGASTYLE) + // VGA style shadow mask. + float3 Mask(float2 pos){ + pos.xy=floor(pos.xy*float2(1.0,0.5)); + pos.x+=pos.y*3.0; + float3 mask=float3(_maskDark,_maskDark,_maskDark); + pos.x=fract(pos.x/6.0); + if(pos.x<0.333)mask.r=_maskLight; + else if(pos.x<0.666)mask.g=_maskLight; + else mask.b=_maskLight; + return mask;} + #endif + + + + // Draw dividing bars. + float Bar(float pos,float bar){pos-=bar;return pos*pos<4.0?0.0:1.0;} + + // Entry. + float4 mainImage(float2 fragCoord){ + + float4 fragColor = float4(1,1,1,1); + float2 pos=Warp(fragCoord.xy/_iResolution.xy); + + fragColor.rgb=Tri(pos)*Mask(fragCoord.xy); + + fragColor.rgb+=Bloom(pos)*_bloomAmount; + + fragColor.a=1.0; + fragColor.rgb=ToSrgb(fragColor.rgb); + + return fragColor; + } + + struct v2f + { + float4 pos : POSITION; + float2 uv : TEXCOORD0; + }; + + fixed4 frag (v2f i) : SV_Target + { + float2 pos = _iResolution.xy*i.uv; + fixed4 col = mainImage(pos); + return col; + } + ENDCG + } + } +} + + + diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/FixingPixelArtGrille/FixingPixelArtGrille.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/GameCamera Profile.asset b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/GameCamera Profile.asset similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/GameCamera Profile.asset rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/GameCamera Profile.asset diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/GameCamera Profile.asset.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/GameCamera Profile.asset.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/GameCamera Profile.asset.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/GameCamera Profile.asset.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.cs index 52becd6..b398e58 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.cs @@ -1,28 +1,28 @@ -using AxibugEmuOnline.Client; -using UnityEngine; -using UnityEngine.Rendering.PostProcessing; - -[System.Serializable] -[PostProcess(typeof(MattiasCRTRenderer), PostProcessEvent.BeforeStack, "Filter/MattiasCRT")] -public sealed class MattiasCRT : FilterEffect -{ - public override string Name => nameof(MattiasCRT); -} - -public sealed class MattiasCRTRenderer : PostProcessEffectRenderer -{ - private Shader shader; - private Material material; - - public override void Init() - { - shader = Shader.Find("Filter/MattiasCRT"); - material = new Material(shader); - } - - public override void Render(PostProcessRenderContext context) - { - material.SetVector("_iResolution", new Vector4(Screen.width, Screen.height, 0, 0)); - context.command.Blit(context.source, context.destination, material); - } +using AxibugEmuOnline.Client; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +[System.Serializable] +[PostProcess(typeof(MattiasCRTRenderer), PostProcessEvent.BeforeStack, "Filter/MattiasCRT")] +public sealed class MattiasCRT : FilterEffect +{ + public override string Name => nameof(MattiasCRT); +} + +public sealed class MattiasCRTRenderer : PostProcessEffectRenderer +{ + private Shader shader; + private Material material; + + public override void Init() + { + shader = Shader.Find("Filter/MattiasCRT"); + material = new Material(shader); + } + + public override void Render(PostProcessRenderContext context) + { + material.SetVector("_iResolution", new Vector4(Screen.width, Screen.height, 0, 0)); + context.command.Blit(context.source, context.destination, material); + } } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.shader similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.shader rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.shader index 3b0f976..a493754 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.shader +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.shader @@ -1,98 +1,98 @@ - -Shader "Filter/MattiasCRT" -{ - Properties - { - _MainTex ("Base (RGB)", 2D) = "white" {} - } - SubShader - { - Pass - { - CGPROGRAM - - #pragma vertex vert_img - #pragma fragment frag - #include "UnityCG.cginc" - - sampler2D _MainTex; - float4 _MainTex_TexelSize; - float2 _iResolution; - - float2 curve(float2 uv) - { - uv = (uv - 0.5) * 2.0; - uv *= 1.1; - uv.x *= 1.0 + pow((abs(uv.y) / 5.0), 2.0); - uv.y *= 1.0 + pow((abs(uv.x) / 4.0), 2.0); - uv = (uv / 2.0) + 0.5; - uv = uv *0.92 + 0.04; - return uv; - } - - float4 mainImage( float2 fragCoord ) - { - float4 fragColor = float4(0,0,0,1); - - float2 q = fragCoord.xy / _iResolution.xy; - float2 uv = q; - uv = curve( uv ); - float3 oricol = tex2D(_MainTex,uv).xyz; - float3 col; - float x = sin(0.3*_Time+uv.y*21.0)*sin(0.7*_Time+uv.y*29.0)*sin(0.3+0.33*_Time+uv.y*31.0)*0.0017; - - col.r = tex2D(_MainTex,float2(x+uv.x+0.001,uv.y+0.001)).x+0.05; - col.g = tex2D(_MainTex,float2(x+uv.x+0.000,uv.y-0.002)).y+0.05; - col.b = tex2D(_MainTex,float2(x+uv.x-0.002,uv.y+0.000)).z+0.05; - col.r += 0.08*tex2D(_MainTex,0.75*float2(x+0.025, -0.027)+float2(uv.x+0.001,uv.y+0.001)).x; - col.g += 0.05*tex2D(_MainTex,0.75*float2(x+-0.022, -0.02)+float2(uv.x+0.000,uv.y-0.002)).y; - col.b += 0.08*tex2D(_MainTex,0.75*float2(x+-0.02, -0.018)+float2(uv.x-0.002,uv.y+0.000)).z; - - col = clamp(col*0.6+0.4*col*col*1.0,0.0,1.0); - - float vig = (0.0 + 1.0*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y)); - col *= pow(vig,0.3); - - col *= float3(0.95,1.05,0.95); - col *= 2.8; - - float scans = clamp( 0.35+0.35*sin(3.5*_Time+uv.y*_iResolution.y*1.5), 0.0, 1.0); - - float s = pow(scans,1.7); - col = col*( 0.4+0.7*s) ; - - col *= 1.0+0.01*sin(110.0*_Time); - if (uv.x < 0.0 || uv.x > 1.0) - col *= 0.0; - if (uv.y < 0.0 || uv.y > 1.0) - col *= 0.0; - - - col*=1.0-0.65*clamp((fragCoord.x % 2.0 -1.0 )*2.0,0.0,1.0); - - float comp = smoothstep( 0.1, 0.9, sin(_Time) ); - - fragColor = float4(col,1.0); - - return fragColor; - } - - struct v2f - { - float4 pos : POSITION; - float2 uv : TEXCOORD0; - }; - - fixed4 frag (v2f i) : SV_Target - { - float2 pos = _iResolution.xy*i.uv; - fixed4 col = mainImage(pos); - return col; - } - ENDCG - } - } -} - - - + +Shader "Filter/MattiasCRT" +{ + Properties + { + _MainTex ("Base (RGB)", 2D) = "white" {} + } + SubShader + { + Pass + { + CGPROGRAM + + #pragma vertex vert_img + #pragma fragment frag + #include "UnityCG.cginc" + + sampler2D _MainTex; + float4 _MainTex_TexelSize; + float2 _iResolution; + + float2 curve(float2 uv) + { + uv = (uv - 0.5) * 2.0; + uv *= 1.1; + uv.x *= 1.0 + pow((abs(uv.y) / 5.0), 2.0); + uv.y *= 1.0 + pow((abs(uv.x) / 4.0), 2.0); + uv = (uv / 2.0) + 0.5; + uv = uv *0.92 + 0.04; + return uv; + } + + float4 mainImage( float2 fragCoord ) + { + float4 fragColor = float4(0,0,0,1); + + float2 q = fragCoord.xy / _iResolution.xy; + float2 uv = q; + uv = curve( uv ); + float3 oricol = tex2D(_MainTex,uv).xyz; + float3 col; + float x = sin(0.3*_Time+uv.y*21.0)*sin(0.7*_Time+uv.y*29.0)*sin(0.3+0.33*_Time+uv.y*31.0)*0.0017; + + col.r = tex2D(_MainTex,float2(x+uv.x+0.001,uv.y+0.001)).x+0.05; + col.g = tex2D(_MainTex,float2(x+uv.x+0.000,uv.y-0.002)).y+0.05; + col.b = tex2D(_MainTex,float2(x+uv.x-0.002,uv.y+0.000)).z+0.05; + col.r += 0.08*tex2D(_MainTex,0.75*float2(x+0.025, -0.027)+float2(uv.x+0.001,uv.y+0.001)).x; + col.g += 0.05*tex2D(_MainTex,0.75*float2(x+-0.022, -0.02)+float2(uv.x+0.000,uv.y-0.002)).y; + col.b += 0.08*tex2D(_MainTex,0.75*float2(x+-0.02, -0.018)+float2(uv.x-0.002,uv.y+0.000)).z; + + col = clamp(col*0.6+0.4*col*col*1.0,0.0,1.0); + + float vig = (0.0 + 1.0*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y)); + col *= pow(vig,0.3); + + col *= float3(0.95,1.05,0.95); + col *= 2.8; + + float scans = clamp( 0.35+0.35*sin(3.5*_Time+uv.y*_iResolution.y*1.5), 0.0, 1.0); + + float s = pow(scans,1.7); + col = col*( 0.4+0.7*s) ; + + col *= 1.0+0.01*sin(110.0*_Time); + if (uv.x < 0.0 || uv.x > 1.0) + col *= 0.0; + if (uv.y < 0.0 || uv.y > 1.0) + col *= 0.0; + + + col*=1.0-0.65*clamp((fragCoord.x % 2.0 -1.0 )*2.0,0.0,1.0); + + float comp = smoothstep( 0.1, 0.9, sin(_Time) ); + + fragColor = float4(col,1.0); + + return fragColor; + } + + struct v2f + { + float4 pos : POSITION; + float2 uv : TEXCOORD0; + }; + + fixed4 frag (v2f i) : SV_Target + { + float2 pos = _iResolution.xy*i.uv; + fixed4 col = mainImage(pos); + return col; + } + ENDCG + } + } +} + + + diff --git a/AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.shader.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Filter/MattiasCRT/MattiasCRT.shader.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Filter/MattiasCRT/MattiasCRT.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/IEmuCore.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IEmuCore.cs index 694b5e9..4a97765 100644 --- a/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/IEmuCore.cs @@ -1,30 +1,30 @@ -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public interface IEmuCore - { - GameObject gameObject { get; } - - object GetState(); - byte[] GetStateBytes(); - void LoadState(object state); - void LoadStateFromBytes(byte[] data); - void Pause(); - void Resume(); - void SetupScheme(); - void StartGame(RomFile romFile); - void DoReset(); - EnumPlatform Platform { get; } - uint Frame { get; } - } - - public static class IEnumCoreTool - { - public static bool IsNull(this IEmuCore core) - { - if (core == null) return true; - return core.Equals(null); - } - } -} +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public interface IEmuCore + { + GameObject gameObject { get; } + + object GetState(); + byte[] GetStateBytes(); + void LoadState(object state); + void LoadStateFromBytes(byte[] data); + void Pause(); + void Resume(); + void SetupScheme(); + void StartGame(RomFile romFile); + void DoReset(); + EnumPlatform Platform { get; } + uint Frame { get; } + } + + public static class IEnumCoreTool + { + public static bool IsNull(this IEmuCore core) + { + if (core == null) return true; + return core.Equals(null); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IEmuCore.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IEmuCore.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IEmuCore.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/CommandChanger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/CommandChanger.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/CommandChanger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/CommandChanger.cs index dbc6a27..34bdc92 100644 --- a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/CommandChanger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/CommandChanger.cs @@ -1,8 +1,8 @@ -namespace AxibugEmuOnline.Client -{ - public abstract class CommandChanger : IKeyMapperChanger - { - public string Name => GetType().Name; - public abstract object GetConfig(); - } -} +namespace AxibugEmuOnline.Client +{ + public abstract class CommandChanger : IKeyMapperChanger + { + public string Name => GetType().Name; + public abstract object GetConfig(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/CommandChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/CommandChanger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/CommandChanger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/CommandChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/GamingChanger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/GamingChanger.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/GamingChanger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/GamingChanger.cs index d937047..86396de 100644 --- a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/GamingChanger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/GamingChanger.cs @@ -1,26 +1,26 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class GamingChanger : CommandChanger - { - - Dictionary m_uiKeyMapper = new Dictionary(); - public GamingChanger() - { - m_uiKeyMapper[KeyCode.Escape] = EnumCommand.OptionMenu; - - if (Application.platform == RuntimePlatform.PSP2) - { - m_uiKeyMapper[Common.PSVitaKey.L] = EnumCommand.OptionMenu; - m_uiKeyMapper[Common.PSVitaKey.R] = EnumCommand.OptionMenu; - } - - //PC XBOX - m_uiKeyMapper[Common.PC_XBOXKEY.Y] = EnumCommand.OptionMenu; - } - - public override object GetConfig() => m_uiKeyMapper; - } -} +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class GamingChanger : CommandChanger + { + + Dictionary m_uiKeyMapper = new Dictionary(); + public GamingChanger() + { + m_uiKeyMapper[KeyCode.Escape] = EnumCommand.OptionMenu; + + if (Application.platform == RuntimePlatform.PSP2) + { + m_uiKeyMapper[Common.PSVitaKey.L] = EnumCommand.OptionMenu; + m_uiKeyMapper[Common.PSVitaKey.R] = EnumCommand.OptionMenu; + } + + //PC XBOX + m_uiKeyMapper[Common.PC_XBOXKEY.Y] = EnumCommand.OptionMenu; + } + + public override object GetConfig() => m_uiKeyMapper; + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/GamingChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/GamingChanger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/GamingChanger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/GamingChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/NormalChanger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/NormalChanger.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/NormalChanger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/NormalChanger.cs index 6f6d12e..c4d310c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/NormalChanger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/NormalChanger.cs @@ -1,54 +1,54 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - - public class NormalChanger : CommandChanger - { - Dictionary m_uiKeyMapper = new Dictionary(); - public NormalChanger() - { - m_uiKeyMapper[KeyCode.A] = EnumCommand.SelectItemLeft; - m_uiKeyMapper[KeyCode.D] = EnumCommand.SelectItemRight; - m_uiKeyMapper[KeyCode.W] = EnumCommand.SelectItemUp; - m_uiKeyMapper[KeyCode.S] = EnumCommand.SelectItemDown; - m_uiKeyMapper[KeyCode.K] = EnumCommand.Enter; - m_uiKeyMapper[KeyCode.L] = EnumCommand.Back; - m_uiKeyMapper[KeyCode.I] = EnumCommand.OptionMenu; - - m_uiKeyMapper[KeyCode.LeftArrow] = EnumCommand.SelectItemLeft; - m_uiKeyMapper[KeyCode.RightArrow] = EnumCommand.SelectItemRight; - m_uiKeyMapper[KeyCode.UpArrow] = EnumCommand.SelectItemUp; - m_uiKeyMapper[KeyCode.DownArrow] = EnumCommand.SelectItemDown; - m_uiKeyMapper[KeyCode.Return] = EnumCommand.Enter; - m_uiKeyMapper[KeyCode.Escape] = EnumCommand.Back; - m_uiKeyMapper[KeyCode.RightShift] = EnumCommand.OptionMenu; - m_uiKeyMapper[KeyCode.LeftShift] = EnumCommand.OptionMenu; - - if (Application.platform == RuntimePlatform.PSP2) - { - m_uiKeyMapper[Common.PSVitaKey.Left] = EnumCommand.SelectItemLeft; - m_uiKeyMapper[Common.PSVitaKey.Right] = EnumCommand.SelectItemRight; - m_uiKeyMapper[Common.PSVitaKey.Up] = EnumCommand.SelectItemUp; - m_uiKeyMapper[Common.PSVitaKey.Down] = EnumCommand.SelectItemDown; - m_uiKeyMapper[Common.PSVitaKey.Circle] = EnumCommand.Enter; - m_uiKeyMapper[Common.PSVitaKey.Cross] = EnumCommand.Back; - m_uiKeyMapper[Common.PSVitaKey.Triangle] = EnumCommand.OptionMenu; - } - - //PC XBOX - - //m_uiKeyMapper[Common.PC_XBOXKEY.Left] = EnumCommand.SelectItemLeft; - //m_uiKeyMapper[Common.PSVitaKey.Right] = EnumCommand.SelectItemRight; - //m_uiKeyMapper[Common.PSVitaKey.Up] = EnumCommand.SelectItemUp; - //m_uiKeyMapper[Common.PSVitaKey.Down] = EnumCommand.SelectItemDown; - m_uiKeyMapper[Common.PC_XBOXKEY.MenuBtn] = EnumCommand.Enter; - m_uiKeyMapper[Common.PC_XBOXKEY.ViewBtn] = EnumCommand.Back; - m_uiKeyMapper[Common.PC_XBOXKEY.Y] = EnumCommand.OptionMenu; - } - - public override object GetConfig() => m_uiKeyMapper; - } - -} +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + + public class NormalChanger : CommandChanger + { + Dictionary m_uiKeyMapper = new Dictionary(); + public NormalChanger() + { + m_uiKeyMapper[KeyCode.A] = EnumCommand.SelectItemLeft; + m_uiKeyMapper[KeyCode.D] = EnumCommand.SelectItemRight; + m_uiKeyMapper[KeyCode.W] = EnumCommand.SelectItemUp; + m_uiKeyMapper[KeyCode.S] = EnumCommand.SelectItemDown; + m_uiKeyMapper[KeyCode.K] = EnumCommand.Enter; + m_uiKeyMapper[KeyCode.L] = EnumCommand.Back; + m_uiKeyMapper[KeyCode.I] = EnumCommand.OptionMenu; + + m_uiKeyMapper[KeyCode.LeftArrow] = EnumCommand.SelectItemLeft; + m_uiKeyMapper[KeyCode.RightArrow] = EnumCommand.SelectItemRight; + m_uiKeyMapper[KeyCode.UpArrow] = EnumCommand.SelectItemUp; + m_uiKeyMapper[KeyCode.DownArrow] = EnumCommand.SelectItemDown; + m_uiKeyMapper[KeyCode.Return] = EnumCommand.Enter; + m_uiKeyMapper[KeyCode.Escape] = EnumCommand.Back; + m_uiKeyMapper[KeyCode.RightShift] = EnumCommand.OptionMenu; + m_uiKeyMapper[KeyCode.LeftShift] = EnumCommand.OptionMenu; + + if (Application.platform == RuntimePlatform.PSP2) + { + m_uiKeyMapper[Common.PSVitaKey.Left] = EnumCommand.SelectItemLeft; + m_uiKeyMapper[Common.PSVitaKey.Right] = EnumCommand.SelectItemRight; + m_uiKeyMapper[Common.PSVitaKey.Up] = EnumCommand.SelectItemUp; + m_uiKeyMapper[Common.PSVitaKey.Down] = EnumCommand.SelectItemDown; + m_uiKeyMapper[Common.PSVitaKey.Circle] = EnumCommand.Enter; + m_uiKeyMapper[Common.PSVitaKey.Cross] = EnumCommand.Back; + m_uiKeyMapper[Common.PSVitaKey.Triangle] = EnumCommand.OptionMenu; + } + + //PC XBOX + + //m_uiKeyMapper[Common.PC_XBOXKEY.Left] = EnumCommand.SelectItemLeft; + //m_uiKeyMapper[Common.PSVitaKey.Right] = EnumCommand.SelectItemRight; + //m_uiKeyMapper[Common.PSVitaKey.Up] = EnumCommand.SelectItemUp; + //m_uiKeyMapper[Common.PSVitaKey.Down] = EnumCommand.SelectItemDown; + m_uiKeyMapper[Common.PC_XBOXKEY.MenuBtn] = EnumCommand.Enter; + m_uiKeyMapper[Common.PC_XBOXKEY.ViewBtn] = EnumCommand.Back; + m_uiKeyMapper[Common.PC_XBOXKEY.Y] = EnumCommand.OptionMenu; + } + + public override object GetConfig() => m_uiKeyMapper; + } + +} diff --git a/AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/NormalChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/NormalChanger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/IkeyMapperChanger/Legacy/NormalChanger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/IkeyMapperChanger/Legacy/NormalChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs new file mode 100644 index 0000000..6bf10ea --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs @@ -0,0 +1,20 @@ +using AxibugEmuOnline.Client.ClientCore; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; + +namespace AxibugEmuOnline.Client +{ + public class Initer : MonoBehaviour + { + public PostProcessVolume m_filterVolume; + public CanvasGroup m_filterPreview; + public CanvasGroup m_xmbBg; + public static string dev_UUID; + + private void Awake() + { + App.Init(this); + dev_UUID = SystemInfo.deviceUniqueIdentifier; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs.meta new file mode 100644 index 0000000..7b894b6 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Initer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 980f937ad27ad8540afeb8b7f100997e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -1100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager.meta new file mode 100644 index 0000000..7cf740f --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 437646a1943eaf34dbe1a56eb38494bb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppChat.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppChat.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppChat.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppChat.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppChat.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppChat.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppChat.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppChat.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppEmu.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppEmu.cs index 1b01f52..4896f54 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppEmu.cs @@ -1,80 +1,80 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Event; -using UnityEngine; - -namespace AxibugEmuOnline.Client.Manager -{ - public class AppEmu - { - /// - /// unity的c#实现有bug,以接口类型保存的monobehaviour引用,!=和==运算符没有调用到monobehaviour重写过的运算符 - /// 但是Equals方法可以,所以,这个接口判断为空请使用Equals - /// - private IEmuCore m_emuCore; - /// - /// unity的c#实现有bug,以接口类型保存的monobehaviour引用,!=和==运算符没有调用到monobehaviour重写过的运算符 - /// 但是Equals方法可以,所以,这个接口判断为空请使用Equals - /// - public IEmuCore Core => m_emuCore; - - public AppEmu() - { - Eventer.Instance.RegisterEvent(EEvent.OnMineJoinRoom, OnSelfJoinRoom); - } - - private void OnSelfJoinRoom() - { - //如果当前正在游戏中,就先结束游戏 - if (!m_emuCore.IsNull()) StopGame(); - - var roomInfo = App.roomMgr.mineRoomMiniInfo; - roomInfo.FetchRomFileInRoomInfo(EnumPlatform.NES, (room, romFile) => - { - if (!romFile.RomReady) //这个rom并没有下载,所以取消进入房间 - { - App.roomMgr.SendLeavnRoom(); - } - else - { - BeginGame(romFile); - } - }); - } - - - public void BeginGame(RomFile romFile) - { - if (!m_emuCore.IsNull()) return; - - switch (romFile.Platform) - { - case EnumPlatform.NES: - m_emuCore = GameObject.Instantiate(Resources.Load("NES/NesEmulator")).GetComponent(); - break; - } - - m_emuCore.StartGame(romFile); - LaunchUI.Instance.HideMainMenu(); - InGameUI.Instance.Show(romFile, m_emuCore); - - m_emuCore.SetupScheme(); - } - - public void StopGame() - { - if (m_emuCore.IsNull()) return; - GameObject.Destroy(m_emuCore.gameObject); - m_emuCore = null; - - InGameUI.Instance.Hide(); - LaunchUI.Instance.ShowMainMenu(); - } - - public void ResetGame() - { - if (m_emuCore.IsNull()) return; - - m_emuCore.DoReset(); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Event; +using UnityEngine; + +namespace AxibugEmuOnline.Client.Manager +{ + public class AppEmu + { + /// + /// unity的c#实现有bug,以接口类型保存的monobehaviour引用,!=和==运算符没有调用到monobehaviour重写过的运算符 + /// 但是Equals方法可以,所以,这个接口判断为空请使用Equals + /// + private IEmuCore m_emuCore; + /// + /// unity的c#实现有bug,以接口类型保存的monobehaviour引用,!=和==运算符没有调用到monobehaviour重写过的运算符 + /// 但是Equals方法可以,所以,这个接口判断为空请使用Equals + /// + public IEmuCore Core => m_emuCore; + + public AppEmu() + { + Eventer.Instance.RegisterEvent(EEvent.OnMineJoinRoom, OnSelfJoinRoom); + } + + private void OnSelfJoinRoom() + { + //如果当前正在游戏中,就先结束游戏 + if (!m_emuCore.IsNull()) StopGame(); + + var roomInfo = App.roomMgr.mineRoomMiniInfo; + roomInfo.FetchRomFileInRoomInfo(EnumPlatform.NES, (room, romFile) => + { + if (!romFile.RomReady) //这个rom并没有下载,所以取消进入房间 + { + App.roomMgr.SendLeavnRoom(); + } + else + { + BeginGame(romFile); + } + }); + } + + + public void BeginGame(RomFile romFile) + { + if (!m_emuCore.IsNull()) return; + + switch (romFile.Platform) + { + case EnumPlatform.NES: + m_emuCore = GameObject.Instantiate(Resources.Load("NES/NesEmulator")).GetComponent(); + break; + } + + m_emuCore.StartGame(romFile); + LaunchUI.Instance.HideMainMenu(); + InGameUI.Instance.Show(romFile, m_emuCore); + + m_emuCore.SetupScheme(); + } + + public void StopGame() + { + if (m_emuCore.IsNull()) return; + GameObject.Destroy(m_emuCore.gameObject); + m_emuCore = null; + + InGameUI.Instance.Hide(); + LaunchUI.Instance.ShowMainMenu(); + } + + public void ResetGame() + { + if (m_emuCore.IsNull()) return; + + m_emuCore.DoReset(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppEmu.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppEmu.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppEmu.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppLogin.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppLogin.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppLogin.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppLogin.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppLogin.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppLogin.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppLogin.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppLogin.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs new file mode 100644 index 0000000..ddb96a2 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs @@ -0,0 +1,456 @@ +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Common; +using AxibugEmuOnline.Client.Event; +using AxibugEmuOnline.Client.Network; +using AxibugProtobuf; +using AxiReplay; +using Google.Protobuf; +using System.Collections.Generic; +using System.Linq; + +namespace AxibugEmuOnline.Client.Manager +{ + public class AppRoom + { + public Protobuf_Room_MiniInfo mineRoomMiniInfo { get; private set; } = null; + public bool InRoom => mineRoomMiniInfo != null; + public bool IsHost => mineRoomMiniInfo?.HostPlayerUID == App.user.userdata.UID; + public bool IsScreenProviderUID => mineRoomMiniInfo?.ScreenProviderUID == App.user.userdata.UID; + public RoomGameState RoomState => mineRoomMiniInfo.GameState; + public int MinePlayerIdx => GetMinePlayerIndex(); + public int WaitStep { get; private set; } = -1; + public byte[] RawData { get; private set; } = null; + public NetReplay netReplay { get; private set; } + + Dictionary dictRoomListID2Info = new Dictionary(); + + struct S_PlayerMiniInfo + { + public long UID; + public string NickName; + } + + Protobuf_Room_List _Protobuf_Room_List = new Protobuf_Room_List(); + Protobuf_Room_Get_Screen _Protobuf_Room_Get_Screen = new Protobuf_Room_Get_Screen(); + Protobuf_Room_Create _Protobuf_Room_Create = new Protobuf_Room_Create(); + Protobuf_Room_Join _Protobuf_Room_Join = new Protobuf_Room_Join(); + Protobuf_Room_Leave _Protobuf_Room_Leave = new Protobuf_Room_Leave(); + Protobuf_Room_Player_Ready _Protobuf_Room_Player_Ready = new Protobuf_Room_Player_Ready(); + Protobuf_Room_SinglePlayerInputData _Protobuf_Room_SinglePlayerInputData = new Protobuf_Room_SinglePlayerInputData(); + Protobuf_Screnn_Frame _Protobuf_Screnn_Frame = new Protobuf_Screnn_Frame(); + public AppRoom() + { + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomList, RecvGetRoomList); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomListUpdate, RecvGetRoomListUpdate); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomGetScreen, RecvRoomGetScreen); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomCreate, RecvCreateRoom); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomJoin, RecvJoinRoom); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomLeave, RecvLeavnRoom); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomMyRoomStateChanged, RecvRoomMyRoomStateChange); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomWaitStep, RecvRoom_WaitStep); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomHostPlayerUpdateStateRaw, RecvHostPlayer_UpdateStateRaw); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdRoomSynPlayerInput, RecvHostSyn_RoomFrameAllInputData); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdScreen, OnScreen); + } + + #region 房间列表管理 + bool AddOrUpdateRoomList(Protobuf_Room_MiniInfo roomInfo) + { + bool bNew = !dictRoomListID2Info.ContainsKey(roomInfo.RoomID); + dictRoomListID2Info[roomInfo.RoomID] = roomInfo; + return bNew; + } + bool RemoveRoomList(int roomId) + { + if (dictRoomListID2Info.ContainsKey(roomId)) + { + dictRoomListID2Info.Remove(roomId); + return true; + } + return false; + } + /// + /// 获取单个房间MiniInfo + /// + /// + /// + /// + public bool GetRoomListMiniInfo(int roomId, out Protobuf_Room_MiniInfo MiniInfo) + { + if (dictRoomListID2Info.ContainsKey(roomId)) + { + MiniInfo = dictRoomListID2Info[roomId]; + return true; + } + MiniInfo = null; + return false; + } + public List GetRoomList() + { + List result = new List(); + foreach (var item in dictRoomListID2Info) + { + result.Add(item.Value); + } + return result; + } + #endregion + + #region Replay + public void InitRePlay() + { + netReplay = new NetReplay(); + netReplay.ResetData(); + } + public void ReleaseRePlay() + { + netReplay.ResetData(); + } + #endregion + + #region 房间管理 + int GetMinePlayerIndex() + { + if (mineRoomMiniInfo == null) + return -1; + + if (mineRoomMiniInfo.Player1UID == App.user.userdata.UID) + return 0; + if (mineRoomMiniInfo.Player2UID == App.user.userdata.UID) + return 1; + if (mineRoomMiniInfo.Player3UID == App.user.userdata.UID) + return 2; + if (mineRoomMiniInfo.Player4UID == App.user.userdata.UID) + return 3; + return -1; + } + + long[] GetRoom4PlayerUIDs() + { + if (mineRoomMiniInfo == null) + return null; + long[] result = new long[4]; + if (mineRoomMiniInfo.Player1UID > 0) + result[0] = mineRoomMiniInfo.Player1UID; + if (mineRoomMiniInfo.Player2UID > 0) + result[1] = mineRoomMiniInfo.Player2UID; + if (mineRoomMiniInfo.Player3UID > 0) + result[2] = mineRoomMiniInfo.Player3UID; + if (mineRoomMiniInfo.Player4UID > 0) + result[3] = mineRoomMiniInfo.Player4UID; + return result; + } + + S_PlayerMiniInfo[] GetRoom4PlayerMiniInfos() + { + if (mineRoomMiniInfo == null) + return null; + S_PlayerMiniInfo[] result = new S_PlayerMiniInfo[4]; + if (mineRoomMiniInfo.Player1UID > 0) + { + result[0].UID = mineRoomMiniInfo.Player1UID; + result[0].NickName = mineRoomMiniInfo.Player1NickName; + } + if (mineRoomMiniInfo.Player2UID > 0) + { + result[1].UID = mineRoomMiniInfo.Player2UID; + result[1].NickName = mineRoomMiniInfo.Player2NickName; + } + if (mineRoomMiniInfo.Player3UID > 0) + { + result[2].UID = mineRoomMiniInfo.Player3UID; + result[2].NickName = mineRoomMiniInfo.Player3NickName; + } + if (mineRoomMiniInfo.Player4UID > 0) + { + result[3].UID = mineRoomMiniInfo.Player4UID; + result[3].NickName = mineRoomMiniInfo.Player4NickName; + } + return result; + } + + #endregion + + /// + /// 获取所有房间列表 + /// + /// + public void SendGetRoomList() + { + App.log.Info("拉取房间列表"); + App.network.SendToServer((int)CommandID.CmdRoomList, ProtoBufHelper.Serizlize(_Protobuf_Room_List)); + } + + /// + /// 获取所有房间列表 + /// + /// + void RecvGetRoomList(byte[] reqData) + { + App.log.Info("取得完整房间列表"); + Protobuf_Room_List_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + for (int i = 0; i < msg.RoomMiniInfoList.Count; i++) + AddOrUpdateRoomList(msg.RoomMiniInfoList[i]); + Eventer.Instance.PostEvent(EEvent.OnRoomListAllUpdate); + } + + /// + /// 获取单个列表更新 + /// + /// + void RecvGetRoomListUpdate(byte[] reqData) + { + App.log.Debug("单个房间状态更新"); + Protobuf_Room_Update_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + if (msg.UpdateType == 0) + { + if (AddOrUpdateRoomList(msg.RoomMiniInfo)) + { + Eventer.Instance.PostEvent(EEvent.OnRoomListSingleAdd, msg.RoomMiniInfo.RoomID); + } + else + { + Eventer.Instance.PostEvent(EEvent.OnRoomListSingleUpdate, msg.RoomMiniInfo.RoomID); + } + } + else + { + RemoveRoomList(msg.RoomMiniInfo.RoomID); + Eventer.Instance.PostEvent(EEvent.OnRoomListSingleClose, msg.RoomMiniInfo.RoomID); + } + } + + /// + /// 获取房间画面快照 + /// + /// + public void SendGetRoomScreen(int RoomID) + { + _Protobuf_Room_Get_Screen.RoomID = RoomID; + App.log.Info($"获取房间画面快照"); + App.network.SendToServer((int)CommandID.CmdRoomGetScreen, ProtoBufHelper.Serizlize(_Protobuf_Room_Get_Screen)); + } + /// + /// 获取单个房间画面 + /// + /// + void RecvRoomGetScreen(byte[] reqData) + { + App.log.Debug("单个房间状态更新"); + Protobuf_Room_Get_Screen_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + //解压 + byte[] data = Helper.DecompressByteArray(msg.RawBitmap.ToArray()); + Eventer.Instance.PostEvent(EEvent.OnRoomGetRoomScreen, msg.RoomID, data); + } + + /// + /// 创建房间 + /// + /// + /// + /// + public void SendCreateRoom(int GameRomID, int JoinPlayerIdx, string GameRomHash = null) + { + _Protobuf_Room_Create.JoinPlayerIdx = JoinPlayerIdx; + _Protobuf_Room_Create.GameRomID = GameRomID; + _Protobuf_Room_Create.GameRomHash = GameRomHash; + App.log.Info($"创建房间"); + App.network.SendToServer((int)CommandID.CmdRoomCreate, ProtoBufHelper.Serizlize(_Protobuf_Room_Create)); + } + + /// + /// 创建房间成功 + /// + /// + void RecvCreateRoom(byte[] reqData) + { + App.log.Debug("创建房间成功"); + Protobuf_Room_Create_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + mineRoomMiniInfo = msg.RoomMiniInfo; + InitRePlay(); + } + + /// + /// 创建房间 + /// + /// + /// + /// + public void SendJoinRoom(int RoomID, int JoinPlayerIdx) + { + _Protobuf_Room_Join.RoomID = RoomID; + _Protobuf_Room_Join.PlayerNum = JoinPlayerIdx; + App.log.Info($"创建房间"); + App.network.SendToServer((int)CommandID.CmdRoomJoin, ProtoBufHelper.Serizlize(_Protobuf_Room_Join)); + } + + /// + /// 加入房间成功 + /// + /// + void RecvJoinRoom(byte[] reqData) + { + App.log.Debug("加入房间成功"); + Protobuf_Room_Join_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + mineRoomMiniInfo = msg.RoomMiniInfo; + InitRePlay(); + Eventer.Instance.PostEvent(EEvent.OnMineJoinRoom); + } + + /// + /// 离开房间 + /// + /// + public void SendLeavnRoom() + { + if (!InRoom) + return; + _Protobuf_Room_Leave.RoomID = mineRoomMiniInfo.RoomID; + App.log.Info($"LeavnRoom"); + App.network.SendToServer((int)CommandID.CmdRoomLeave, ProtoBufHelper.Serizlize(_Protobuf_Room_Leave)); + } + + /// + /// 离开房间成功 + /// + /// + void RecvLeavnRoom(byte[] reqData) + { + App.log.Debug("离开房间成功"); + Protobuf_Room_Leave_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + ReleaseRePlay(); + mineRoomMiniInfo = null; + Eventer.Instance.PostEvent(EEvent.OnMineLeavnRoom); + } + + void RecvRoomMyRoomStateChange(byte[] reqData) + { + Protobuf_Room_MyRoom_State_Change msg = ProtoBufHelper.DeSerizlize(reqData); + long[] oldRoomPlayer = GetRoom4PlayerUIDs(); + mineRoomMiniInfo = msg.RoomMiniInfo; + long[] newRoomPlayer = GetRoom4PlayerUIDs(); + for (int i = 0; i < 4; i++) + { + long OldPlayer = oldRoomPlayer[i]; + long NewPlayer = newRoomPlayer[i]; + if (OldPlayer == NewPlayer) + continue; + //位置之前有人,但是离开了 + if (OldPlayer > 0) + { + Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer); + if (NewPlayer > 0)//而且害换了一个玩家 + Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); + } + else //之前没人 + Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); + } + } + + /// + /// 上报即时存档 + /// + /// + public void SendHostRaw(byte[] RawData) + { + //压缩 + byte[] compressRawData = Helper.CompressByteArray(RawData); + Protobuf_Room_HostPlayer_UpdateStateRaw msg = new Protobuf_Room_HostPlayer_UpdateStateRaw() + { + LoadStateRaw = Google.Protobuf.ByteString.CopyFrom(compressRawData) + }; + App.log.Info($"上报即时存档数据 原数据大小:{RawData.Length},压缩后;{compressRawData.Length}"); + App.network.SendToServer((int)CommandID.CmdRoomHostPlayerUpdateStateRaw, ProtoBufHelper.Serizlize(msg)); + } + + void RecvRoom_WaitStep(byte[] reqData) + { + Protobuf_Room_WaitStep_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + if (WaitStep != msg.WaitStep) + { + WaitStep = msg.WaitStep; + if (WaitStep == 1) + { + byte[] decompressRawData = Helper.DecompressByteArray(msg.LoadStateRaw.ToByteArray()); + App.log.Info($"收到即时存档数据 解压后;{decompressRawData.Length}"); + RawData = decompressRawData; + ReleaseRePlay(); + } + Eventer.Instance.PostEvent(EEvent.OnRoomWaitStepChange, WaitStep); + } + } + + void RecvHostPlayer_UpdateStateRaw(byte[] reqData) + { + Protobuf_Room_HostPlayer_UpdateStateRaw_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + App.log.Info($"鸡翅孙当上报成功"); + } + + /// + /// 即时存档加载完毕 + /// + public void SendRoomPlayerReady() + { + App.log.Debug("上报准备完毕"); + App.network.SendToServer((int)CommandID.CmdRoomPlayerReady, ProtoBufHelper.Serizlize(_Protobuf_Room_Player_Ready)); + } + + /// + /// 同步上行 + /// + public void SendRoomSingelPlayerInput(uint FrameID, uint InputData) + { + _Protobuf_Room_SinglePlayerInputData.FrameID = FrameID; + _Protobuf_Room_SinglePlayerInputData.InputData = InputData; + App.network.SendToServer((int)CommandID.CmdRoomSingelPlayerInput, ProtoBufHelper.Serizlize(_Protobuf_Room_SinglePlayerInputData)); + } + + ulong TestAllData = 0; + void RecvHostSyn_RoomFrameAllInputData(byte[] reqData) + { + Protobuf_Room_Syn_RoomFrameAllInputData msg = ProtoBufHelper.DeSerizlize(reqData); + if (TestAllData != msg.InputData) + { + TestAllData = msg.InputData; + App.log.Debug($"ServerFrameID->{msg.ServerFrameID} FrameID->{msg.FrameID} ClientFrame->{netReplay.mCurrClientFrameIdx} InputData->{msg.InputData}"); + } + netReplay.InData(new ReplayStep() { FrameStartID = (int)msg.FrameID, InPut = msg.InputData }, (int)msg.ServerFrameID); + } + + public void SendScreen(byte[] RenderBuffer) + { + //压缩 + byte[] comData = Helper.CompressByteArray(RenderBuffer); + _Protobuf_Screnn_Frame.FrameID = 0; + _Protobuf_Screnn_Frame.RawBitmap = ByteString.CopyFrom(comData); + App.network.SendToServer((int)CommandID.CmdScreen, ProtoBufHelper.Serizlize(_Protobuf_Screnn_Frame)); + } + + public void OnScreen(byte[] reqData) + { + Protobuf_Screnn_Frame msg = ProtoBufHelper.DeSerizlize(reqData); + //解压 + byte[] data = Helper.DecompressByteArray(msg.RawBitmap.ToArray()); + } + } + + public static class RoomEX + { + /// + /// 获取房间空闲席位下标 (返回True表示由余位) + /// + /// + /// + /// + public static bool GetFreeSlot(this Protobuf_Room_MiniInfo roomMiniInfo, out int[] freeSlots) + { + List temp = new List(); + if (roomMiniInfo.Player1UID <= 0) temp.Add(0); + if (roomMiniInfo.Player2UID <= 0) temp.Add(1); + if (roomMiniInfo.Player3UID <= 0) temp.Add(2); + if (roomMiniInfo.Player4UID <= 0) temp.Add(3); + freeSlots = temp.ToArray(); + return freeSlots.Length > 0; + } + } +} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs.meta new file mode 100644 index 0000000..09c0f66 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppRoom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32566452eb52f484d92619b539b1d70f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/AppSettings.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/AppSettings.cs index 7816fb6..80da9e4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/AppSettings.cs @@ -1,8 +1,8 @@ -namespace AxibugEmuOnline.Client -{ - public class AppSettings - { - /// 背景颜色设定 - public BgColorSettings BgColor { get; set; } = new BgColorSettings(); - } -} +namespace AxibugEmuOnline.Client +{ + public class AppSettings + { + /// 背景颜色设定 + public BgColorSettings BgColor { get; set; } = new BgColorSettings(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/AppSettings.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/AppSettings.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/AppSettings.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/BgColorSettings.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/BgColorSettings.cs index c48c68a..1488881 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/BgColorSettings.cs @@ -1,83 +1,83 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - /// 颜色设置 - public class BgColorSettings - { - public delegate void OnColorChangedHandle(XMBColor color); - public event OnColorChangedHandle OnColorChanged; - - /// 当前颜色 - public XMBColor CurrentColor - { - get - { - var color1 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", null); - var color2 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", null); - var name = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", null); - if (string.IsNullOrWhiteSpace(color1) || string.IsNullOrWhiteSpace(color2) || string.IsNullOrWhiteSpace(name)) - return DEFAULT; - else - return new XMBColor(name, color1, color2); - } - set - { - PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", $"#{ColorUtility.ToHtmlStringRGB(value.color1)}"); - PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", $"#{ColorUtility.ToHtmlStringRGB(value.color2)}"); - PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", value.Name); - - OnColorChanged?.Invoke(value); - } - } - - private static readonly XMBColor DEFAULT = new XMBColor("蓝", "#020754", "#0ab1dc"); - public List Presets { get; private set; } = new List() - { - DEFAULT, - new XMBColor("白","#8a9fb2","#4e9eb6"), - new XMBColor("黄","#987500","#d1a813"), - new XMBColor("绿","#3e962b","#7ac25e"), - new XMBColor("粉","#e65a8b","#c7acc6"), - new XMBColor("墨绿","#00421a","#1c951f"), - new XMBColor("紫","#633f93","#8763cc"), - new XMBColor("天蓝","#038baa","#0ca2c2"), - new XMBColor("红","#9c120e","#d73611"), - }; - } - - - public struct XMBColor - { - public string Name; - public Color color1; - public Color color2; - - public XMBColor(string name, string colorCodeStr1, string colorCodeStr2) - { - Name = name; - ColorUtility.TryParseHtmlString(colorCodeStr1, out color1); - ColorUtility.TryParseHtmlString(colorCodeStr2, out color2); - } - - public static XMBColor Lerp(XMBColor start, XMBColor endColor, float t) - { - var result = new XMBColor(); - result.Name = endColor.Name; - result.color1 = Color.Lerp(start.color1, endColor.color1, t); - result.color2 = Color.Lerp(start.color2, endColor.color2, t); - - return result; - } - - public override int GetHashCode() - { - int hash = 17; - hash = hash * 23 + (Name != null ? Name.GetHashCode() : 0); - hash = hash * 23 + color1.GetHashCode(); - hash = hash * 23 + color2.GetHashCode(); - return hash; - } - } -} +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + /// 颜色设置 + public class BgColorSettings + { + public delegate void OnColorChangedHandle(XMBColor color); + public event OnColorChangedHandle OnColorChanged; + + /// 当前颜色 + public XMBColor CurrentColor + { + get + { + var color1 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", null); + var color2 = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", null); + var name = PlayerPrefs.GetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", null); + if (string.IsNullOrWhiteSpace(color1) || string.IsNullOrWhiteSpace(color2) || string.IsNullOrWhiteSpace(name)) + return DEFAULT; + else + return new XMBColor(name, color1, color2); + } + set + { + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color1)}", $"#{ColorUtility.ToHtmlStringRGB(value.color1)}"); + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.color2)}", $"#{ColorUtility.ToHtmlStringRGB(value.color2)}"); + PlayerPrefs.SetString($"{nameof(BgColorSettings)}.{nameof(CurrentColor)}.{nameof(CurrentColor.Name)}", value.Name); + + OnColorChanged?.Invoke(value); + } + } + + private static readonly XMBColor DEFAULT = new XMBColor("蓝", "#020754", "#0ab1dc"); + public List Presets { get; private set; } = new List() + { + DEFAULT, + new XMBColor("白","#8a9fb2","#4e9eb6"), + new XMBColor("黄","#987500","#d1a813"), + new XMBColor("绿","#3e962b","#7ac25e"), + new XMBColor("粉","#e65a8b","#c7acc6"), + new XMBColor("墨绿","#00421a","#1c951f"), + new XMBColor("紫","#633f93","#8763cc"), + new XMBColor("天蓝","#038baa","#0ca2c2"), + new XMBColor("红","#9c120e","#d73611"), + }; + } + + + public struct XMBColor + { + public string Name; + public Color color1; + public Color color2; + + public XMBColor(string name, string colorCodeStr1, string colorCodeStr2) + { + Name = name; + ColorUtility.TryParseHtmlString(colorCodeStr1, out color1); + ColorUtility.TryParseHtmlString(colorCodeStr2, out color2); + } + + public static XMBColor Lerp(XMBColor start, XMBColor endColor, float t) + { + var result = new XMBColor(); + result.Name = endColor.Name; + result.color1 = Color.Lerp(start.color1, endColor.color1, t); + result.color2 = Color.Lerp(start.color2, endColor.color2, t); + + return result; + } + + public override int GetHashCode() + { + int hash = 17; + hash = hash * 23 + (Name != null ? Name.GetHashCode() : 0); + hash = hash * 23 + color1.GetHashCode(); + hash = hash * 23 + color2.GetHashCode(); + return hash; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/BgColorSettings.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppSettings/BgColorSettings.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/BgColorSettings.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppShare.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppShare.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppShare.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/AppShare.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppShare.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/CacheManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Manager/CacheManager.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs index b481454..2b91c87 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/CacheManager.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs @@ -1,103 +1,103 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using UnityEngine; -using UnityEngine.Networking; - -namespace AxibugEmuOnline.Client -{ - public class CacheManager - { - static readonly string CacheDirPath = $"{App.PersistentDataPath}/Caches"; - static readonly string TextureCacheDirPath = $"{CacheDirPath}/Texture"; - - public void GetSpriteCache(string url, Action callback) - { - GetCacheData(url, TextureCacheDirPath, callback); - } - - /// Ƴļ - public void ClearCaches() - { - if (Directory.Exists(CacheDirPath)) - Directory.Delete(CacheDirPath, true); - } - - IEnumerator DownloadFromURL(string url, string path, Action callback) - { - var request = UnityWebRequest.Get($"{App.httpAPI.WebHost}/{url}"); - yield return request.SendWebRequest(); - - if (request.result == UnityWebRequest.Result.Success) - { - Directory.CreateDirectory(path); - File.WriteAllBytes($"{path}/{url.GetHashCode()}", request.downloadHandler.data); - callback.Invoke(request.downloadHandler.data); - } - else - callback.Invoke(null); - } - - private Dictionary cachesInMemory = new Dictionary(); - void GetCacheData(string url, string path, Action callback) where T : class - { - if (cachesInMemory.TryGetValue(url, out var cacheObj) && cacheObj is T obj) - { - callback.Invoke(obj, url); - return; - } - - var fileName = $"{url.GetHashCode()}"; - byte[] rawData = null; - - var filePath = $"{path}/{fileName}"; - if (File.Exists(filePath)) - { - rawData = File.ReadAllBytes(filePath); - var @out = RawDataConvert(rawData); - cachesInMemory[url] = @out; - callback.Invoke(@out, url); - } - else - { - App.StartCoroutine(DownloadFromURL(url, path, (data) => - { - var @out = RawDataConvert(data); - cachesInMemory[url] = @out; - callback.Invoke(@out, url); - })); - } - } - - Type t_texture2d = typeof(Texture2D); - Type t_sprite = typeof(Sprite); - Type t_byteArray = typeof(byte[]); - Type t_object = typeof(object); - - T RawDataConvert(byte[] data) where T : class - { - var vt = typeof(T); - - if (vt == t_texture2d || vt == t_sprite) - { - Texture2D texture = new Texture2D(2, 2); - texture.LoadImage(data); - - if (vt == t_texture2d) return texture as T; - else return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)) as T; - } - else if (vt == t_byteArray) - { - return data as T; - } - else - { - return data as T; - } - - throw new NotImplementedException($"{vt.Name}"); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEngine.Networking; + +namespace AxibugEmuOnline.Client +{ + public class CacheManager + { + static readonly string CacheDirPath = $"{App.PersistentDataPath}/Caches"; + static readonly string TextureCacheDirPath = $"{CacheDirPath}/Texture"; + + public void GetSpriteCache(string url, Action callback) + { + GetCacheData(url, TextureCacheDirPath, callback); + } + + /// Ƴļ + public void ClearCaches() + { + if (Directory.Exists(CacheDirPath)) + Directory.Delete(CacheDirPath, true); + } + + IEnumerator DownloadFromURL(string url, string path, Action callback) + { + var request = UnityWebRequest.Get($"{App.httpAPI.WebHost}/{url}"); + yield return request.SendWebRequest(); + + if (request.result == UnityWebRequest.Result.Success) + { + Directory.CreateDirectory(path); + File.WriteAllBytes($"{path}/{url.GetHashCode()}", request.downloadHandler.data); + callback.Invoke(request.downloadHandler.data); + } + else + callback.Invoke(null); + } + + private Dictionary cachesInMemory = new Dictionary(); + void GetCacheData(string url, string path, Action callback) where T : class + { + if (cachesInMemory.TryGetValue(url, out var cacheObj) && cacheObj is T obj) + { + callback.Invoke(obj, url); + return; + } + + var fileName = $"{url.GetHashCode()}"; + byte[] rawData = null; + + var filePath = $"{path}/{fileName}"; + if (File.Exists(filePath)) + { + rawData = File.ReadAllBytes(filePath); + var @out = RawDataConvert(rawData); + cachesInMemory[url] = @out; + callback.Invoke(@out, url); + } + else + { + App.StartCoroutine(DownloadFromURL(url, path, (data) => + { + var @out = RawDataConvert(data); + cachesInMemory[url] = @out; + callback.Invoke(@out, url); + })); + } + } + + Type t_texture2d = typeof(Texture2D); + Type t_sprite = typeof(Sprite); + Type t_byteArray = typeof(byte[]); + Type t_object = typeof(object); + + T RawDataConvert(byte[] data) where T : class + { + var vt = typeof(T); + + if (vt == t_texture2d || vt == t_sprite) + { + Texture2D texture = new Texture2D(2, 2); + texture.LoadImage(data); + + if (vt == t_texture2d) return texture as T; + else return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)) as T; + } + else if (vt == t_byteArray) + { + return data as T; + } + else + { + return data as T; + } + + throw new NotImplementedException($"{vt.Name}"); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/CacheManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/CacheManager.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CacheManager.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/CoroutineRunner.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CoroutineRunner.cs similarity index 93% rename from AxibugEmuOnline.Client/Assets/Script/Manager/CoroutineRunner.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CoroutineRunner.cs index c6541b8..146f10f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/CoroutineRunner.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CoroutineRunner.cs @@ -1,8 +1,8 @@ -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class CoroutineRunner : MonoBehaviour - { - } -} +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class CoroutineRunner : MonoBehaviour + { + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/CoroutineRunner.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CoroutineRunner.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/CoroutineRunner.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/CoroutineRunner.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/FilterManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/FilterManager.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Manager/FilterManager.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/FilterManager.cs index 9478469..dffc6fb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/FilterManager.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/FilterManager.cs @@ -1,343 +1,343 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using UnityEngine.Rendering.PostProcessing; -using static AxibugEmuOnline.Client.FilterEffect; - -namespace AxibugEmuOnline.Client -{ - public class FilterManager - { - private PostProcessProfile m_filterPorfile; - private List m_filters; - private Dictionary m_filterPlatforms = new Dictionary(); - private AlphaWraper m_previewFilterWraper; - FilterRomSetting m_filterRomSetting; - /// - /// 滤镜列表 - /// - public IReadOnlyList Filters => m_filters; - - public FilterManager(PostProcessVolume filterVolume, CanvasGroup filterPreview, CanvasGroup mainBg) - { - m_filterPorfile = filterVolume.profile; - m_filters = m_filterPorfile.settings.Where(setting => setting is FilterEffect).Select(setting => new Filter(setting as FilterEffect)).ToList(); - var json = PlayerPrefs.GetString(nameof(FilterRomSetting)); - m_filterRomSetting = JsonUtility.FromJson(json) ?? new FilterRomSetting(); - - m_previewFilterWraper = new AlphaWraper(mainBg, filterPreview, false); - ShutDownFilterPreview(); - ShutDownFilter(); - } - - /// 关闭滤镜预览 - public void ShutDownFilterPreview() - { - m_previewFilterWraper.On = false; - } - - /// 开启滤镜预览 - public void EnableFilterPreview() - { - m_previewFilterWraper.On = true; - } - - /// - /// 打开滤镜 - /// - /// - public void EnableFilter(Filter filter) - { - foreach (var selfFiler in Filters) - { - if (selfFiler != filter) selfFiler.m_setting.enabled.Override(false); - else selfFiler.m_setting.enabled.Override(true); - } - } - - /// - /// 关闭滤镜效果 - /// - public void ShutDownFilter() - { - //关闭所有后处理效果 - foreach (var setting in m_filterPorfile.settings) - setting.enabled.Override(false); - } - - /// - /// 为指定rom设置滤镜以及滤镜的预设 - /// - /// rom对象 - /// 滤镜 - /// 滤镜预设 - public void SetupFilter(RomFile rom, Filter filter, FilterPreset preset) - { - m_filterRomSetting.Setup(rom, filter, preset); - - string json = m_filterRomSetting.ToJson(); - PlayerPrefs.SetString(nameof(FilterRomSetting), json); - } - - /// - /// 获得指定rom配置的滤镜设置 - /// - /// rom对象 - /// 此元组任意内任意成员都有可能为空 - public (Filter filter, FilterPreset preset) GetFilterSetting(RomFile rom) - { - var value = m_filterRomSetting.Get(rom); - Filter filter = null; - FilterPreset preset = null; - - filter = Filters.FirstOrDefault(f => f.Name == value.filterName); - if (filter != null) - { - string presetName = value.presetName; - preset = filter.Presets.FirstOrDefault(p => p.Name == presetName); - } - - return (filter, preset); - } - - public class Filter - { - public string Name => m_setting.Name; - public IReadOnlyCollection Paramerters => m_setting.EditableParam; - /// 滤镜预设 - public List Presets = new List(); - /// 滤镜默认预设 - public FilterPreset DefaultPreset = new FilterPreset("DEFAULT"); - - internal FilterEffect m_setting; - - public Filter(FilterEffect setting) - { - m_setting = setting; - - loadPresets(); - } - - private void loadPresets() - { - var json = PlayerPrefs.GetString($"Filter_{Name}_PresetList", string.Empty); - var loadedPresets = JsonUtility.FromJson(json); - if (loadedPresets == null) return; - else Presets = loadedPresets.presets; - } - - public void SavePresets() - { - var json = JsonUtility.ToJson(new FilterPresetList(Presets)); - PlayerPrefs.SetString($"Filter_{Name}_PresetList", json); - } - - public MsgBool CreatePreset(string presetName, out FilterPreset newPreset) - { - newPreset = null; - if (string.IsNullOrWhiteSpace(presetName)) return "名称不能为空"; - if (Presets.Count(p => p.Name == presetName) != 0) return "名称重复"; - - newPreset = new FilterPreset(presetName); - Presets.Add(newPreset); - - SavePresets(); - - return true; - } - - public void RemovePreset(FilterPreset preset) - { - if (!Presets.Remove(preset)) return; - SavePresets(); - - EventInvoker.RaiseFilterPresetRemoved(this, preset); - } - - public void ResetPreset() - { - foreach (var param in Paramerters) - { - param.ResetToDefault(); - } - } - - public void ApplyPreset(FilterPreset preset) - { - foreach (var param in Paramerters) - { - var value = preset.GetParamValue(param.Name, param.ValueType); - if (value == null) - param.ResetToDefault(); - else - param.Apply(value); - } - - } - - - } - - [Serializable] - private class FilterPresetList - { - public List presets; - - public FilterPresetList(List presets) - { - this.presets = presets; - foreach (var preset in presets) - { - preset.ReadyForJson(); - } - } - } - - [Serializable] - public class FilterPreset - { - [SerializeField] - public string Name; - [SerializeField] - private List m_paramName = new List(); - [SerializeField] - private List m_valueJson = new List(); - - private bool m_cacheReady = false; - private Dictionary m_paramName2ValueJson; - public FilterPreset(string presetName) - { - Name = presetName; - } - - public void ReadyForJson() - { - prepareCache(); - - m_paramName = m_paramName2ValueJson.Keys.ToList(); - m_valueJson = m_paramName2ValueJson.Values.ToList(); - } - - public string GetParamValueJson(string paramName) - { - prepareCache(); - - m_paramName2ValueJson.TryGetValue(paramName, out var value); - return value; - } - - public object GetParamValue(string paramName, Type valueType) - { - var rawStr = GetParamValueJson(paramName); - if (rawStr == null) return null; - - if (valueType == typeof(float)) - { - float.TryParse(rawStr, out var floatVal); - return floatVal; - } - else if (valueType.IsEnum) - { - var names = Enum.GetNames(valueType); - var values = Enum.GetValues(valueType); - - for (int i = 0; i < names.Length; i++) - { - if (names[i].Equals(rawStr)) - { - return values.GetValue(i); - } - } - return null; - } - else - { - App.log.Error($"尚未支持的滤镜参数类型{valueType}"); - return null; - } - } - - public void SetParamValue(string paramName, Type valueType, object value) - { - prepareCache(); - m_paramName2ValueJson[paramName] = value.ToString(); - } - - private void prepareCache() - { - if (m_cacheReady) return; - - m_paramName2ValueJson = new Dictionary(); - for (int i = 0; i < m_paramName.Count; i++) - { - m_paramName2ValueJson[m_paramName[i]] = m_valueJson[i]; - } - - m_cacheReady = true; - } - } - - [Serializable] - public class FilterRomSetting - { - [SerializeField] - private List m_romID; - [SerializeField] - private List m_items; - - bool m_cacheReady = false; - Dictionary m_cache; - - public void Setup(RomFile rom, Filter filter, FilterPreset preset) - { - prepareCache(); - - if (filter == null) - m_cache.Remove(rom.ID); - else - m_cache[rom.ID] = new Item { FilterName = filter.Name, PresetName = preset != null ? preset.Name : null }; - } - - public string ToJson() - { - prepareCache(); - m_romID = m_cache.Keys.ToList(); - m_items = m_cache.Values.ToList(); - - return JsonUtility.ToJson(this); - } - - public (string filterName, string presetName) Get(RomFile rom) - { - prepareCache(); - - m_cache.TryGetValue(rom.ID, out var item); - return (item.FilterName, item.PresetName); - } - - private void prepareCache() - { - if (m_cacheReady) return; - - if (m_items == null) m_items = new List(); - if (m_romID == null) m_romID = new List(); - m_cache = new Dictionary(); - for (int i = 0; i < m_romID.Count && i < m_items.Count; i++) - { - m_cache[m_romID[i]] = m_items[i]; - } - - m_cacheReady = true; - } - - [Serializable] - struct Item - { - public string FilterName; - public string PresetName; - } - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.Rendering.PostProcessing; +using static AxibugEmuOnline.Client.FilterEffect; + +namespace AxibugEmuOnline.Client +{ + public class FilterManager + { + private PostProcessProfile m_filterPorfile; + private List m_filters; + private Dictionary m_filterPlatforms = new Dictionary(); + private AlphaWraper m_previewFilterWraper; + FilterRomSetting m_filterRomSetting; + /// + /// 滤镜列表 + /// + public IReadOnlyList Filters => m_filters; + + public FilterManager(PostProcessVolume filterVolume, CanvasGroup filterPreview, CanvasGroup mainBg) + { + m_filterPorfile = filterVolume.profile; + m_filters = m_filterPorfile.settings.Where(setting => setting is FilterEffect).Select(setting => new Filter(setting as FilterEffect)).ToList(); + var json = PlayerPrefs.GetString(nameof(FilterRomSetting)); + m_filterRomSetting = JsonUtility.FromJson(json) ?? new FilterRomSetting(); + + m_previewFilterWraper = new AlphaWraper(mainBg, filterPreview, false); + ShutDownFilterPreview(); + ShutDownFilter(); + } + + /// 关闭滤镜预览 + public void ShutDownFilterPreview() + { + m_previewFilterWraper.On = false; + } + + /// 开启滤镜预览 + public void EnableFilterPreview() + { + m_previewFilterWraper.On = true; + } + + /// + /// 打开滤镜 + /// + /// + public void EnableFilter(Filter filter) + { + foreach (var selfFiler in Filters) + { + if (selfFiler != filter) selfFiler.m_setting.enabled.Override(false); + else selfFiler.m_setting.enabled.Override(true); + } + } + + /// + /// 关闭滤镜效果 + /// + public void ShutDownFilter() + { + //关闭所有后处理效果 + foreach (var setting in m_filterPorfile.settings) + setting.enabled.Override(false); + } + + /// + /// 为指定rom设置滤镜以及滤镜的预设 + /// + /// rom对象 + /// 滤镜 + /// 滤镜预设 + public void SetupFilter(RomFile rom, Filter filter, FilterPreset preset) + { + m_filterRomSetting.Setup(rom, filter, preset); + + string json = m_filterRomSetting.ToJson(); + PlayerPrefs.SetString(nameof(FilterRomSetting), json); + } + + /// + /// 获得指定rom配置的滤镜设置 + /// + /// rom对象 + /// 此元组任意内任意成员都有可能为空 + public (Filter filter, FilterPreset preset) GetFilterSetting(RomFile rom) + { + var value = m_filterRomSetting.Get(rom); + Filter filter = null; + FilterPreset preset = null; + + filter = Filters.FirstOrDefault(f => f.Name == value.filterName); + if (filter != null) + { + string presetName = value.presetName; + preset = filter.Presets.FirstOrDefault(p => p.Name == presetName); + } + + return (filter, preset); + } + + public class Filter + { + public string Name => m_setting.Name; + public IReadOnlyCollection Paramerters => m_setting.EditableParam; + /// 滤镜预设 + public List Presets = new List(); + /// 滤镜默认预设 + public FilterPreset DefaultPreset = new FilterPreset("DEFAULT"); + + internal FilterEffect m_setting; + + public Filter(FilterEffect setting) + { + m_setting = setting; + + loadPresets(); + } + + private void loadPresets() + { + var json = PlayerPrefs.GetString($"Filter_{Name}_PresetList", string.Empty); + var loadedPresets = JsonUtility.FromJson(json); + if (loadedPresets == null) return; + else Presets = loadedPresets.presets; + } + + public void SavePresets() + { + var json = JsonUtility.ToJson(new FilterPresetList(Presets)); + PlayerPrefs.SetString($"Filter_{Name}_PresetList", json); + } + + public MsgBool CreatePreset(string presetName, out FilterPreset newPreset) + { + newPreset = null; + if (string.IsNullOrWhiteSpace(presetName)) return "名称不能为空"; + if (Presets.Count(p => p.Name == presetName) != 0) return "名称重复"; + + newPreset = new FilterPreset(presetName); + Presets.Add(newPreset); + + SavePresets(); + + return true; + } + + public void RemovePreset(FilterPreset preset) + { + if (!Presets.Remove(preset)) return; + SavePresets(); + + EventInvoker.RaiseFilterPresetRemoved(this, preset); + } + + public void ResetPreset() + { + foreach (var param in Paramerters) + { + param.ResetToDefault(); + } + } + + public void ApplyPreset(FilterPreset preset) + { + foreach (var param in Paramerters) + { + var value = preset.GetParamValue(param.Name, param.ValueType); + if (value == null) + param.ResetToDefault(); + else + param.Apply(value); + } + + } + + + } + + [Serializable] + private class FilterPresetList + { + public List presets; + + public FilterPresetList(List presets) + { + this.presets = presets; + foreach (var preset in presets) + { + preset.ReadyForJson(); + } + } + } + + [Serializable] + public class FilterPreset + { + [SerializeField] + public string Name; + [SerializeField] + private List m_paramName = new List(); + [SerializeField] + private List m_valueJson = new List(); + + private bool m_cacheReady = false; + private Dictionary m_paramName2ValueJson; + public FilterPreset(string presetName) + { + Name = presetName; + } + + public void ReadyForJson() + { + prepareCache(); + + m_paramName = m_paramName2ValueJson.Keys.ToList(); + m_valueJson = m_paramName2ValueJson.Values.ToList(); + } + + public string GetParamValueJson(string paramName) + { + prepareCache(); + + m_paramName2ValueJson.TryGetValue(paramName, out var value); + return value; + } + + public object GetParamValue(string paramName, Type valueType) + { + var rawStr = GetParamValueJson(paramName); + if (rawStr == null) return null; + + if (valueType == typeof(float)) + { + float.TryParse(rawStr, out var floatVal); + return floatVal; + } + else if (valueType.IsEnum) + { + var names = Enum.GetNames(valueType); + var values = Enum.GetValues(valueType); + + for (int i = 0; i < names.Length; i++) + { + if (names[i].Equals(rawStr)) + { + return values.GetValue(i); + } + } + return null; + } + else + { + App.log.Error($"尚未支持的滤镜参数类型{valueType}"); + return null; + } + } + + public void SetParamValue(string paramName, Type valueType, object value) + { + prepareCache(); + m_paramName2ValueJson[paramName] = value.ToString(); + } + + private void prepareCache() + { + if (m_cacheReady) return; + + m_paramName2ValueJson = new Dictionary(); + for (int i = 0; i < m_paramName.Count; i++) + { + m_paramName2ValueJson[m_paramName[i]] = m_valueJson[i]; + } + + m_cacheReady = true; + } + } + + [Serializable] + public class FilterRomSetting + { + [SerializeField] + private List m_romID; + [SerializeField] + private List m_items; + + bool m_cacheReady = false; + Dictionary m_cache; + + public void Setup(RomFile rom, Filter filter, FilterPreset preset) + { + prepareCache(); + + if (filter == null) + m_cache.Remove(rom.ID); + else + m_cache[rom.ID] = new Item { FilterName = filter.Name, PresetName = preset != null ? preset.Name : null }; + } + + public string ToJson() + { + prepareCache(); + m_romID = m_cache.Keys.ToList(); + m_items = m_cache.Values.ToList(); + + return JsonUtility.ToJson(this); + } + + public (string filterName, string presetName) Get(RomFile rom) + { + prepareCache(); + + m_cache.TryGetValue(rom.ID, out var item); + return (item.FilterName, item.PresetName); + } + + private void prepareCache() + { + if (m_cacheReady) return; + + if (m_items == null) m_items = new List(); + if (m_romID == null) m_romID = new List(); + m_cache = new Dictionary(); + for (int i = 0; i < m_romID.Count && i < m_items.Count; i++) + { + m_cache[m_romID[i]] = m_items[i]; + } + + m_cacheReady = true; + } + + [Serializable] + struct Item + { + public string FilterName; + public string PresetName; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/FilterManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/FilterManager.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/FilterManager.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/FilterManager.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs index aec8bfd..d18ab34 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs @@ -1,131 +1,131 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Networking; - -namespace AxibugEmuOnline.Client -{ - public class HttpAPI - { - public string WebHost = "http://emu.axibug.com"; - public string WebSiteApi => WebHost + "/api"; - - public delegate void GetRomListAPI(Action callback, int page, int pageSize = 10); - public delegate void SearchRomListAPI(Action callback, string searchKey, int page, int pageSize = 10); - - public void GetNesRomList(Action callback, int page, int pageSize = 10) - { - App.StartCoroutine(GetNesRomListFlow(page, pageSize, callback)); - } - - public void SearchNesRomList(Action callback, string searchKey, int page, int pageSize = 10) - { - App.StartCoroutine(SearchNesRomListFlow(searchKey, page, pageSize, callback)); - } - private IEnumerator SearchNesRomListFlow(string searchKey, int page, int pageSize, Action callback) - { - UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}&SearchKey={searchKey}"); - yield return request.SendWebRequest(); - - if (request.result != UnityWebRequest.Result.Success) - { - callback.Invoke(null); - yield break; - } - - var resp = JsonUtility.FromJson(request.downloadHandler.text); - callback.Invoke(resp); - } - private IEnumerator GetNesRomListFlow(int page, int pageSize, Action callback) - { - UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}"); - yield return request.SendWebRequest(); - - if (request.result != UnityWebRequest.Result.Success) - { - callback.Invoke(null); - yield break; - } - - var resp = JsonUtility.FromJson(request.downloadHandler.text); - callback.Invoke(resp); - } - - public IEnumerator GetNesRomInfo(int RomID, Action callback) - { - UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/RomInfo?PType={PlatformType.Nes}&RomID={RomID}"); - yield return request.SendWebRequest(); - - if (request.result != UnityWebRequest.Result.Success) - { - callback.Invoke(null); - yield break; - } - - var resp = JsonUtility.FromJson(request.downloadHandler.text); - callback.Invoke(resp); - } - - enum PlatformType : byte - { - All = 0, - Nes = 1, - } - - enum GameType : byte - { - NONE = 0, - ACT, - ARPG, - AVG, - ETC, - FTG, - PUZ, - RAC, - RPG, - SLG, - SPG, - SRPG, - STG, - TAB, - /// - /// 合卡 - /// - ALLINONE, - } - - [Serializable] - public class Resp_GameList - { - public int page; - public int maxPage; - public int resultAllCount; - public List gameList; - } - - [Serializable] - public class Resp_RomInfo - { - public int orderid; - public int id; - public string romName; - public string gType; - public string desc; - public string url; - public string imgUrl; - public string hash; - public int stars; - } - [Serializable] - public class Resp_CheckStandInfo - { - public int needUpdateClient; - public string serverIp; - public ushort serverPort; - public string clientVersion; - public string downLoadUrl; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Networking; + +namespace AxibugEmuOnline.Client +{ + public class HttpAPI + { + public string WebHost = "http://emu.axibug.com"; + public string WebSiteApi => WebHost + "/api"; + + public delegate void GetRomListAPI(Action callback, int page, int pageSize = 10); + public delegate void SearchRomListAPI(Action callback, string searchKey, int page, int pageSize = 10); + + public void GetNesRomList(Action callback, int page, int pageSize = 10) + { + App.StartCoroutine(GetNesRomListFlow(page, pageSize, callback)); + } + + public void SearchNesRomList(Action callback, string searchKey, int page, int pageSize = 10) + { + App.StartCoroutine(SearchNesRomListFlow(searchKey, page, pageSize, callback)); + } + private IEnumerator SearchNesRomListFlow(string searchKey, int page, int pageSize, Action callback) + { + UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}&SearchKey={searchKey}"); + yield return request.SendWebRequest(); + + if (request.result != UnityWebRequest.Result.Success) + { + callback.Invoke(null); + yield break; + } + + var resp = JsonUtility.FromJson(request.downloadHandler.text); + callback.Invoke(resp); + } + private IEnumerator GetNesRomListFlow(int page, int pageSize, Action callback) + { + UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}"); + yield return request.SendWebRequest(); + + if (request.result != UnityWebRequest.Result.Success) + { + callback.Invoke(null); + yield break; + } + + var resp = JsonUtility.FromJson(request.downloadHandler.text); + callback.Invoke(resp); + } + + public IEnumerator GetNesRomInfo(int RomID, Action callback) + { + UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/RomInfo?PType={PlatformType.Nes}&RomID={RomID}"); + yield return request.SendWebRequest(); + + if (request.result != UnityWebRequest.Result.Success) + { + callback.Invoke(null); + yield break; + } + + var resp = JsonUtility.FromJson(request.downloadHandler.text); + callback.Invoke(resp); + } + + enum PlatformType : byte + { + All = 0, + Nes = 1, + } + + enum GameType : byte + { + NONE = 0, + ACT, + ARPG, + AVG, + ETC, + FTG, + PUZ, + RAC, + RPG, + SLG, + SPG, + SRPG, + STG, + TAB, + /// + /// 合卡 + /// + ALLINONE, + } + + [Serializable] + public class Resp_GameList + { + public int page; + public int maxPage; + public int resultAllCount; + public List gameList; + } + + [Serializable] + public class Resp_RomInfo + { + public int orderid; + public int id; + public string romName; + public string gType; + public string desc; + public string url; + public string imgUrl; + public string hash; + public int stars; + } + [Serializable] + public class Resp_CheckStandInfo + { + public int needUpdateClient; + public string serverIp; + public ushort serverPort; + public string clientVersion; + public string downLoadUrl; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/HttpAPI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/LogManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/LogManager.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/LogManager.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/LogManager.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/LogManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/LogManager.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/LogManager.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/LogManager.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/EnumPlatform.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/EnumPlatform.cs similarity index 93% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/EnumPlatform.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/EnumPlatform.cs index ddbd534..25bbe2b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/EnumPlatform.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/EnumPlatform.cs @@ -1,7 +1,7 @@ -namespace AxibugEmuOnline.Client -{ - public enum EnumPlatform - { - NES - } -} +namespace AxibugEmuOnline.Client +{ + public enum EnumPlatform + { + NES + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/EnumPlatform.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/EnumPlatform.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/EnumPlatform.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/EnumPlatform.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs index 9d91321..49c85cd 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs @@ -1,166 +1,166 @@ -using AxibugEmuOnline.Client.ClientCore; -using ICSharpCode.SharpZipLib.Zip; -using System; -using System.Collections; -using System.IO; -using UnityEngine.Networking; - -namespace AxibugEmuOnline.Client -{ - public class RomFile - { - private HttpAPI.Resp_RomInfo webData; - private bool hasLocalFile; - private EnumPlatform platform; - private UnityWebRequest downloadRequest; - - public bool IsUserRom { get; private set; } - - /// 指示该Rom文件的存放路径 - public string LocalFilePath => - IsUserRom ? - $"{App.PersistentDataPath}/UserRoms/{platform}/{FileName}" : - $"{App.PersistentDataPath}/RemoteRoms/{platform}/{FileName}"; - - /// 指示该Rom文件是否已下载完毕 - public bool RomReady => hasLocalFile; - /// 指示是否正在下载Rom文件 - public bool IsDownloading => downloadRequest != null && downloadRequest.result == UnityWebRequest.Result.InProgress; - public float Progress => IsDownloading ? downloadRequest.downloadProgress : 0; - - public EnumPlatform Platform => platform; - /// 指示该Rom信息是否已填充 - public bool InfoReady => webData != null; - /// 唯一标识 - public int ID => webData != null ? webData.id : -1; - /// 别名 - public string Alias => IsUserRom ? Path.GetFileNameWithoutExtension(FileName) : webData.romName; - /// 描述 - public string Descript => IsUserRom ? string.Empty : webData.desc; - /// 游戏类型 - public string GameTypeDes => IsUserRom ? string.Empty : webData.gType; - /// 小图URL - public string ImageURL => IsUserRom ? string.Empty : webData.imgUrl; - - /// 文件名 - public string FileName { get; private set; } - /// 在查询结果中的索引 - public int Index { get; private set; } - /// 在查询结果中的所在页 - public int Page { get; private set; } - public string Hash => webData != null ? webData.hash : string.Empty; - - public event Action OnDownloadOver; - public event Action OnInfoFilled; - - public RomFile(EnumPlatform platform, int index, int insidePage) - { - this.platform = platform; - Index = index; - Page = insidePage; - } - - public void BeginDownload() - { - if (RomReady) return; - if (IsDownloading) return; - - App.StartCoroutine(DownloadRemoteRom((bytes) => - { - if (bytes != null) - { - var directPath = Path.GetDirectoryName(LocalFilePath); - Directory.CreateDirectory(directPath); - - File.WriteAllBytes(LocalFilePath, bytes); - hasLocalFile = true; - } - OnDownloadOver?.Invoke(this); - })); - } - - public byte[] GetRomFileData() - { - if (!IsUserRom && webData == null) throw new Exception("Not Valid Rom"); - if (!RomReady) throw new Exception("Rom File Not Downloaded"); - - var bytes = File.ReadAllBytes(LocalFilePath); - if (Path.GetExtension(LocalFilePath).ToLower() == ".zip") - { - var zip = new ZipInputStream(new MemoryStream(bytes)); - while (zip.GetNextEntry() is ZipEntry entry) - { - if (!entry.Name.ToLower().EndsWith(".nes")) continue; - - var buffer = new byte[1024]; - MemoryStream output = new MemoryStream(); - while (true) - { - var size = zip.Read(buffer, 0, buffer.Length); - if (size == 0) break; - else output.Write(buffer, 0, size); - } - output.Flush(); - return output.ToArray(); - } - } - else - { - return bytes; - } - - throw new Exception("Not Valid Rom Data"); - } - - private IEnumerator DownloadRemoteRom(Action callback) - { - downloadRequest = UnityWebRequest.Get($"{App.httpAPI.WebHost}/{webData.url}"); - yield return downloadRequest.SendWebRequest(); - - var request = downloadRequest; - downloadRequest = null; - - if (request.result != UnityWebRequest.Result.Success) - { - callback(null); - } - else - { - callback(request.downloadHandler.data); - } - } - - public void SetWebData(HttpAPI.Resp_RomInfo resp_RomInfo) - { - webData = resp_RomInfo; - FileName = Path.GetFileName(webData.url); - FileName = System.Net.WebUtility.UrlDecode(FileName); - - if (File.Exists(LocalFilePath)) - { - var fileBytes = File.ReadAllBytes(LocalFilePath); - var localHash = RomLib.CalcHash(fileBytes); - - hasLocalFile = localHash == webData.hash; - if (!hasLocalFile) - File.Delete(LocalFilePath); - } - else - { - hasLocalFile = false; - } - - OnInfoFilled?.Invoke(); - } - - private RomFile() { } - public static RomFile CreateExistRom(EnumPlatform platform, string fileName) - { - var res = new RomFile(); - res.IsUserRom = true; - res.FileName = fileName; - res.hasLocalFile = File.Exists(res.LocalFilePath); - return res; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using ICSharpCode.SharpZipLib.Zip; +using System; +using System.Collections; +using System.IO; +using UnityEngine.Networking; + +namespace AxibugEmuOnline.Client +{ + public class RomFile + { + private HttpAPI.Resp_RomInfo webData; + private bool hasLocalFile; + private EnumPlatform platform; + private UnityWebRequest downloadRequest; + + public bool IsUserRom { get; private set; } + + /// 指示该Rom文件的存放路径 + public string LocalFilePath => + IsUserRom ? + $"{App.PersistentDataPath}/UserRoms/{platform}/{FileName}" : + $"{App.PersistentDataPath}/RemoteRoms/{platform}/{FileName}"; + + /// 指示该Rom文件是否已下载完毕 + public bool RomReady => hasLocalFile; + /// 指示是否正在下载Rom文件 + public bool IsDownloading => downloadRequest != null && downloadRequest.result == UnityWebRequest.Result.InProgress; + public float Progress => IsDownloading ? downloadRequest.downloadProgress : 0; + + public EnumPlatform Platform => platform; + /// 指示该Rom信息是否已填充 + public bool InfoReady => webData != null; + /// 唯一标识 + public int ID => webData != null ? webData.id : -1; + /// 别名 + public string Alias => IsUserRom ? Path.GetFileNameWithoutExtension(FileName) : webData.romName; + /// 描述 + public string Descript => IsUserRom ? string.Empty : webData.desc; + /// 游戏类型 + public string GameTypeDes => IsUserRom ? string.Empty : webData.gType; + /// 小图URL + public string ImageURL => IsUserRom ? string.Empty : webData.imgUrl; + + /// 文件名 + public string FileName { get; private set; } + /// 在查询结果中的索引 + public int Index { get; private set; } + /// 在查询结果中的所在页 + public int Page { get; private set; } + public string Hash => webData != null ? webData.hash : string.Empty; + + public event Action OnDownloadOver; + public event Action OnInfoFilled; + + public RomFile(EnumPlatform platform, int index, int insidePage) + { + this.platform = platform; + Index = index; + Page = insidePage; + } + + public void BeginDownload() + { + if (RomReady) return; + if (IsDownloading) return; + + App.StartCoroutine(DownloadRemoteRom((bytes) => + { + if (bytes != null) + { + var directPath = Path.GetDirectoryName(LocalFilePath); + Directory.CreateDirectory(directPath); + + File.WriteAllBytes(LocalFilePath, bytes); + hasLocalFile = true; + } + OnDownloadOver?.Invoke(this); + })); + } + + public byte[] GetRomFileData() + { + if (!IsUserRom && webData == null) throw new Exception("Not Valid Rom"); + if (!RomReady) throw new Exception("Rom File Not Downloaded"); + + var bytes = File.ReadAllBytes(LocalFilePath); + if (Path.GetExtension(LocalFilePath).ToLower() == ".zip") + { + var zip = new ZipInputStream(new MemoryStream(bytes)); + while (zip.GetNextEntry() is ZipEntry entry) + { + if (!entry.Name.ToLower().EndsWith(".nes")) continue; + + var buffer = new byte[1024]; + MemoryStream output = new MemoryStream(); + while (true) + { + var size = zip.Read(buffer, 0, buffer.Length); + if (size == 0) break; + else output.Write(buffer, 0, size); + } + output.Flush(); + return output.ToArray(); + } + } + else + { + return bytes; + } + + throw new Exception("Not Valid Rom Data"); + } + + private IEnumerator DownloadRemoteRom(Action callback) + { + downloadRequest = UnityWebRequest.Get($"{App.httpAPI.WebHost}/{webData.url}"); + yield return downloadRequest.SendWebRequest(); + + var request = downloadRequest; + downloadRequest = null; + + if (request.result != UnityWebRequest.Result.Success) + { + callback(null); + } + else + { + callback(request.downloadHandler.data); + } + } + + public void SetWebData(HttpAPI.Resp_RomInfo resp_RomInfo) + { + webData = resp_RomInfo; + FileName = Path.GetFileName(webData.url); + FileName = System.Net.WebUtility.UrlDecode(FileName); + + if (File.Exists(LocalFilePath)) + { + var fileBytes = File.ReadAllBytes(LocalFilePath); + var localHash = RomLib.CalcHash(fileBytes); + + hasLocalFile = localHash == webData.hash; + if (!hasLocalFile) + File.Delete(LocalFilePath); + } + else + { + hasLocalFile = false; + } + + OnInfoFilled?.Invoke(); + } + + private RomFile() { } + public static RomFile CreateExistRom(EnumPlatform platform, string fileName) + { + var res = new RomFile(); + res.IsUserRom = true; + res.FileName = fileName; + res.hasLocalFile = File.Exists(res.LocalFilePath); + return res; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomFile.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomLib.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomLib.cs index 7e1241d..ecde27f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomLib.cs @@ -1,153 +1,153 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Common; -using System; -using System.Collections.Generic; -using System.IO; -using static AxibugEmuOnline.Client.HttpAPI; - -namespace AxibugEmuOnline.Client -{ - public class RomLib - { - /// Rom请求,一页的大小 - private const int PAGE_SIZE = 10; - - /// 请求指令 - private HashSet FetchPageCmd = new HashSet(); - private RomFile[] nesRomFetchList; - private Dictionary nesRomFileIdMapper = new Dictionary(); - private Dictionary nesRomFileNameMapper = new Dictionary(); - private HttpAPI.GetRomListAPI m_romGetFunc; - private HttpAPI.SearchRomListAPI m_romSearchFunc; - private EnumPlatform m_platform; - - public RomLib(EnumPlatform platform) - { - m_platform = platform; - switch (platform) - { - case EnumPlatform.NES: - m_romGetFunc = App.httpAPI.GetNesRomList; - m_romSearchFunc = App.httpAPI.SearchNesRomList; - break; - } - } - - public RomFile GetExistRom(string fileName) - { - var res = RomFile.CreateExistRom(m_platform, fileName); - - nesRomFileNameMapper[res.FileName] = res; - - return res; - } - - public RomFile GetRomFile(string romFileName) - { - RomFile romFile; - nesRomFileNameMapper.TryGetValue(romFileName, out romFile); - return romFile; - } - - - - /// 清除所有下载的Rom文件 - public void ClearRomFile() - { - var path = $"{App.PersistentDataPath}/RemoteRoms/{m_platform}"; - if (Directory.Exists(path)) Directory.Delete(path, true); - } - - /// 移除一个已下载的Rom - public void RemoveOneRomFile(RomFile romFile) - { - if (romFile.RomReady) - File.Delete(romFile.LocalFilePath); - } - - /// - /// 获得所有Rom文件 - /// - /// - public void FetchRomCount(Action callback, string searchKey = null) - { - if (string.IsNullOrWhiteSpace(searchKey)) - { - m_romGetFunc((romList) => - { - FetchPageCmd.Clear(); - nesRomFileIdMapper.Clear(); - nesRomFileNameMapper.Clear(); - nesRomFetchList = new RomFile[romList.resultAllCount]; - for (int i = 0; i < nesRomFetchList.Length; i++) - { - //以后考虑用对象池实例化RomFile - nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); - } - SaveRomInfoFromWeb(romList); - - callback.Invoke(nesRomFetchList); - }, 0, PAGE_SIZE); - } - else - { - m_romSearchFunc((romList) => - { - FetchPageCmd.Clear(); - nesRomFileIdMapper.Clear(); - nesRomFileNameMapper.Clear(); - nesRomFetchList = new RomFile[romList.resultAllCount]; - for (int i = 0; i < nesRomFetchList.Length; i++) - { - //以后考虑用对象池实例化RomFile - nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); - } - SaveRomInfoFromWeb(romList); - - callback.Invoke(nesRomFetchList); - }, searchKey, 0, PAGE_SIZE); - } - } - - public void BeginFetchRomInfo(RomFile romFile) - { - if (romFile.InfoReady) return; - - FetchPageCmd.Add(romFile.Page); - } - - public void ExecuteFetchRomInfo() - { - if (FetchPageCmd.Count == 0) return; - - foreach (var pageNo in FetchPageCmd) - { - m_romGetFunc(SaveRomInfoFromWeb, pageNo, PAGE_SIZE); - } - FetchPageCmd.Clear(); - } - - private void SaveRomInfoFromWeb(Resp_GameList resp) - { - for (int i = 0; i < resp.gameList.Count; i++) - { - var webData = resp.gameList[i]; - RomFile targetRomFile = nesRomFetchList[webData.orderid]; - - targetRomFile.SetWebData(webData); - nesRomFileIdMapper[webData.id] = nesRomFetchList[webData.orderid]; - nesRomFileNameMapper[targetRomFile.FileName] = targetRomFile; - } - } - - public static string CalcHash(byte[] data) - { - return Helper.FileMD5Hash(data); - } - - public void AddRomFile(RomFile rom) - { - nesRomFileNameMapper[rom.FileName] = rom; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Common; +using System; +using System.Collections.Generic; +using System.IO; +using static AxibugEmuOnline.Client.HttpAPI; + +namespace AxibugEmuOnline.Client +{ + public class RomLib + { + /// Rom请求,一页的大小 + private const int PAGE_SIZE = 10; + + /// 请求指令 + private HashSet FetchPageCmd = new HashSet(); + private RomFile[] nesRomFetchList; + private Dictionary nesRomFileIdMapper = new Dictionary(); + private Dictionary nesRomFileNameMapper = new Dictionary(); + private HttpAPI.GetRomListAPI m_romGetFunc; + private HttpAPI.SearchRomListAPI m_romSearchFunc; + private EnumPlatform m_platform; + + public RomLib(EnumPlatform platform) + { + m_platform = platform; + switch (platform) + { + case EnumPlatform.NES: + m_romGetFunc = App.httpAPI.GetNesRomList; + m_romSearchFunc = App.httpAPI.SearchNesRomList; + break; + } + } + + public RomFile GetExistRom(string fileName) + { + var res = RomFile.CreateExistRom(m_platform, fileName); + + nesRomFileNameMapper[res.FileName] = res; + + return res; + } + + public RomFile GetRomFile(string romFileName) + { + RomFile romFile; + nesRomFileNameMapper.TryGetValue(romFileName, out romFile); + return romFile; + } + + + + /// 清除所有下载的Rom文件 + public void ClearRomFile() + { + var path = $"{App.PersistentDataPath}/RemoteRoms/{m_platform}"; + if (Directory.Exists(path)) Directory.Delete(path, true); + } + + /// 移除一个已下载的Rom + public void RemoveOneRomFile(RomFile romFile) + { + if (romFile.RomReady) + File.Delete(romFile.LocalFilePath); + } + + /// + /// 获得所有Rom文件 + /// + /// + public void FetchRomCount(Action callback, string searchKey = null) + { + if (string.IsNullOrWhiteSpace(searchKey)) + { + m_romGetFunc((romList) => + { + FetchPageCmd.Clear(); + nesRomFileIdMapper.Clear(); + nesRomFileNameMapper.Clear(); + nesRomFetchList = new RomFile[romList.resultAllCount]; + for (int i = 0; i < nesRomFetchList.Length; i++) + { + //以后考虑用对象池实例化RomFile + nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); + } + SaveRomInfoFromWeb(romList); + + callback.Invoke(nesRomFetchList); + }, 0, PAGE_SIZE); + } + else + { + m_romSearchFunc((romList) => + { + FetchPageCmd.Clear(); + nesRomFileIdMapper.Clear(); + nesRomFileNameMapper.Clear(); + nesRomFetchList = new RomFile[romList.resultAllCount]; + for (int i = 0; i < nesRomFetchList.Length; i++) + { + //以后考虑用对象池实例化RomFile + nesRomFetchList[i] = new RomFile(m_platform, i, i / PAGE_SIZE); + } + SaveRomInfoFromWeb(romList); + + callback.Invoke(nesRomFetchList); + }, searchKey, 0, PAGE_SIZE); + } + } + + public void BeginFetchRomInfo(RomFile romFile) + { + if (romFile.InfoReady) return; + + FetchPageCmd.Add(romFile.Page); + } + + public void ExecuteFetchRomInfo() + { + if (FetchPageCmd.Count == 0) return; + + foreach (var pageNo in FetchPageCmd) + { + m_romGetFunc(SaveRomInfoFromWeb, pageNo, PAGE_SIZE); + } + FetchPageCmd.Clear(); + } + + private void SaveRomInfoFromWeb(Resp_GameList resp) + { + for (int i = 0; i < resp.gameList.Count; i++) + { + var webData = resp.gameList[i]; + RomFile targetRomFile = nesRomFetchList[webData.orderid]; + + targetRomFile.SetWebData(webData); + nesRomFileIdMapper[webData.id] = nesRomFetchList[webData.orderid]; + nesRomFileNameMapper[targetRomFile.FileName] = targetRomFile; + } + } + + public static string CalcHash(byte[] data) + { + return Helper.FileMD5Hash(data); + } + + public void AddRomFile(RomFile rom) + { + nesRomFileNameMapper[rom.FileName] = rom; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomLib.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomLib.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/RomLib/RomLib.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/UserDataManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/UserDataManager.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/UserDataManager.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/UserDataManager.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/UserDataManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/UserDataManager.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Manager/UserDataManager.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/UserDataManager.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/MonoCom.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/MonoCom.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/MonoCom/TickLoop.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom/TickLoop.cs similarity index 99% rename from AxibugEmuOnline.Client/Assets/Script/MonoCom/TickLoop.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom/TickLoop.cs index ebb2f1a..3295255 100644 --- a/AxibugEmuOnline.Client/Assets/Script/MonoCom/TickLoop.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom/TickLoop.cs @@ -26,16 +26,16 @@ namespace AxibugEmuOnline.Client private void Awake() { NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdPing, OnCmdPing); - NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdPong, OnCmdPong); - - LoopAction_3s += Ping; - + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdPong, OnCmdPong); + + LoopAction_3s += Ping; + #if UNITY_EDITOR - UnityEditor.EditorApplication.playModeStateChanged += (state) => - { - if (state == UnityEditor.PlayModeStateChange.ExitingPlayMode) - OnApplicationQuit(); - }; + UnityEditor.EditorApplication.playModeStateChanged += (state) => + { + if (state == UnityEditor.PlayModeStateChange.ExitingPlayMode) + OnApplicationQuit(); + }; #endif } float LastLoopTime_1s; @@ -44,14 +44,14 @@ namespace AxibugEmuOnline.Client { NetMsg.Instance.DequeueNesMsg(); - LoopAction_tick?.Invoke(); - + LoopAction_tick?.Invoke(); + if (Time.time - LastLoopTime_1s > 1) { - LastLoopTime_1s = Time.time; + LastLoopTime_1s = Time.time; LoopAction_1s?.Invoke(); - } - + } + if (Time.time - LastLoopTime_3s > 3) { LastLoopTime_3s = Time.time; @@ -61,7 +61,7 @@ namespace AxibugEmuOnline.Client void OnApplicationQuit() { - App.log.Debug("OnApplicationQuit"); + App.log.Debug("OnApplicationQuit"); App.network.bAutoReConnect = false; if (App.network.isConnected) diff --git a/AxibugEmuOnline.Client/Assets/Script/MonoCom/TickLoop.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom/TickLoop.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/MonoCom/TickLoop.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/MonoCom/TickLoop.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/MsgBool.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/MsgBool.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs index a88413c..d7d6f5a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/MsgBool.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs @@ -1,45 +1,45 @@ -/// -/// StringBoolķϹ -/// -public struct MsgBool -{ - public string ErrorMsg; - public bool Value; - - public override readonly string ToString() - { - if (Value) - { - return true.ToString(); - } - else - { - return ErrorMsg; - } - } - - public static implicit operator MsgBool(string errorMsg) - { - return new MsgBool { Value = false, ErrorMsg = errorMsg }; - } - - public static implicit operator MsgBool(bool value) - { - return new MsgBool { Value = value }; - } - - public static implicit operator bool(MsgBool msgBool) - { - return msgBool.Value; - } - - public static implicit operator (bool, string)(MsgBool msgBool) - { - return (msgBool.Value, msgBool.ErrorMsg); - } - - public static implicit operator string(MsgBool msgBool) - { - return msgBool.ToString(); - } -} +/// +/// StringBoolķϹ +/// +public struct MsgBool +{ + public string ErrorMsg; + public bool Value; + + public override readonly string ToString() + { + if (Value) + { + return true.ToString(); + } + else + { + return ErrorMsg; + } + } + + public static implicit operator MsgBool(string errorMsg) + { + return new MsgBool { Value = false, ErrorMsg = errorMsg }; + } + + public static implicit operator MsgBool(bool value) + { + return new MsgBool { Value = value }; + } + + public static implicit operator bool(MsgBool msgBool) + { + return msgBool.Value; + } + + public static implicit operator (bool, string)(MsgBool msgBool) + { + return (msgBool.Value, msgBool.ErrorMsg); + } + + public static implicit operator string(MsgBool msgBool) + { + return msgBool.ToString(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/MsgBool.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/MsgBool.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/MsgBool.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/AudioProvider.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/AudioProvider.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/AudioProvider.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/AudioProvider.cs index 3739f86..b473614 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/AudioProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/AudioProvider.cs @@ -1,52 +1,52 @@ -using UnityEngine; -using VirtualNes.Core; - -namespace AxibugEmuOnline.Client -{ - public class AudioProvider : MonoBehaviour - { - public NesEmulator NesEmu { get; set; } - - [SerializeField] - private AudioSource m_as; - - private SoundBuffer _buffer = new SoundBuffer(4096); - public void Start() - { - var dummy = AudioClip.Create("dummy", 1, 1, AudioSettings.outputSampleRate, false); - dummy.SetData(new float[] { 1 }, 0); - m_as.clip = dummy; //just to let unity play the audiosource - m_as.loop = true; - m_as.spatialBlend = 1; - m_as.Play(); - } - - void OnAudioFilterRead(float[] data, int channels) - { - int step = channels; - - if (NesEmu == null || NesEmu.NesCore == null) return; - if (NesEmu.IsPause) return; - - ProcessSound(NesEmu.NesCore, (uint)(data.Length / channels)); - - for (int i = 0; i < data.Length; i += step) - { - float rawFloat = 0; - byte rawData; - if (_buffer.TryRead(out rawData)) - rawFloat = rawData / 255f; - - data[i] = rawFloat; - for (int fill = 1; fill < step; fill++) - data[i + fill] = rawFloat; - } - } - - void ProcessSound(NES nes, uint feedCount) - { - nes.apu.Process(_buffer, feedCount); - } - } - +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class AudioProvider : MonoBehaviour + { + public NesEmulator NesEmu { get; set; } + + [SerializeField] + private AudioSource m_as; + + private SoundBuffer _buffer = new SoundBuffer(4096); + public void Start() + { + var dummy = AudioClip.Create("dummy", 1, 1, AudioSettings.outputSampleRate, false); + dummy.SetData(new float[] { 1 }, 0); + m_as.clip = dummy; //just to let unity play the audiosource + m_as.loop = true; + m_as.spatialBlend = 1; + m_as.Play(); + } + + void OnAudioFilterRead(float[] data, int channels) + { + int step = channels; + + if (NesEmu == null || NesEmu.NesCore == null) return; + if (NesEmu.IsPause) return; + + ProcessSound(NesEmu.NesCore, (uint)(data.Length / channels)); + + for (int i = 0; i < data.Length; i += step) + { + float rawFloat = 0; + byte rawData; + if (_buffer.TryRead(out rawData)) + rawFloat = rawData / 255f; + + data[i] = rawFloat; + for (int fill = 1; fill < step; fill++) + data[i + fill] = rawFloat; + } + } + + void ProcessSound(NES nes, uint feedCount) + { + nes.apu.Process(_buffer, feedCount); + } + } + } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/AudioProvider.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/AudioProvider.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/AudioProvider.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/AudioProvider.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreDebuger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreDebuger.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreDebuger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreDebuger.cs index 1195191..3cb3112 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreDebuger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreDebuger.cs @@ -1,18 +1,18 @@ -using AxibugEmuOnline.Client.ClientCore; -using VirtualNes.Core.Debug; - -namespace AxibugEmuOnline.Client -{ - public class CoreDebuger : IDebugerImpl - { - public void Log(string message) - { - App.log.Info(message); - } - - public void LogError(string message) - { - App.log.Error(message); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using VirtualNes.Core.Debug; + +namespace AxibugEmuOnline.Client +{ + public class CoreDebuger : IDebugerImpl + { + public void Log(string message) + { + App.log.Info(message); + } + + public void LogError(string message) + { + App.log.Error(message); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreDebuger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreDebuger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreDebuger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreDebuger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreSupporter.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreSupporter.cs index 9dd81d2..437b14f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreSupporter.cs @@ -1,171 +1,171 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.IO; -using System.Runtime.InteropServices; -using UnityEngine; -using VirtualNes.Core; - -namespace AxibugEmuOnline.Client -{ - public class CoreSupporter : ISupporterImpl - { - public Stream OpenRom(string fname) - { - try - { - var romFile = App.nesRomLib.GetRomFile(fname); - var bytes = romFile.GetRomFileData(); - Debug.Log($"Open {romFile.Alias}"); - return new MemoryStream(bytes); - } - catch (Exception ex) - { - Debug.LogError(ex); - return null; - } - } - - public void GetRomPathInfo(string fname, out string fullPath, out string directPath) - { - var romFile = App.nesRomLib.GetRomFile(fname); - UnityEngine.Debug.Assert(romFile != null); - - fullPath = romFile.LocalFilePath; - directPath = Path.GetDirectoryName(fullPath); - } - - public Stream OpenFile_DISKSYS() - { - return new MemoryStream(Resources.Load("NES/Disksys.rom").bytes); - } - - public void SaveSRAMToFile(byte[] sramContent, string romName) - { - string sramDirectoryPath = $"{App.PersistentDataPath}/sav"; - Directory.CreateDirectory(sramDirectoryPath); - romName = Path.GetFileNameWithoutExtension(romName); - File.WriteAllBytes($"{sramDirectoryPath}/{romName}.sav", sramContent); - } - - public void SaveDISKToFile(byte[] diskFileContent, string romName) - { - string diskFileDirectoryPath = $"{App.PersistentDataPath}/dsv"; - Directory.CreateDirectory(diskFileDirectoryPath); - romName = Path.GetFileNameWithoutExtension(romName); - File.WriteAllBytes($"{diskFileDirectoryPath}/{romName}.dsv", diskFileContent); - } - - public EmulatorConfig Config { get; private set; } = new EmulatorConfig(); - public NesControllerMapper ControllerMapper { get; private set; } = new NesControllerMapper(); - public void PrepareDirectory(string directPath) - { - Directory.CreateDirectory($"{App.PersistentDataPath}/{directPath}"); - } - - public void SaveFile(byte[] fileData, string directPath, string fileName) - { - PrepareDirectory(directPath); - - var fileFullpath = $"{App.PersistentDataPath}/{directPath}/{fileName}"; - File.WriteAllBytes(fileFullpath, fileData); - } - - public Stream OpenFile(string directPath, string fileName) - { - try - { - var data = File.ReadAllBytes($"{App.PersistentDataPath}/{directPath}/{fileName}"); - if (data == null) return null; - return new MemoryStream(data); - } - catch - { - return null; - } - - } - - public bool TryGetMapperNo(ROM rom, out int mapperNo) - { - var db = Resources.Load("NES/ROMDB"); - return db.GetMapperNo(rom.GetPROM_CRC(), out mapperNo); - } - - private ControllerState m_sampledState; - public ControllerState GetControllerState() - { - return m_sampledState; - } - - uint LastTestInput = 0; - public void SampleInput(uint frameIndex) - { - if (InGameUI.Instance.IsNetPlay) - { - if (App.roomMgr.netReplay.TryGetNextFrame((int)frameIndex, out var replayData, out int frameDiff, out bool inputDiff)) - { - if (inputDiff) - { - App.log.Debug($"{DateTime.Now.ToString("hh:mm:ss.fff")} TryGetNextFrame remoteFrame->{App.roomMgr.netReplay.mRemoteFrameIdx} diff->{frameDiff} " + - $"frame=>{replayData.FrameStartID} InPut=>{replayData.InPut}"); - } - - m_sampledState = FromNet(replayData); - } - else m_sampledState = default; - - var localState = ControllerMapper.CreateState(); - var rawData = ToNet(localState); - if (LastTestInput != rawData) - { - LastTestInput = rawData; - App.log.Debug($"{DateTime.Now.ToString("hh:mm:ss.fff")} Input F:{App.roomMgr.netReplay.mCurrClientFrameIdx} | I:{rawData}"); - } - App.roomMgr.SendRoomSingelPlayerInput(frameIndex, rawData); - } - else - { - m_sampledState = ControllerMapper.CreateState(); - } - } - - public ControllerState FromNet(AxiReplay.ReplayStep step) - { - var temp = new ServerInputSnapShot(); - var result = new ControllerState(); - temp.all = step.InPut; - result.raw0 = temp.p1; - result.raw1 = temp.p2; - result.raw2 = temp.p3; - result.raw3 = temp.p4; - result.valid = true; - - return result; - } - - public uint ToNet(ControllerState state) - { - var temp = new ServerInputSnapShot(); - temp.p1 = (byte)state.raw0; - temp.p2 = (byte)state.raw1; - temp.p3 = (byte)state.raw2; - temp.p4 = (byte)state.raw3; - return (uint)temp.all; - } - - [StructLayout(LayoutKind.Explicit, Size = 8)] - struct ServerInputSnapShot - { - [FieldOffset(0)] - public UInt64 all; - [FieldOffset(0)] - public byte p1; - [FieldOffset(1)] - public byte p2; - [FieldOffset(2)] - public byte p3; - [FieldOffset(3)] - public byte p4; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.IO; +using System.Runtime.InteropServices; +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class CoreSupporter : ISupporterImpl + { + public Stream OpenRom(string fname) + { + try + { + var romFile = App.nesRomLib.GetRomFile(fname); + var bytes = romFile.GetRomFileData(); + Debug.Log($"Open {romFile.Alias}"); + return new MemoryStream(bytes); + } + catch (Exception ex) + { + Debug.LogError(ex); + return null; + } + } + + public void GetRomPathInfo(string fname, out string fullPath, out string directPath) + { + var romFile = App.nesRomLib.GetRomFile(fname); + UnityEngine.Debug.Assert(romFile != null); + + fullPath = romFile.LocalFilePath; + directPath = Path.GetDirectoryName(fullPath); + } + + public Stream OpenFile_DISKSYS() + { + return new MemoryStream(Resources.Load("NES/Disksys.rom").bytes); + } + + public void SaveSRAMToFile(byte[] sramContent, string romName) + { + string sramDirectoryPath = $"{App.PersistentDataPath}/sav"; + Directory.CreateDirectory(sramDirectoryPath); + romName = Path.GetFileNameWithoutExtension(romName); + File.WriteAllBytes($"{sramDirectoryPath}/{romName}.sav", sramContent); + } + + public void SaveDISKToFile(byte[] diskFileContent, string romName) + { + string diskFileDirectoryPath = $"{App.PersistentDataPath}/dsv"; + Directory.CreateDirectory(diskFileDirectoryPath); + romName = Path.GetFileNameWithoutExtension(romName); + File.WriteAllBytes($"{diskFileDirectoryPath}/{romName}.dsv", diskFileContent); + } + + public EmulatorConfig Config { get; private set; } = new EmulatorConfig(); + public NesControllerMapper ControllerMapper { get; private set; } = new NesControllerMapper(); + public void PrepareDirectory(string directPath) + { + Directory.CreateDirectory($"{App.PersistentDataPath}/{directPath}"); + } + + public void SaveFile(byte[] fileData, string directPath, string fileName) + { + PrepareDirectory(directPath); + + var fileFullpath = $"{App.PersistentDataPath}/{directPath}/{fileName}"; + File.WriteAllBytes(fileFullpath, fileData); + } + + public Stream OpenFile(string directPath, string fileName) + { + try + { + var data = File.ReadAllBytes($"{App.PersistentDataPath}/{directPath}/{fileName}"); + if (data == null) return null; + return new MemoryStream(data); + } + catch + { + return null; + } + + } + + public bool TryGetMapperNo(ROM rom, out int mapperNo) + { + var db = Resources.Load("NES/ROMDB"); + return db.GetMapperNo(rom.GetPROM_CRC(), out mapperNo); + } + + private ControllerState m_sampledState; + public ControllerState GetControllerState() + { + return m_sampledState; + } + + uint LastTestInput = 0; + public void SampleInput(uint frameIndex) + { + if (InGameUI.Instance.IsNetPlay) + { + if (App.roomMgr.netReplay.TryGetNextFrame((int)frameIndex, out var replayData, out int frameDiff, out bool inputDiff)) + { + if (inputDiff) + { + App.log.Debug($"{DateTime.Now.ToString("hh:mm:ss.fff")} TryGetNextFrame remoteFrame->{App.roomMgr.netReplay.mRemoteFrameIdx} diff->{frameDiff} " + + $"frame=>{replayData.FrameStartID} InPut=>{replayData.InPut}"); + } + + m_sampledState = FromNet(replayData); + } + else m_sampledState = default; + + var localState = ControllerMapper.CreateState(); + var rawData = ToNet(localState); + if (LastTestInput != rawData) + { + LastTestInput = rawData; + App.log.Debug($"{DateTime.Now.ToString("hh:mm:ss.fff")} Input F:{App.roomMgr.netReplay.mCurrClientFrameIdx} | I:{rawData}"); + } + App.roomMgr.SendRoomSingelPlayerInput(frameIndex, rawData); + } + else + { + m_sampledState = ControllerMapper.CreateState(); + } + } + + public ControllerState FromNet(AxiReplay.ReplayStep step) + { + var temp = new ServerInputSnapShot(); + var result = new ControllerState(); + temp.all = step.InPut; + result.raw0 = temp.p1; + result.raw1 = temp.p2; + result.raw2 = temp.p3; + result.raw3 = temp.p4; + result.valid = true; + + return result; + } + + public uint ToNet(ControllerState state) + { + var temp = new ServerInputSnapShot(); + temp.p1 = (byte)state.raw0; + temp.p2 = (byte)state.raw1; + temp.p3 = (byte)state.raw2; + temp.p4 = (byte)state.raw3; + return (uint)temp.all; + } + + [StructLayout(LayoutKind.Explicit, Size = 8)] + struct ServerInputSnapShot + { + [FieldOffset(0)] + public UInt64 all; + [FieldOffset(0)] + public byte p1; + [FieldOffset(1)] + public byte p2; + [FieldOffset(2)] + public byte p3; + [FieldOffset(3)] + public byte p4; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreSupporter.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/CoreSupporter.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/CoreSupporter.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesControllerMapper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesControllerMapper.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs index 9e231f1..5a42fe7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesControllerMapper.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs @@ -1,184 +1,184 @@ -using UnityEngine; -using VirtualNes.Core; - -namespace AxibugEmuOnline.Client -{ - public class NesControllerMapper - { - public MapperSetter Player1 = new MapperSetter(1); - public MapperSetter Player2 = new MapperSetter(2); - public MapperSetter Player3 = new MapperSetter(3); - public MapperSetter Player4 = new MapperSetter(4); - - public ControllerState CreateState() - { - var state1 = Player1.GetButtons(); - var state2 = Player2.GetButtons(); - var state3 = Player3.GetButtons(); - var state4 = Player4.GetButtons(); - - var result = new ControllerState(state1, state2, state3, state4); - return result; - } - - public class Mapper - { - MapperSetter m_setter; - EnumButtonType m_buttonType; - IKeyListener m_keyListener; - int m_controllerIndex => m_setter.ControllerIndex; - - public Mapper(MapperSetter setter, EnumButtonType buttonType) - { - m_setter = setter; - m_buttonType = buttonType; - - loadConfig(); - } - - private void loadConfig() - { - m_keyListener = MapperSetter.GetKey(m_controllerIndex, m_buttonType); - - } - - public EnumButtonType SampleKey() - { - return m_keyListener.IsPressing() ? m_buttonType : 0; - } - } - - public class MapperSetter - { - /// 控制器序号(手柄1,2,3,4) - public int ControllerIndex { get; } - public Mapper UP { get; private set; } - public Mapper DOWN { get; private set; } - public Mapper LEFT { get; private set; } - public Mapper RIGHT { get; private set; } - public Mapper A { get; private set; } - public Mapper B { get; private set; } - public Mapper SELECT { get; private set; } - public Mapper START { get; private set; } - public Mapper MIC { get; private set; } - - public MapperSetter(int controllerIndex) - { - ControllerIndex = controllerIndex; - UP = new Mapper(this, EnumButtonType.UP); - DOWN = new Mapper(this, EnumButtonType.DOWN); - LEFT = new Mapper(this, EnumButtonType.LEFT); - RIGHT = new Mapper(this, EnumButtonType.RIGHT); - A = new Mapper(this, EnumButtonType.A); - B = new Mapper(this, EnumButtonType.B); - SELECT = new Mapper(this, EnumButtonType.SELECT); - START = new Mapper(this, EnumButtonType.START); - MIC = new Mapper(this, EnumButtonType.MIC); - } - - public EnumButtonType GetButtons() - { - EnumButtonType res = 0; - - res |= UP.SampleKey(); - res |= DOWN.SampleKey(); - res |= LEFT.SampleKey(); - res |= RIGHT.SampleKey(); - res |= A.SampleKey(); - res |= B.SampleKey(); - res |= SELECT.SampleKey(); - res |= START.SampleKey(); - res |= MIC.SampleKey(); - - return res; - } - - public static IKeyListener GetKey(int controllerInput, EnumButtonType nesConBtnType) - { - string configKey = $"NES_{controllerInput}_{nesConBtnType}"; - if (PlayerPrefs.HasKey(configKey)) - { - return new KeyListener(PlayerPrefs.GetString(configKey)); - } - else - { - var defaultKeyCode = GetDefaultKey(); - PlayerPrefs.SetString(configKey, defaultKeyCode.ToString()); - return defaultKeyCode; - } - - KeyListener GetDefaultKey() - { - switch (controllerInput) - { - case 1: - if (nesConBtnType == EnumButtonType.LEFT) return new KeyListener(KeyCode.A); - if (nesConBtnType == EnumButtonType.RIGHT) return new KeyListener(KeyCode.D); - if (nesConBtnType == EnumButtonType.UP) return new KeyListener(KeyCode.W); - if (nesConBtnType == EnumButtonType.DOWN) return new KeyListener(KeyCode.S); - if (nesConBtnType == EnumButtonType.START) return new KeyListener(KeyCode.B); - if (nesConBtnType == EnumButtonType.SELECT) return new KeyListener(KeyCode.V); - if (nesConBtnType == EnumButtonType.A) return new KeyListener(KeyCode.K); - if (nesConBtnType == EnumButtonType.B) return new KeyListener(KeyCode.J); - if (nesConBtnType == EnumButtonType.MIC) return new KeyListener(KeyCode.M); - break; - case 2: - if (nesConBtnType == EnumButtonType.LEFT) return new KeyListener(KeyCode.Delete); - if (nesConBtnType == EnumButtonType.RIGHT) return new KeyListener(KeyCode.PageDown); - if (nesConBtnType == EnumButtonType.UP) return new KeyListener(KeyCode.Home); - if (nesConBtnType == EnumButtonType.DOWN) return new KeyListener(KeyCode.End); - if (nesConBtnType == EnumButtonType.START) return new KeyListener(KeyCode.PageUp); - if (nesConBtnType == EnumButtonType.SELECT) return new KeyListener(KeyCode.Insert); - if (nesConBtnType == EnumButtonType.A) return new KeyListener(KeyCode.Keypad5); - if (nesConBtnType == EnumButtonType.B) return new KeyListener(KeyCode.Keypad4); - if (nesConBtnType == EnumButtonType.MIC) return new KeyListener(KeyCode.KeypadPeriod); - break; - } - - return default; - } - - } - } - - public interface IKeyListener - { - bool IsPressing(); - } - - public struct KeyListener : IKeyListener - { - private KeyCode m_key; - - public KeyListener(KeyCode key) - { - m_key = key; - } - - /// - /// 从配置表字符串构建 - /// - public KeyListener(string confStr) - { - m_key = KeyCode.None; - - if (int.TryParse(confStr, out int result)) - m_key = (KeyCode)result; - } - - public readonly bool IsPressing() - { - if (Input.GetKey(m_key)) return true; - - return false; - } - - public override string ToString() - { - return ((int)(m_key)).ToString(); - } - } - } - - -} +using UnityEngine; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class NesControllerMapper + { + public MapperSetter Player1 = new MapperSetter(1); + public MapperSetter Player2 = new MapperSetter(2); + public MapperSetter Player3 = new MapperSetter(3); + public MapperSetter Player4 = new MapperSetter(4); + + public ControllerState CreateState() + { + var state1 = Player1.GetButtons(); + var state2 = Player2.GetButtons(); + var state3 = Player3.GetButtons(); + var state4 = Player4.GetButtons(); + + var result = new ControllerState(state1, state2, state3, state4); + return result; + } + + public class Mapper + { + MapperSetter m_setter; + EnumButtonType m_buttonType; + IKeyListener m_keyListener; + int m_controllerIndex => m_setter.ControllerIndex; + + public Mapper(MapperSetter setter, EnumButtonType buttonType) + { + m_setter = setter; + m_buttonType = buttonType; + + loadConfig(); + } + + private void loadConfig() + { + m_keyListener = MapperSetter.GetKey(m_controllerIndex, m_buttonType); + + } + + public EnumButtonType SampleKey() + { + return m_keyListener.IsPressing() ? m_buttonType : 0; + } + } + + public class MapperSetter + { + /// 控制器序号(手柄1,2,3,4) + public int ControllerIndex { get; } + public Mapper UP { get; private set; } + public Mapper DOWN { get; private set; } + public Mapper LEFT { get; private set; } + public Mapper RIGHT { get; private set; } + public Mapper A { get; private set; } + public Mapper B { get; private set; } + public Mapper SELECT { get; private set; } + public Mapper START { get; private set; } + public Mapper MIC { get; private set; } + + public MapperSetter(int controllerIndex) + { + ControllerIndex = controllerIndex; + UP = new Mapper(this, EnumButtonType.UP); + DOWN = new Mapper(this, EnumButtonType.DOWN); + LEFT = new Mapper(this, EnumButtonType.LEFT); + RIGHT = new Mapper(this, EnumButtonType.RIGHT); + A = new Mapper(this, EnumButtonType.A); + B = new Mapper(this, EnumButtonType.B); + SELECT = new Mapper(this, EnumButtonType.SELECT); + START = new Mapper(this, EnumButtonType.START); + MIC = new Mapper(this, EnumButtonType.MIC); + } + + public EnumButtonType GetButtons() + { + EnumButtonType res = 0; + + res |= UP.SampleKey(); + res |= DOWN.SampleKey(); + res |= LEFT.SampleKey(); + res |= RIGHT.SampleKey(); + res |= A.SampleKey(); + res |= B.SampleKey(); + res |= SELECT.SampleKey(); + res |= START.SampleKey(); + res |= MIC.SampleKey(); + + return res; + } + + public static IKeyListener GetKey(int controllerInput, EnumButtonType nesConBtnType) + { + string configKey = $"NES_{controllerInput}_{nesConBtnType}"; + if (PlayerPrefs.HasKey(configKey)) + { + return new KeyListener(PlayerPrefs.GetString(configKey)); + } + else + { + var defaultKeyCode = GetDefaultKey(); + PlayerPrefs.SetString(configKey, defaultKeyCode.ToString()); + return defaultKeyCode; + } + + KeyListener GetDefaultKey() + { + switch (controllerInput) + { + case 1: + if (nesConBtnType == EnumButtonType.LEFT) return new KeyListener(KeyCode.A); + if (nesConBtnType == EnumButtonType.RIGHT) return new KeyListener(KeyCode.D); + if (nesConBtnType == EnumButtonType.UP) return new KeyListener(KeyCode.W); + if (nesConBtnType == EnumButtonType.DOWN) return new KeyListener(KeyCode.S); + if (nesConBtnType == EnumButtonType.START) return new KeyListener(KeyCode.B); + if (nesConBtnType == EnumButtonType.SELECT) return new KeyListener(KeyCode.V); + if (nesConBtnType == EnumButtonType.A) return new KeyListener(KeyCode.K); + if (nesConBtnType == EnumButtonType.B) return new KeyListener(KeyCode.J); + if (nesConBtnType == EnumButtonType.MIC) return new KeyListener(KeyCode.M); + break; + case 2: + if (nesConBtnType == EnumButtonType.LEFT) return new KeyListener(KeyCode.Delete); + if (nesConBtnType == EnumButtonType.RIGHT) return new KeyListener(KeyCode.PageDown); + if (nesConBtnType == EnumButtonType.UP) return new KeyListener(KeyCode.Home); + if (nesConBtnType == EnumButtonType.DOWN) return new KeyListener(KeyCode.End); + if (nesConBtnType == EnumButtonType.START) return new KeyListener(KeyCode.PageUp); + if (nesConBtnType == EnumButtonType.SELECT) return new KeyListener(KeyCode.Insert); + if (nesConBtnType == EnumButtonType.A) return new KeyListener(KeyCode.Keypad5); + if (nesConBtnType == EnumButtonType.B) return new KeyListener(KeyCode.Keypad4); + if (nesConBtnType == EnumButtonType.MIC) return new KeyListener(KeyCode.KeypadPeriod); + break; + } + + return default; + } + + } + } + + public interface IKeyListener + { + bool IsPressing(); + } + + public struct KeyListener : IKeyListener + { + private KeyCode m_key; + + public KeyListener(KeyCode key) + { + m_key = key; + } + + /// + /// 从配置表字符串构建 + /// + public KeyListener(string confStr) + { + m_key = KeyCode.None; + + if (int.TryParse(confStr, out int result)) + m_key = (KeyCode)result; + } + + public readonly bool IsPressing() + { + if (Input.GetKey(m_key)) return true; + + return false; + } + + public override string ToString() + { + return ((int)(m_key)).ToString(); + } + } + } + + +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesControllerMapper.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesControllerMapper.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesControllerMapper.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator.cs index a79f2ca..ace0654 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator.cs @@ -1,210 +1,210 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Diagnostics; -using System.IO; -using System.Xml.Linq; -using UnityEngine; -using VirtualNes.Core; -using VirtualNes.Core.Debug; - -namespace AxibugEmuOnline.Client -{ - public class NesEmulator : MonoBehaviour, IEmuCore - { - public EnumPlatform Platform => EnumPlatform.NES; - - //ģʵ - public NES NesCore { get; private set; } - - //ƵUnityģݵIJȾʵ֣ - public VideoProvider VideoProvider; - //ƵUnityģƵݵIJųʵ֣ - public AudioProvider AudioProvider; - //Ƿͣ - private bool m_bPause; - /// Ƿͣ - public bool IsPause => m_bPause; - - private void Start() - { - //رմֱͬ - QualitySettings.vSyncCount = 0; - //Ϊ60֡ - Application.targetFrameRate = 60; - VideoProvider.NesEmu = this; - AudioProvider.NesEmu = this; - } - - /// - /// ָROMʼϷ - /// - /// - public void StartGame(RomFile rom) - { - StopGame(); - - Supporter.Setup(new CoreSupporter()); - Debuger.Setup(new CoreDebuger()); - - App.nesRomLib.AddRomFile(rom); - - try - { - NesCore = new NES(rom.FileName); - } - catch (Exception ex) - { - NesCore = null; - App.log.Error(ex.ToString()); - } - } - - /// - /// ֹͣϷ - /// - public void StopGame() - { - NesCore?.Dispose(); - NesCore = null; - } - - /// - /// Unity֡ - /// - private unsafe void Update() - { - if (m_bPause) return; - - if (NesCore != null) - { - PushEmulatorFrame(); - if (InGameUI.Instance.IsNetPlay) - FixEmulatorFrame(); - - var screenBuffer = NesCore.ppu.GetScreenPtr(); - VideoProvider.SetDrawData(screenBuffer); - } - } - - //Ƿ֡Чa - private void FixEmulatorFrame() - { - var skipFrameCount = App.roomMgr.netReplay.GetSkipFrameCount(); - - if (skipFrameCount > 0) App.log.Debug($"SKIP FRAME : {skipFrameCount}"); - for (int i = 0; i < skipFrameCount; i++) - { - if (!PushEmulatorFrame()) break; - } - } - - ControllerState lastState; - //ƽ֡ - private bool PushEmulatorFrame() - { - Supporter.SampleInput(NesCore.FrameCount); - var controlState = Supporter.GetControllerState(); - - //δյInput,֡ƽ - if (!controlState.valid) return false; - -#if UNITY_EDITOR - if (controlState != lastState) - { - App.log.Info($"[LOCALDEBUG]{NesCore.FrameCount}-->{controlState}"); - } -#endif - - NesCore.pad.Sync(controlState); - NesCore.EmulateFrame(true); - - lastState = controlState; - - return true; - } - - public void Pause() - { - m_bPause = true; - } - - public void Resume() - { - m_bPause = false; - } - - - public void DoReset() - { - NesCore.Reset(); - } - - public void SetupScheme() - { - CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Gaming; - } - - public void LoadState(object state) - { - NesCore.LoadState((State)state); - } - - public object GetState() - { - return NesCore.GetState(); - } - - /// - /// ȡʱ浵 - /// - /// - public byte[] GetStateBytes() - { - return NesCore.GetState().ToBytes(); - } - - /// - /// ؼʱ浵 - /// - /// - public void LoadStateFromBytes(byte[] data) - { - State st = new State(); - st.FromByte(data); - NesCore.LoadState(st); - } - - public uint Frame => NesCore.FrameCount; - -#if UNITY_EDITOR - /// - /// ༭ - /// - [Conditional("UNITY_EDITOR")] - [ContextMenu("ImportNesDB")] - public void ImportNesDB() - { - var db = Resources.Load("NES/ROMDB"); - db.Clear(); - - var xmlStr = File.ReadAllText("nes20db.xml"); - var xml = XDocument.Parse(xmlStr); - var games = xml.Element("nes20db").Elements("game"); - foreach (var game in games) - { - var crcStr = game.Element("rom").Attribute("crc32").Value; - var crc = uint.Parse($"{crcStr}", System.Globalization.NumberStyles.HexNumber); - - var mapper = int.Parse($"{game.Element("pcb").Attribute("mapper").Value}"); - - if (mapper > 255) continue; - db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper }); - } - - UnityEditor.EditorUtility.SetDirty(db); - UnityEditor.AssetDatabase.SaveAssets(); - } - -#endif - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Diagnostics; +using System.IO; +using System.Xml.Linq; +using UnityEngine; +using VirtualNes.Core; +using VirtualNes.Core.Debug; + +namespace AxibugEmuOnline.Client +{ + public class NesEmulator : MonoBehaviour, IEmuCore + { + public EnumPlatform Platform => EnumPlatform.NES; + + //ģʵ + public NES NesCore { get; private set; } + + //ƵUnityģݵIJȾʵ֣ + public VideoProvider VideoProvider; + //ƵUnityģƵݵIJųʵ֣ + public AudioProvider AudioProvider; + //Ƿͣ + private bool m_bPause; + /// Ƿͣ + public bool IsPause => m_bPause; + + private void Start() + { + //رմֱͬ + QualitySettings.vSyncCount = 0; + //Ϊ60֡ + Application.targetFrameRate = 60; + VideoProvider.NesEmu = this; + AudioProvider.NesEmu = this; + } + + /// + /// ָROMʼϷ + /// + /// + public void StartGame(RomFile rom) + { + StopGame(); + + Supporter.Setup(new CoreSupporter()); + Debuger.Setup(new CoreDebuger()); + + App.nesRomLib.AddRomFile(rom); + + try + { + NesCore = new NES(rom.FileName); + } + catch (Exception ex) + { + NesCore = null; + App.log.Error(ex.ToString()); + } + } + + /// + /// ֹͣϷ + /// + public void StopGame() + { + NesCore?.Dispose(); + NesCore = null; + } + + /// + /// Unity֡ + /// + private unsafe void Update() + { + if (m_bPause) return; + + if (NesCore != null) + { + PushEmulatorFrame(); + if (InGameUI.Instance.IsNetPlay) + FixEmulatorFrame(); + + var screenBuffer = NesCore.ppu.GetScreenPtr(); + VideoProvider.SetDrawData(screenBuffer); + } + } + + //Ƿ֡Ч + private void FixEmulatorFrame() + { + var skipFrameCount = App.roomMgr.netReplay.GetSkipFrameCount(); + + if (skipFrameCount > 0) App.log.Debug($"SKIP FRAME : {skipFrameCount}"); + for (int i = 0; i < skipFrameCount; i++) + { + if (!PushEmulatorFrame()) break; + } + } + + ControllerState lastState; + //ƽ֡ + private bool PushEmulatorFrame() + { + Supporter.SampleInput(NesCore.FrameCount); + var controlState = Supporter.GetControllerState(); + + //δյInput,֡ƽ + if (!controlState.valid) return false; + +#if UNITY_EDITOR + if (controlState != lastState) + { + App.log.Info($"[LOCALDEBUG]{NesCore.FrameCount}-->{controlState}"); + } +#endif + + NesCore.pad.Sync(controlState); + NesCore.EmulateFrame(true); + + lastState = controlState; + + return true; + } + + public void Pause() + { + m_bPause = true; + } + + public void Resume() + { + m_bPause = false; + } + + + public void DoReset() + { + NesCore.Reset(); + } + + public void SetupScheme() + { + CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Gaming; + } + + public void LoadState(object state) + { + NesCore.LoadState((State)state); + } + + public object GetState() + { + return NesCore.GetState(); + } + + /// + /// ȡʱ浵 + /// + /// + public byte[] GetStateBytes() + { + return NesCore.GetState().ToBytes(); + } + + /// + /// ؼʱ浵 + /// + /// + public void LoadStateFromBytes(byte[] data) + { + State st = new State(); + st.FromByte(data); + NesCore.LoadState(st); + } + + public uint Frame => NesCore.FrameCount; + +#if UNITY_EDITOR + /// + /// ༭ + /// + [Conditional("UNITY_EDITOR")] + [ContextMenu("ImportNesDB")] + public void ImportNesDB() + { + var db = Resources.Load("NES/ROMDB"); + db.Clear(); + + var xmlStr = File.ReadAllText("nes20db.xml"); + var xml = XDocument.Parse(xmlStr); + var games = xml.Element("nes20db").Elements("game"); + foreach (var game in games) + { + var crcStr = game.Element("rom").Attribute("crc32").Value; + var crc = uint.Parse($"{crcStr}", System.Globalization.NumberStyles.HexNumber); + + var mapper = int.Parse($"{game.Element("pcb").Attribute("mapper").Value}"); + + if (mapper > 255) continue; + db.AddInfo(new RomDB.RomInfo { CRC = crc, Mapper = mapper }); + } + + UnityEditor.EditorUtility.SetDirty(db); + UnityEditor.AssetDatabase.SaveAssets(); + } + +#endif + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.mat similarity index 92% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.mat index d581fae..eed7c2b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.mat @@ -2,24 +2,20 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: NesEmulator_Screen m_Shader: {fileID: 4800000, guid: b351396ff606116478d7f4412abe4e2e, type: 3} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] + m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] - m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -63,7 +59,6 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - _BumpScale: 1 - _ColorMask: 15 @@ -92,4 +87,3 @@ Material: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] - m_AllowLocking: 1 diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.mat.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.mat.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.shader similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.shader rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.shader index 288358b..aa024f6 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.shader +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.shader @@ -1,131 +1,131 @@ -Shader "NesEmulator/Screen" -{ - Properties - { - _MainTex ("Sprite Texture", 2D) = "white" {} - _PalTex ("PAL", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - - _StencilComp ("Stencil Comparison", Float) = 8 - _Stencil ("Stencil ID", Float) = 0 - _StencilOp ("Stencil Operation", Float) = 0 - _StencilWriteMask ("Stencil Write Mask", Float) = 255 - _StencilReadMask ("Stencil Read Mask", Float) = 255 - - _ColorMask ("Color Mask", Float) = 15 - - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Blend SrcAlpha OneMinusSrcAlpha - ColorMask [_ColorMask] - - Pass - { - Name "Default" - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #include "UnityCG.cginc" - #include "UnityUI.cginc" - - #pragma multi_compile_local _ UNITY_UI_CLIP_RECT - #pragma multi_compile_local _ UNITY_UI_ALPHACLIP - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - float4 worldPosition : TEXCOORD1; - UNITY_VERTEX_OUTPUT_STEREO - }; - - sampler2D _MainTex; - fixed4 _Color; - fixed4 _TextureSampleAdd; - float4 _ClipRect; - float4 _MainTex_ST; - float4 _MainTex_TexelSize; - sampler2D _PalTex; - - v2f vert(appdata_t v) - { - v2f OUT; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); - OUT.worldPosition = v.vertex; - OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); - - OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); - - OUT.color = v.color * _Color; - return OUT; - } - - fixed4 frag(v2f IN) : SV_Target - { - float2 mapUV = IN.texcoord; - - float start= 8.0/272.0; - float end = (272.0-8.0)/272.0; - - mapUV.x = lerp(start,end, mapUV.x); - - half4 color = tex2D(_MainTex,mapUV); - - //float rawIndex = color.b; - float rawIndex = color.r; - - color = tex2D(_PalTex,float2(rawIndex,0.5)); - - #ifdef UNITY_UI_CLIP_RECT - color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); - #endif - - #ifdef UNITY_UI_ALPHACLIP - clip (color.a - 0.001); - #endif - - - return color; - } - ENDCG - } - } +Shader "NesEmulator/Screen" +{ + Properties + { + _MainTex ("Sprite Texture", 2D) = "white" {} + _PalTex ("PAL", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float4 _MainTex_TexelSize; + sampler2D _PalTex; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.worldPosition = v.vertex; + OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + + OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + float2 mapUV = IN.texcoord; + + float start= 8.0/272.0; + float end = (272.0-8.0)/272.0; + + mapUV.x = lerp(start,end, mapUV.x); + + half4 color = tex2D(_MainTex,mapUV); + + //float rawIndex = color.b; + float rawIndex = color.r; + + color = tex2D(_PalTex,float2(rawIndex,0.5)); + + #ifdef UNITY_UI_CLIP_RECT + color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (color.a - 0.001); + #endif + + + return color; + } + ENDCG + } + } } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.shader.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.shader.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/NesEmulator_Screen.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PaletteDefine.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PaletteDefine.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/PaletteDefine.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PaletteDefine.cs index 7a6a5a0..1cfef39 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PaletteDefine.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PaletteDefine.cs @@ -1,296 +1,296 @@ -using VirtualNes.Core; - -namespace AxibugEmuOnline.Client -{ - public static class PaletteDefine - { - public struct RGBQUAD - { - public byte rgbBlue; - public byte rgbGreen; - public byte rgbRed; - public byte rgbReserved; - } - - public class PALBUF - { - public byte r; - public byte g; - public byte b; - - public PALBUF(byte r, byte g, byte b) - { - this.r = r; - this.g = g; - this.b = b; - } - } - - // スキャンラインカラー - private static int m_nScanlineColor => Supporter.Config.graphics.nScanlineColor; - - public static float[][] PalConvTbl = new float[8][] - { - new float[3]{1.00f, 1.00f, 1.00f}, - new float[3]{1.00f, 0.80f, 0.73f}, - new float[3]{0.73f, 1.00f, 0.70f}, - new float[3]{0.76f, 0.78f, 0.58f}, - new float[3]{0.86f, 0.80f, 1.00f}, - new float[3]{0.83f, 0.68f, 0.85f}, - new float[3]{0.67f, 0.77f, 0.83f}, - new float[3]{0.68f, 0.68f, 0.68f}, - }; - - public static PALBUF[] m_PaletteBuf = new PALBUF[64] - { - new PALBUF(0x7F, 0x7F, 0x7F), - new PALBUF(0x20, 0x00, 0xB0), - new PALBUF(0x28, 0x00, 0xB8), - new PALBUF(0x60, 0x10, 0xA0), - new PALBUF(0x98, 0x20, 0x78), - new PALBUF(0xB0, 0x10, 0x30), - new PALBUF(0xA0, 0x30, 0x00), - new PALBUF(0x78, 0x40, 0x00), - new PALBUF(0x48, 0x58, 0x00), - new PALBUF(0x38, 0x68, 0x00), - new PALBUF(0x38, 0x6C, 0x00), - new PALBUF(0x30, 0x60, 0x40), - new PALBUF(0x30, 0x50, 0x80), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0xBC, 0xBC, 0xBC), - new PALBUF(0x40, 0x60, 0xF8), - new PALBUF(0x40, 0x40, 0xFF), - new PALBUF(0x90, 0x40, 0xF0), - new PALBUF(0xD8, 0x40, 0xC0), - new PALBUF(0xD8, 0x40, 0x60), - new PALBUF(0xE0, 0x50, 0x00), - new PALBUF(0xC0, 0x70, 0x00), - new PALBUF(0x88, 0x88, 0x00), - new PALBUF(0x50, 0xA0, 0x00), - new PALBUF(0x48, 0xA8, 0x10), - new PALBUF(0x48, 0xA0, 0x68), - new PALBUF(0x40, 0x90, 0xC0), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0xFF, 0xFF, 0xFF), - new PALBUF(0x60, 0xA0, 0xFF), - new PALBUF(0x50, 0x80, 0xFF), - new PALBUF(0xA0, 0x70, 0xFF), - new PALBUF(0xF0, 0x60, 0xFF), - new PALBUF(0xFF, 0x60, 0xB0), - new PALBUF(0xFF, 0x78, 0x30), - new PALBUF(0xFF, 0xA0, 0x00), - new PALBUF(0xE8, 0xD0, 0x20), - new PALBUF(0x98, 0xE8, 0x00), - new PALBUF(0x70, 0xF0, 0x40), - new PALBUF(0x70, 0xE0, 0x90), - new PALBUF(0x60, 0xD0, 0xE0), - new PALBUF(0x60, 0x60, 0x60), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0xFF, 0xFF, 0xFF), - new PALBUF(0x90, 0xD0, 0xFF), - new PALBUF(0xA0, 0xB8, 0xFF), - new PALBUF(0xC0, 0xB0, 0xFF), - new PALBUF(0xE0, 0xB0, 0xFF), - new PALBUF(0xFF, 0xB8, 0xE8), - new PALBUF(0xFF, 0xC8, 0xB8), - new PALBUF(0xFF, 0xD8, 0xA0), - new PALBUF(0xFF, 0xF0, 0x90), - new PALBUF(0xC8, 0xF0, 0x80), - new PALBUF(0xA0, 0xF0, 0xA0), - new PALBUF(0xA0, 0xFF, 0xC8), - new PALBUF(0xA0, 0xFF, 0xF0), - new PALBUF(0xA0, 0xA0, 0xA0), - new PALBUF(0x00, 0x00, 0x00), - new PALBUF(0x00, 0x00, 0x00), - }; - - #region 256色モード用 - // Color - public static RGBQUAD[][] m_cpPalette = new RGBQUAD[8][] - { - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - }; - // Monochrome - public static RGBQUAD[][] m_mpPalette = new RGBQUAD[8][] - { - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - new RGBQUAD[64*2], - }; - #endregion - - #region ピクセルフォーマットに変換したパレット - // Color - public static uint[][] m_cnPalette = new uint[8][] - { - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - }; - // Color/Scanline - public static uint[][] m_csPalette = new uint[8][] - { - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - }; - - // Monochrome - public static uint[][] m_mnPalette = new uint[8][] - { - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - }; - - // Monochrome/Scanline - public static uint[][] m_msPalette = new uint[8][] - { - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - new uint[256], - }; - #endregion - - public static RGBQUAD[] GetPaletteData() - { - RGBQUAD[] rgb = new RGBQUAD[256]; - for (int i = 0; i < 64; i++) - { - rgb[i] = m_cpPalette[0][i]; - rgb[i + 0x40] = m_mpPalette[0][i]; - } - - return rgb; - } - - static PaletteDefine() - { - int Rbit = 0, Gbit = 0, Bbit = 0; - int Rsft = 0, Gsft = 0, Bsft = 0; - - GetBitMask(0xFF0000, ref Rsft, ref Rbit); - GetBitMask(0x00FF00, ref Gsft, ref Gbit); - GetBitMask(0x0000FF, ref Bsft, ref Bbit); - - for (int j = 0; j < 8; j++) - { - for (int i = 0; i < 64; i++) - { - uint Rn, Gn, Bn; - uint Rs, Gs, Bs; - - // Normal - Rn = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r); - Gn = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g); - Bn = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b); - // Scanline - Rs = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r * m_nScanlineColor / 100.0f); - Gs = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g * m_nScanlineColor / 100.0f); - Bs = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b * m_nScanlineColor / 100.0f); - - m_cpPalette[j][i + 0x00].rgbRed = (byte)Rn; - m_cpPalette[j][i + 0x00].rgbGreen = (byte)Gn; - m_cpPalette[j][i + 0x00].rgbBlue = (byte)Bn; - m_cpPalette[j][i + 0x40].rgbRed = (byte)Rs; - m_cpPalette[j][i + 0x40].rgbGreen = (byte)Gs; - m_cpPalette[j][i + 0x40].rgbBlue = (byte)Bs; - - m_cnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); - m_csPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); - - // Monochrome - Rn = (uint)(m_PaletteBuf[i & 0x30].r); - Gn = (uint)(m_PaletteBuf[i & 0x30].g); - Bn = (uint)(m_PaletteBuf[i & 0x30].b); - Rn = - Gn = - Bn = (uint)(0.299f * Rn + 0.587f * Gn + 0.114f * Bn); - Rn = (uint)(PalConvTbl[j][0] * Rn); - Gn = (uint)(PalConvTbl[j][1] * Gn); - Bn = (uint)(PalConvTbl[j][2] * Bn); - if (Rn > 0xFF) Rs = 0xFF; - if (Gn > 0xFF) Gs = 0xFF; - if (Bn > 0xFF) Bs = 0xFF; - // Scanline - Rs = (uint)(m_PaletteBuf[i & 0x30].r * m_nScanlineColor / 100.0f); - Gs = (uint)(m_PaletteBuf[i & 0x30].g * m_nScanlineColor / 100.0f); - Bs = (uint)(m_PaletteBuf[i & 0x30].b * m_nScanlineColor / 100.0f); - Rs = - Gs = - Bs = (uint)(0.299f * Rs + 0.587f * Gs + 0.114f * Bs); - Rs = (uint)(PalConvTbl[j][0] * Rs); - Gs = (uint)(PalConvTbl[j][1] * Gs); - Bs = (uint)(PalConvTbl[j][2] * Bs); - if (Rs > 0xFF) Rs = 0xFF; - if (Gs > 0xFF) Gs = 0xFF; - if (Bs > 0xFF) Bs = 0xFF; - - m_mpPalette[j][i + 0x00].rgbRed = (byte)Rn; - m_mpPalette[j][i + 0x00].rgbGreen = (byte)Gn; - m_mpPalette[j][i + 0x00].rgbBlue = (byte)Bn; - m_mpPalette[j][i + 0x40].rgbRed = (byte)Rs; - m_mpPalette[j][i + 0x40].rgbGreen = (byte)Gs; - m_mpPalette[j][i + 0x40].rgbBlue = (byte)Bs; - - m_mnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); - m_msPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); - } - } - } - - // ビット位置の取得 - static void GetBitMask(uint val, ref int shift, ref int bits) - { - shift = 0; - while (((val & (1 << shift)) == 0) && (shift < 32)) - { - shift++; - } - - bits = 32; - while (((val & (1 << (bits - 1))) == 0) && (bits > 0)) - { - bits--; - } - bits = bits - shift; - } - } -} +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public static class PaletteDefine + { + public struct RGBQUAD + { + public byte rgbBlue; + public byte rgbGreen; + public byte rgbRed; + public byte rgbReserved; + } + + public class PALBUF + { + public byte r; + public byte g; + public byte b; + + public PALBUF(byte r, byte g, byte b) + { + this.r = r; + this.g = g; + this.b = b; + } + } + + // スキャンラインカラー + private static int m_nScanlineColor => Supporter.Config.graphics.nScanlineColor; + + public static float[][] PalConvTbl = new float[8][] + { + new float[3]{1.00f, 1.00f, 1.00f}, + new float[3]{1.00f, 0.80f, 0.73f}, + new float[3]{0.73f, 1.00f, 0.70f}, + new float[3]{0.76f, 0.78f, 0.58f}, + new float[3]{0.86f, 0.80f, 1.00f}, + new float[3]{0.83f, 0.68f, 0.85f}, + new float[3]{0.67f, 0.77f, 0.83f}, + new float[3]{0.68f, 0.68f, 0.68f}, + }; + + public static PALBUF[] m_PaletteBuf = new PALBUF[64] + { + new PALBUF(0x7F, 0x7F, 0x7F), + new PALBUF(0x20, 0x00, 0xB0), + new PALBUF(0x28, 0x00, 0xB8), + new PALBUF(0x60, 0x10, 0xA0), + new PALBUF(0x98, 0x20, 0x78), + new PALBUF(0xB0, 0x10, 0x30), + new PALBUF(0xA0, 0x30, 0x00), + new PALBUF(0x78, 0x40, 0x00), + new PALBUF(0x48, 0x58, 0x00), + new PALBUF(0x38, 0x68, 0x00), + new PALBUF(0x38, 0x6C, 0x00), + new PALBUF(0x30, 0x60, 0x40), + new PALBUF(0x30, 0x50, 0x80), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xBC, 0xBC, 0xBC), + new PALBUF(0x40, 0x60, 0xF8), + new PALBUF(0x40, 0x40, 0xFF), + new PALBUF(0x90, 0x40, 0xF0), + new PALBUF(0xD8, 0x40, 0xC0), + new PALBUF(0xD8, 0x40, 0x60), + new PALBUF(0xE0, 0x50, 0x00), + new PALBUF(0xC0, 0x70, 0x00), + new PALBUF(0x88, 0x88, 0x00), + new PALBUF(0x50, 0xA0, 0x00), + new PALBUF(0x48, 0xA8, 0x10), + new PALBUF(0x48, 0xA0, 0x68), + new PALBUF(0x40, 0x90, 0xC0), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xFF, 0xFF, 0xFF), + new PALBUF(0x60, 0xA0, 0xFF), + new PALBUF(0x50, 0x80, 0xFF), + new PALBUF(0xA0, 0x70, 0xFF), + new PALBUF(0xF0, 0x60, 0xFF), + new PALBUF(0xFF, 0x60, 0xB0), + new PALBUF(0xFF, 0x78, 0x30), + new PALBUF(0xFF, 0xA0, 0x00), + new PALBUF(0xE8, 0xD0, 0x20), + new PALBUF(0x98, 0xE8, 0x00), + new PALBUF(0x70, 0xF0, 0x40), + new PALBUF(0x70, 0xE0, 0x90), + new PALBUF(0x60, 0xD0, 0xE0), + new PALBUF(0x60, 0x60, 0x60), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0xFF, 0xFF, 0xFF), + new PALBUF(0x90, 0xD0, 0xFF), + new PALBUF(0xA0, 0xB8, 0xFF), + new PALBUF(0xC0, 0xB0, 0xFF), + new PALBUF(0xE0, 0xB0, 0xFF), + new PALBUF(0xFF, 0xB8, 0xE8), + new PALBUF(0xFF, 0xC8, 0xB8), + new PALBUF(0xFF, 0xD8, 0xA0), + new PALBUF(0xFF, 0xF0, 0x90), + new PALBUF(0xC8, 0xF0, 0x80), + new PALBUF(0xA0, 0xF0, 0xA0), + new PALBUF(0xA0, 0xFF, 0xC8), + new PALBUF(0xA0, 0xFF, 0xF0), + new PALBUF(0xA0, 0xA0, 0xA0), + new PALBUF(0x00, 0x00, 0x00), + new PALBUF(0x00, 0x00, 0x00), + }; + + #region 256色モード用 + // Color + public static RGBQUAD[][] m_cpPalette = new RGBQUAD[8][] + { + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + }; + // Monochrome + public static RGBQUAD[][] m_mpPalette = new RGBQUAD[8][] + { + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + new RGBQUAD[64*2], + }; + #endregion + + #region ピクセルフォーマットに変換したパレット + // Color + public static uint[][] m_cnPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + // Color/Scanline + public static uint[][] m_csPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + + // Monochrome + public static uint[][] m_mnPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + + // Monochrome/Scanline + public static uint[][] m_msPalette = new uint[8][] + { + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + new uint[256], + }; + #endregion + + public static RGBQUAD[] GetPaletteData() + { + RGBQUAD[] rgb = new RGBQUAD[256]; + for (int i = 0; i < 64; i++) + { + rgb[i] = m_cpPalette[0][i]; + rgb[i + 0x40] = m_mpPalette[0][i]; + } + + return rgb; + } + + static PaletteDefine() + { + int Rbit = 0, Gbit = 0, Bbit = 0; + int Rsft = 0, Gsft = 0, Bsft = 0; + + GetBitMask(0xFF0000, ref Rsft, ref Rbit); + GetBitMask(0x00FF00, ref Gsft, ref Gbit); + GetBitMask(0x0000FF, ref Bsft, ref Bbit); + + for (int j = 0; j < 8; j++) + { + for (int i = 0; i < 64; i++) + { + uint Rn, Gn, Bn; + uint Rs, Gs, Bs; + + // Normal + Rn = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r); + Gn = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g); + Bn = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b); + // Scanline + Rs = (uint)(PalConvTbl[j][0] * m_PaletteBuf[i].r * m_nScanlineColor / 100.0f); + Gs = (uint)(PalConvTbl[j][1] * m_PaletteBuf[i].g * m_nScanlineColor / 100.0f); + Bs = (uint)(PalConvTbl[j][2] * m_PaletteBuf[i].b * m_nScanlineColor / 100.0f); + + m_cpPalette[j][i + 0x00].rgbRed = (byte)Rn; + m_cpPalette[j][i + 0x00].rgbGreen = (byte)Gn; + m_cpPalette[j][i + 0x00].rgbBlue = (byte)Bn; + m_cpPalette[j][i + 0x40].rgbRed = (byte)Rs; + m_cpPalette[j][i + 0x40].rgbGreen = (byte)Gs; + m_cpPalette[j][i + 0x40].rgbBlue = (byte)Bs; + + m_cnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); + m_csPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); + + // Monochrome + Rn = (uint)(m_PaletteBuf[i & 0x30].r); + Gn = (uint)(m_PaletteBuf[i & 0x30].g); + Bn = (uint)(m_PaletteBuf[i & 0x30].b); + Rn = + Gn = + Bn = (uint)(0.299f * Rn + 0.587f * Gn + 0.114f * Bn); + Rn = (uint)(PalConvTbl[j][0] * Rn); + Gn = (uint)(PalConvTbl[j][1] * Gn); + Bn = (uint)(PalConvTbl[j][2] * Bn); + if (Rn > 0xFF) Rs = 0xFF; + if (Gn > 0xFF) Gs = 0xFF; + if (Bn > 0xFF) Bs = 0xFF; + // Scanline + Rs = (uint)(m_PaletteBuf[i & 0x30].r * m_nScanlineColor / 100.0f); + Gs = (uint)(m_PaletteBuf[i & 0x30].g * m_nScanlineColor / 100.0f); + Bs = (uint)(m_PaletteBuf[i & 0x30].b * m_nScanlineColor / 100.0f); + Rs = + Gs = + Bs = (uint)(0.299f * Rs + 0.587f * Gs + 0.114f * Bs); + Rs = (uint)(PalConvTbl[j][0] * Rs); + Gs = (uint)(PalConvTbl[j][1] * Gs); + Bs = (uint)(PalConvTbl[j][2] * Bs); + if (Rs > 0xFF) Rs = 0xFF; + if (Gs > 0xFF) Gs = 0xFF; + if (Bs > 0xFF) Bs = 0xFF; + + m_mpPalette[j][i + 0x00].rgbRed = (byte)Rn; + m_mpPalette[j][i + 0x00].rgbGreen = (byte)Gn; + m_mpPalette[j][i + 0x00].rgbBlue = (byte)Bn; + m_mpPalette[j][i + 0x40].rgbRed = (byte)Rs; + m_mpPalette[j][i + 0x40].rgbGreen = (byte)Gs; + m_mpPalette[j][i + 0x40].rgbBlue = (byte)Bs; + + m_mnPalette[j][i] = ((Rn >> (8 - Rbit)) << Rsft) | ((Gn >> (8 - Gbit)) << Gsft) | ((Bn >> (8 - Bbit)) << Bsft); + m_msPalette[j][i] = ((Rs >> (8 - Rbit)) << Rsft) | ((Gs >> (8 - Gbit)) << Gsft) | ((Bs >> (8 - Bbit)) << Bsft); + } + } + } + + // ビット位置の取得 + static void GetBitMask(uint val, ref int shift, ref int bits) + { + shift = 0; + while (((val & (1 << shift)) == 0) && (shift < 32)) + { + shift++; + } + + bits = 32; + while (((val & (1 << (bits - 1))) == 0) && (bits > 0)) + { + bits--; + } + bits = bits - shift; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PaletteDefine.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PaletteDefine.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/PaletteDefine.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PaletteDefine.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PatternViewer.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PatternViewer.cs index 11e190d..681c068 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PatternViewer.cs @@ -1,125 +1,125 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using VirtualNes; -using VirtualNes.Core; -using static AxibugEmuOnline.Client.PaletteDefine; - -namespace AxibugEmuOnline.Client -{ - public class PatternViewer : MonoBehaviour - { - public RawImage img; - public Text select; - - private Color32[] m_lpPattern = new Color32[128 * 256]; - private Texture2D m_texture; - private Dictionary colors = new Dictionary(); - - private int selectPal = 0; - - private void Awake() - { - m_texture = new Texture2D(128, 256); - m_texture.filterMode = FilterMode.Point; - } - - private void Update() - { - if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.T)) - { - SwitchSelectPal(); - } - Paint(); - } - - private void OnEnable() - { - img.gameObject.SetActive(true); - if (selectPal < 4) - { - select.text = $"PatternView BG{(selectPal & 3):00}"; - } - else - { - select.text = $"PatternView SP{(selectPal & 3):00}"; - } - } - - private void OnDisable() - { - img.gameObject.SetActive(false); - } - - public void Paint() - { - img.texture = m_texture; - - ArrayRef pal = null; - if (selectPal < 4) - { - pal = new ArrayRef(MMU.BGPAL, selectPal * 4); - } - else - { - pal = new ArrayRef(MMU.SPPAL, (selectPal & 3) * 4); - } - - var palette = PaletteDefine.GetPaletteData(); - colors[0] = palette[pal[0]]; - colors[1] = palette[pal[1]]; - colors[2] = palette[pal[2]]; - colors[3] = palette[pal[3]]; - - for (int i = 0; i < 8; i++) - { - var Ptn = MMU.PPU_MEM_BANK[i]; - - int lpPtn = 0; - for (int p = 0; p < 64; p++) - { - int lpScn = i * 32 * 128 + (p & 15) * 8 + (p / 16) * 8 * 128; - for (int y = 0; y < 8; y++) - { - byte chr_l = Ptn[lpPtn + y]; - byte chr_h = Ptn[lpPtn + y + 8]; - m_lpPattern[lpScn + 0] = ToColor32(colors, (((chr_h >> 6) & 2) | ((chr_l >> 7) & 1))); - m_lpPattern[lpScn + 4] = ToColor32(colors, (((chr_h >> 2) & 2) | ((chr_l >> 3) & 1))); - m_lpPattern[lpScn + 1] = ToColor32(colors, (((chr_h >> 5) & 2) | ((chr_l >> 6) & 1))); - m_lpPattern[lpScn + 5] = ToColor32(colors, (((chr_h >> 1) & 2) | ((chr_l >> 2) & 1))); - m_lpPattern[lpScn + 2] = ToColor32(colors, (((chr_h >> 4) & 2) | ((chr_l >> 5) & 1))); - m_lpPattern[lpScn + 6] = ToColor32(colors, (((chr_h >> 0) & 2) | ((chr_l >> 1) & 1))); - m_lpPattern[lpScn + 3] = ToColor32(colors, (((chr_h >> 3) & 2) | ((chr_l >> 4) & 1))); - m_lpPattern[lpScn + 7] = ToColor32(colors, (((chr_h << 1) & 2) | ((chr_l >> 0) & 1))); - // Next line - lpScn += 128; - } - // Next pattern - lpPtn += 16; - } - } - - m_texture.SetPixels32(m_lpPattern); - m_texture.Apply(); - } - - private Color32 ToColor32(Dictionary map, int v) - { - var raw = map[(byte)v]; - return new Color32(raw.rgbRed, raw.rgbGreen, raw.rgbBlue, 255); - } - - void SwitchSelectPal() - { - selectPal = (selectPal + 1) & 7; - if (selectPal < 4) - { - select.text = $"PatternView BG{(selectPal & 3):00}"; - } - else - { - select.text = $"PatternView SP{(selectPal & 3):00}"; - } - } - } -} +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using VirtualNes; +using VirtualNes.Core; +using static AxibugEmuOnline.Client.PaletteDefine; + +namespace AxibugEmuOnline.Client +{ + public class PatternViewer : MonoBehaviour + { + public RawImage img; + public Text select; + + private Color32[] m_lpPattern = new Color32[128 * 256]; + private Texture2D m_texture; + private Dictionary colors = new Dictionary(); + + private int selectPal = 0; + + private void Awake() + { + m_texture = new Texture2D(128, 256); + m_texture.filterMode = FilterMode.Point; + } + + private void Update() + { + if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.T)) + { + SwitchSelectPal(); + } + Paint(); + } + + private void OnEnable() + { + img.gameObject.SetActive(true); + if (selectPal < 4) + { + select.text = $"PatternView BG{(selectPal & 3):00}"; + } + else + { + select.text = $"PatternView SP{(selectPal & 3):00}"; + } + } + + private void OnDisable() + { + img.gameObject.SetActive(false); + } + + public void Paint() + { + img.texture = m_texture; + + ArrayRef pal = null; + if (selectPal < 4) + { + pal = new ArrayRef(MMU.BGPAL, selectPal * 4); + } + else + { + pal = new ArrayRef(MMU.SPPAL, (selectPal & 3) * 4); + } + + var palette = PaletteDefine.GetPaletteData(); + colors[0] = palette[pal[0]]; + colors[1] = palette[pal[1]]; + colors[2] = palette[pal[2]]; + colors[3] = palette[pal[3]]; + + for (int i = 0; i < 8; i++) + { + var Ptn = MMU.PPU_MEM_BANK[i]; + + int lpPtn = 0; + for (int p = 0; p < 64; p++) + { + int lpScn = i * 32 * 128 + (p & 15) * 8 + (p / 16) * 8 * 128; + for (int y = 0; y < 8; y++) + { + byte chr_l = Ptn[lpPtn + y]; + byte chr_h = Ptn[lpPtn + y + 8]; + m_lpPattern[lpScn + 0] = ToColor32(colors, (((chr_h >> 6) & 2) | ((chr_l >> 7) & 1))); + m_lpPattern[lpScn + 4] = ToColor32(colors, (((chr_h >> 2) & 2) | ((chr_l >> 3) & 1))); + m_lpPattern[lpScn + 1] = ToColor32(colors, (((chr_h >> 5) & 2) | ((chr_l >> 6) & 1))); + m_lpPattern[lpScn + 5] = ToColor32(colors, (((chr_h >> 1) & 2) | ((chr_l >> 2) & 1))); + m_lpPattern[lpScn + 2] = ToColor32(colors, (((chr_h >> 4) & 2) | ((chr_l >> 5) & 1))); + m_lpPattern[lpScn + 6] = ToColor32(colors, (((chr_h >> 0) & 2) | ((chr_l >> 1) & 1))); + m_lpPattern[lpScn + 3] = ToColor32(colors, (((chr_h >> 3) & 2) | ((chr_l >> 4) & 1))); + m_lpPattern[lpScn + 7] = ToColor32(colors, (((chr_h << 1) & 2) | ((chr_l >> 0) & 1))); + // Next line + lpScn += 128; + } + // Next pattern + lpPtn += 16; + } + } + + m_texture.SetPixels32(m_lpPattern); + m_texture.Apply(); + } + + private Color32 ToColor32(Dictionary map, int v) + { + var raw = map[(byte)v]; + return new Color32(raw.rgbRed, raw.rgbGreen, raw.rgbBlue, 255); + } + + void SwitchSelectPal() + { + selectPal = (selectPal + 1) & 7; + if (selectPal < 4) + { + select.text = $"PatternView BG{(selectPal & 3):00}"; + } + else + { + select.text = $"PatternView SP{(selectPal & 3):00}"; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PatternViewer.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/PatternViewer.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/PatternViewer.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/RomDB.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/RomDB.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/RomDB.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/RomDB.cs index 2af7f26..c92e4fa 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/RomDB.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/RomDB.cs @@ -1,55 +1,55 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client.ClientCore -{ - public class RomDB : ScriptableObject - { - [SerializeField] - private List romInfos = new List(); - - private Dictionary crc_Info_mapper; - - public void AddInfo(RomInfo romInfo) - { - romInfos.Add(romInfo); - } - - public void Clear() - { - romInfos.Clear(); - } - - public bool GetMapperNo(uint crc, out int mapperNo) - { - if (crc_Info_mapper == null) - { - crc_Info_mapper = new Dictionary(); - foreach (var info in romInfos) - { - crc_Info_mapper[info.CRC] = info; - } - } - RomInfo romInfo; - if (crc_Info_mapper.TryGetValue(crc, out romInfo)) - { - mapperNo = romInfo.Mapper; - return true; - } - else - { - mapperNo = -1; - return false; - } - } - - [Serializable] - public class RomInfo - { - public uint CRC; - public int Mapper; - } - } - -} +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client.ClientCore +{ + public class RomDB : ScriptableObject + { + [SerializeField] + private List romInfos = new List(); + + private Dictionary crc_Info_mapper; + + public void AddInfo(RomInfo romInfo) + { + romInfos.Add(romInfo); + } + + public void Clear() + { + romInfos.Clear(); + } + + public bool GetMapperNo(uint crc, out int mapperNo) + { + if (crc_Info_mapper == null) + { + crc_Info_mapper = new Dictionary(); + foreach (var info in romInfos) + { + crc_Info_mapper[info.CRC] = info; + } + } + RomInfo romInfo; + if (crc_Info_mapper.TryGetValue(crc, out romInfo)) + { + mapperNo = romInfo.Mapper; + return true; + } + else + { + mapperNo = -1; + return false; + } + } + + [Serializable] + public class RomInfo + { + public uint CRC; + public int Mapper; + } + } + +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/RomDB.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/RomDB.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/RomDB.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/RomDB.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/VideoProvider.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/VideoProvider.cs index 4399de2..4450f03 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/VideoProvider.cs @@ -1,174 +1,174 @@ -using System; -using System.Runtime.InteropServices; -using UnityEngine; -using UnityEngine.UI; -using VirtualNes.Core; - -namespace AxibugEmuOnline.Client -{ - public class VideoProvider : MonoBehaviour - { - #region UI_REF - public NesEmulator NesEmu; - public Canvas DrawCanvas; - public RawImage Image; - #endregion - - - #region GPU_TURBO - //ͼֽ - private int TexBufferSize_gpu; - //ͼָ - private IntPtr wrapTexBufferPointer_gpu; - //Unity 2D,UIϻ - private Texture2D wrapTex_gpu; - //nesɫ,תΪunity - private Texture2D pPal_gpu; - private Material GPUTurboMat_gpu; - #endregion - - #region CPU - //ͼֽ - private int TexBufferSize_cpu; - //ͼָ - private GCHandle wrapTexBufferGH; - private IntPtr wrapTexBufferPointer_cpu; - //Unity 2D,UIϻ - private Texture2D wrapTex_cpu; - #endregion - - public bool GPUTurbo = true; - - private void Awake() - { - DrawCanvas.worldCamera = Camera.main; - GPUTurboMat_gpu = Image.material; - } - - private void OnDestroy() - { - if (wrapTexBufferGH.IsAllocated) - wrapTexBufferGH.Free(); - } - - public unsafe void SetDrawData(uint* screenData) - { - PrepareUI(screenData); - if (GPUTurbo) PrepareForGPU(screenData);//жʹGPUCPU - else PrepareForCPU(screenData);//ʹCPU - - if (GPUTurbo) - { - wrapTex_gpu.LoadRawTextureData(wrapTexBufferPointer_gpu, TexBufferSize_gpu); - wrapTex_gpu.Apply(); - } - else - { - wrapTex_cpu.LoadRawTextureData(wrapTexBufferPointer_cpu, TexBufferSize_cpu); - wrapTex_cpu.Apply(); - } - } - - private unsafe void PrepareUI(uint* screenData) - { - if (GPUTurbo) - { - if (Image.material != GPUTurboMat_gpu) Image.material = GPUTurboMat_gpu; - - if (wrapTex_gpu == null) - { - wrapTex_gpu = new Texture2D(PPU.SCREEN_WIDTH, PPU.SCREEN_HEIGHT, TextureFormat.RGBA32, false); - wrapTex_gpu.filterMode = FilterMode.Point; - wrapTexBufferPointer_gpu = (IntPtr)screenData; - - TexBufferSize_gpu = wrapTex_gpu.width * wrapTex_gpu.height * 4; - } - - if (Image.texture != wrapTex_gpu) Image.texture = wrapTex_gpu; - } - else - { - if (Image.material == GPUTurboMat_gpu) Image.material = null; - - if (wrapTex_cpu == null) - { - wrapTex_cpu = new Texture2D(PPU.SCREEN_WIDTH - 16, PPU.SCREEN_HEIGHT, TextureFormat.RGBA32, false); - wrapTex_cpu.filterMode = FilterMode.Point; - - uint[] cpuTexBuffer = new uint[wrapTex_cpu.width * wrapTex_cpu.height]; - - wrapTexBufferGH = GCHandle.Alloc(cpuTexBuffer, GCHandleType.Pinned); - wrapTexBufferPointer_cpu = wrapTexBufferGH.AddrOfPinnedObject(); - TexBufferSize_cpu = cpuTexBuffer.Length * 4; - } - if (Image.texture != wrapTex_cpu) Image.texture = wrapTex_cpu; - } - } - - private unsafe void PrepareForGPU(uint* screenData) - { - if (pPal_gpu == null) - { - var palRaw = PaletteDefine.m_cnPalette[0]; - - pPal_gpu = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false); - pPal_gpu.filterMode = FilterMode.Point; - - for (int i = 0; i < palRaw.Length; i++) - { - uint colorRaw = palRaw[i]; - var argbColor = BitConverter.GetBytes(colorRaw); - Color temp = Color.white; - temp.r = argbColor[2] / 255f; - temp.g = argbColor[1] / 255f; - temp.b = argbColor[0] / 255f; - temp.a = 1; - pPal_gpu.SetPixel(i, 0, temp); - } - pPal_gpu.Apply(); - GPUTurboMat_gpu.SetTexture("_PalTex", pPal_gpu); - } - } - - private unsafe void PrepareForCPU(uint* screenData) - { - int pScn = 0; - int width; - - var Dst = (uint*)wrapTexBufferPointer_cpu; - var pDst = 0; - var palRaw = PaletteDefine.m_cnPalette[0]; - - for (int line = 0; line < PPU.SCREEN_HEIGHT; line++) - { - //PSCPU㣬ȼ16IJҪ֣ܶ - width = PPU.SCREEN_WIDTH - 16; - - while (width > 0) - { - var edx = screenData[pScn + 8]; - - uint index = edx & 0xFF; - //±ɫұʵɫ - var colorData = palRaw[index]; - //dstɫΪabgr,colorDataΪargb - uint r = (colorData & 0x00FF0000) >> 16; // ȡRedͨ - uint g = (colorData & 0x0000FF00) >> 8; // ȡGreenͨ - uint b = (colorData & 0x000000FF); // ȡBlueͨ - - //rgbɫunity rgb System.Drawing.Color ɫ - uint abgr = 0xFF000000 | (b << 16) | (g << 8) | (r << 0); - - //Žɫ - Dst[pDst] = abgr; - - pScn += 1; - pDst += 1; - width -= 1; - } - - pScn += 16; - } - } - } -} +using System; +using System.Runtime.InteropServices; +using UnityEngine; +using UnityEngine.UI; +using VirtualNes.Core; + +namespace AxibugEmuOnline.Client +{ + public class VideoProvider : MonoBehaviour + { + #region UI_REF + public NesEmulator NesEmu; + public Canvas DrawCanvas; + public RawImage Image; + #endregion + + + #region GPU_TURBO + //ͼֽ + private int TexBufferSize_gpu; + //ͼָ + private IntPtr wrapTexBufferPointer_gpu; + //Unity 2D,UIϻ + private Texture2D wrapTex_gpu; + //nesɫ,תΪunity + private Texture2D pPal_gpu; + private Material GPUTurboMat_gpu; + #endregion + + #region CPU + //ͼֽ + private int TexBufferSize_cpu; + //ͼָ + private GCHandle wrapTexBufferGH; + private IntPtr wrapTexBufferPointer_cpu; + //Unity 2D,UIϻ + private Texture2D wrapTex_cpu; + #endregion + + public bool GPUTurbo = true; + + private void Awake() + { + DrawCanvas.worldCamera = Camera.main; + GPUTurboMat_gpu = Image.material; + } + + private void OnDestroy() + { + if (wrapTexBufferGH.IsAllocated) + wrapTexBufferGH.Free(); + } + + public unsafe void SetDrawData(uint* screenData) + { + PrepareUI(screenData); + if (GPUTurbo) PrepareForGPU(screenData);//жʹGPUCPU + else PrepareForCPU(screenData);//ʹCPU + + if (GPUTurbo) + { + wrapTex_gpu.LoadRawTextureData(wrapTexBufferPointer_gpu, TexBufferSize_gpu); + wrapTex_gpu.Apply(); + } + else + { + wrapTex_cpu.LoadRawTextureData(wrapTexBufferPointer_cpu, TexBufferSize_cpu); + wrapTex_cpu.Apply(); + } + } + + private unsafe void PrepareUI(uint* screenData) + { + if (GPUTurbo) + { + if (Image.material != GPUTurboMat_gpu) Image.material = GPUTurboMat_gpu; + + if (wrapTex_gpu == null) + { + wrapTex_gpu = new Texture2D(PPU.SCREEN_WIDTH, PPU.SCREEN_HEIGHT, TextureFormat.RGBA32, false); + wrapTex_gpu.filterMode = FilterMode.Point; + wrapTexBufferPointer_gpu = (IntPtr)screenData; + + TexBufferSize_gpu = wrapTex_gpu.width * wrapTex_gpu.height * 4; + } + + if (Image.texture != wrapTex_gpu) Image.texture = wrapTex_gpu; + } + else + { + if (Image.material == GPUTurboMat_gpu) Image.material = null; + + if (wrapTex_cpu == null) + { + wrapTex_cpu = new Texture2D(PPU.SCREEN_WIDTH - 16, PPU.SCREEN_HEIGHT, TextureFormat.RGBA32, false); + wrapTex_cpu.filterMode = FilterMode.Point; + + uint[] cpuTexBuffer = new uint[wrapTex_cpu.width * wrapTex_cpu.height]; + + wrapTexBufferGH = GCHandle.Alloc(cpuTexBuffer, GCHandleType.Pinned); + wrapTexBufferPointer_cpu = wrapTexBufferGH.AddrOfPinnedObject(); + TexBufferSize_cpu = cpuTexBuffer.Length * 4; + } + if (Image.texture != wrapTex_cpu) Image.texture = wrapTex_cpu; + } + } + + private unsafe void PrepareForGPU(uint* screenData) + { + if (pPal_gpu == null) + { + var palRaw = PaletteDefine.m_cnPalette[0]; + + pPal_gpu = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false); + pPal_gpu.filterMode = FilterMode.Point; + + for (int i = 0; i < palRaw.Length; i++) + { + uint colorRaw = palRaw[i]; + var argbColor = BitConverter.GetBytes(colorRaw); + Color temp = Color.white; + temp.r = argbColor[2] / 255f; + temp.g = argbColor[1] / 255f; + temp.b = argbColor[0] / 255f; + temp.a = 1; + pPal_gpu.SetPixel(i, 0, temp); + } + pPal_gpu.Apply(); + GPUTurboMat_gpu.SetTexture("_PalTex", pPal_gpu); + } + } + + private unsafe void PrepareForCPU(uint* screenData) + { + int pScn = 0; + int width; + + var Dst = (uint*)wrapTexBufferPointer_cpu; + var pDst = 0; + var palRaw = PaletteDefine.m_cnPalette[0]; + + for (int line = 0; line < PPU.SCREEN_HEIGHT; line++) + { + //PSCPU㣬ȼ16IJҪ֣ܶ + width = PPU.SCREEN_WIDTH - 16; + + while (width > 0) + { + var edx = screenData[pScn + 8]; + + uint index = edx & 0xFF; + //±ɫұʵɫ + var colorData = palRaw[index]; + //dstɫΪabgr,colorDataΪargb + uint r = (colorData & 0x00FF0000) >> 16; // ȡRedͨ + uint g = (colorData & 0x0000FF00) >> 8; // ȡGreenͨ + uint b = (colorData & 0x000000FF); // ȡBlueͨ + + //rgbɫunity rgb System.Drawing.Color ɫ + uint abgr = 0xFF000000 | (b << 16) | (g << 8) | (r << 0); + + //Žɫ + Dst[pDst] = abgr; + + pScn += 1; + pDst += 1; + width -= 1; + } + + pScn += 16; + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/VideoProvider.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/NesEmulator/VideoProvider.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Network.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Network.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Network.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Network/NetMsg.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetMsg.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Network/NetMsg.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetMsg.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Network/NetMsg.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetMsg.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Network/NetMsg.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetMsg.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Network/NetworkHelper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetworkHelper.cs similarity index 99% rename from AxibugEmuOnline.Client/Assets/Script/Network/NetworkHelper.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetworkHelper.cs index 901e698..c38657d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Network/NetworkHelper.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetworkHelper.cs @@ -131,8 +131,8 @@ namespace AxibugEmuOnline.Client.Network App.log.Info($"触发重连后的自动逻辑!"); OnReConnected?.Invoke(); } - } while (!bflagDone && App.network.bAutoReConnect); - + } while (!bflagDone && App.network.bAutoReConnect); + if (!App.network.bAutoReConnect) { if (App.network.isConnected) diff --git a/AxibugEmuOnline.Client/Assets/Script/Network/NetworkHelper.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetworkHelper.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Network/NetworkHelper.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Network/NetworkHelper.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Protobuf.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Protobuf.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Protobuf/ProtobufAxibugEmuOnline.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Protobuf/ProtobufAxibugEmuOnline.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/RingBuffer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/RingBuffer.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/RingBuffer.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/RingBuffer.cs index 2c92e49..ff3727c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/RingBuffer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/RingBuffer.cs @@ -1,72 +1,72 @@ -using System.Threading; - -public class RingBuffer -{ - private readonly T[] buffer; - private readonly int capacity; - private int writePos; - private int readPos; - private int count; - - public RingBuffer(int capacity) - { - this.capacity = capacity; - this.buffer = new T[capacity]; - this.writePos = 0; - this.readPos = 0; - this.count = 0; - } - - public void Write(T item) - { - int localWritePos; - int localReadPos; - - do - { - localWritePos = Volatile.Read(ref writePos); - localReadPos = Volatile.Read(ref readPos); - - int nextWritePos = (localWritePos + 1) % capacity; - - if (nextWritePos == localReadPos) - { - // ɵδ - Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos); - } - } - while (Interlocked.CompareExchange(ref writePos, (localWritePos + 1) % capacity, localWritePos) != localWritePos); - - buffer[localWritePos] = item; - Interlocked.Increment(ref count); - } - - public bool TryRead(out T item) - { - item = default(T); - - int localReadPos; - int localWritePos; - - do - { - localReadPos = Volatile.Read(ref readPos); - localWritePos = Volatile.Read(ref writePos); - - if (localReadPos == localWritePos) - { - return false; // Ϊ - } - } - while (Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos) != localReadPos); - - item = buffer[localReadPos]; - Interlocked.Decrement(ref count); - return true; - } - - public int Available() - { - return Volatile.Read(ref count); - } -} +using System.Threading; + +public class RingBuffer +{ + private readonly T[] buffer; + private readonly int capacity; + private int writePos; + private int readPos; + private int count; + + public RingBuffer(int capacity) + { + this.capacity = capacity; + this.buffer = new T[capacity]; + this.writePos = 0; + this.readPos = 0; + this.count = 0; + } + + public void Write(T item) + { + int localWritePos; + int localReadPos; + + do + { + localWritePos = Volatile.Read(ref writePos); + localReadPos = Volatile.Read(ref readPos); + + int nextWritePos = (localWritePos + 1) % capacity; + + if (nextWritePos == localReadPos) + { + // ɵδ + Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos); + } + } + while (Interlocked.CompareExchange(ref writePos, (localWritePos + 1) % capacity, localWritePos) != localWritePos); + + buffer[localWritePos] = item; + Interlocked.Increment(ref count); + } + + public bool TryRead(out T item) + { + item = default(T); + + int localReadPos; + int localWritePos; + + do + { + localReadPos = Volatile.Read(ref readPos); + localWritePos = Volatile.Read(ref writePos); + + if (localReadPos == localWritePos) + { + return false; // Ϊ + } + } + while (Interlocked.CompareExchange(ref readPos, (localReadPos + 1) % capacity, localReadPos) != localReadPos); + + item = buffer[localReadPos]; + Interlocked.Decrement(ref count); + return true; + } + + public int Available() + { + return Volatile.Read(ref count); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/RingBuffer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/RingBuffer.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/RingBuffer.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/RingBuffer.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/SoundBuffer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/SoundBuffer.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/SoundBuffer.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/SoundBuffer.cs index b647384..0430c54 100644 --- a/AxibugEmuOnline.Client/Assets/Script/SoundBuffer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/SoundBuffer.cs @@ -1,11 +1,11 @@ -using VirtualNes.Core; - -public class SoundBuffer : RingBuffer, ISoundDataBuffer -{ - public SoundBuffer(int capacity) : base(capacity) { } - - public void WriteByte(byte value) - { - Write(value); - } -} +using VirtualNes.Core; + +public class SoundBuffer : RingBuffer, ISoundDataBuffer +{ + public SoundBuffer(int capacity) : base(capacity) { } + + public void WriteByte(byte value) + { + Write(value); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/SoundBuffer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/SoundBuffer.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/SoundBuffer.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/SoundBuffer.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/AlphaWraper.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AlphaWraper.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/AlphaWraper.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AlphaWraper.cs index ddb40b7..cc7c517 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/AlphaWraper.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AlphaWraper.cs @@ -1,91 +1,91 @@ -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class AlphaWraper - { - private bool m_on; - private CanvasGroup m_offUI; - private CanvasGroup m_onUI; - private TweenerCore m_onTween; - private TweenerCore m_offTween; - - public bool On - { - get => m_on; - set - { - if (m_on == value) return; - - m_on = value; - - if (m_onTween != null) - { - m_onTween.Kill(); - m_onTween = null; - } - if (m_offTween != null) - { - m_offTween.Kill(); - m_offTween = null; - } - m_onUI.gameObject.SetActiveEx(true); - m_offUI.gameObject.SetActiveEx(true); - - if (On) - { - float progress = 0f; - m_onTween = DOTween.To(() => progress, (x) => - { - progress = x; - m_onUI.alpha = progress; - m_offUI.alpha = 1 - progress; - }, 1f, 0.3f); - m_onTween.onComplete = () => - { - m_offUI.gameObject.SetActiveEx(false); - }; - } - else - { - float progress = 0f; - m_offTween = DOTween.To(() => progress, (x) => - { - progress = x; - m_onUI.alpha = 1 - progress; - m_offUI.alpha = progress; - }, 1f, 0.3f); - m_offTween.onComplete = () => - { - m_onUI.gameObject.SetActiveEx(false); - }; - } - } - } - - public AlphaWraper(CanvasGroup offUI, CanvasGroup onUI, bool defaultOn) - { - m_offUI = offUI; - m_onUI = onUI; - - m_on = defaultOn; - if (On) - { - onUI.alpha = 1; - onUI.gameObject.SetActiveEx(true); - offUI.alpha = 0; - offUI.gameObject.SetActiveEx(false); - } - else - { - onUI.alpha = 0; - onUI.gameObject.SetActiveEx(false); - offUI.alpha = 1; - offUI.gameObject.SetActiveEx(true); - } - } - } -} +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class AlphaWraper + { + private bool m_on; + private CanvasGroup m_offUI; + private CanvasGroup m_onUI; + private TweenerCore m_onTween; + private TweenerCore m_offTween; + + public bool On + { + get => m_on; + set + { + if (m_on == value) return; + + m_on = value; + + if (m_onTween != null) + { + m_onTween.Kill(); + m_onTween = null; + } + if (m_offTween != null) + { + m_offTween.Kill(); + m_offTween = null; + } + m_onUI.gameObject.SetActiveEx(true); + m_offUI.gameObject.SetActiveEx(true); + + if (On) + { + float progress = 0f; + m_onTween = DOTween.To(() => progress, (x) => + { + progress = x; + m_onUI.alpha = progress; + m_offUI.alpha = 1 - progress; + }, 1f, 0.3f); + m_onTween.onComplete = () => + { + m_offUI.gameObject.SetActiveEx(false); + }; + } + else + { + float progress = 0f; + m_offTween = DOTween.To(() => progress, (x) => + { + progress = x; + m_onUI.alpha = 1 - progress; + m_offUI.alpha = progress; + }, 1f, 0.3f); + m_offTween.onComplete = () => + { + m_onUI.gameObject.SetActiveEx(false); + }; + } + } + } + + public AlphaWraper(CanvasGroup offUI, CanvasGroup onUI, bool defaultOn) + { + m_offUI = offUI; + m_onUI = onUI; + + m_on = defaultOn; + if (On) + { + onUI.alpha = 1; + onUI.gameObject.SetActiveEx(true); + offUI.alpha = 0; + offUI.gameObject.SetActiveEx(false); + } + else + { + onUI.alpha = 0; + onUI.gameObject.SetActiveEx(false); + offUI.alpha = 1; + offUI.gameObject.SetActiveEx(true); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/AlphaWraper.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AlphaWraper.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/AlphaWraper.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AlphaWraper.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AutoRaycastCanvasGroup.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AutoRaycastCanvasGroup.cs index 33e31cc..4637d7f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AutoRaycastCanvasGroup.cs @@ -1,16 +1,16 @@ -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - [RequireComponent(typeof(CanvasGroup))] - public class AutoRaycastCanvasGroup : MonoBehaviour - { - private CanvasGroup canvasGroup; - private void Update() - { - if (canvasGroup == null) canvasGroup = gameObject.GetComponent(); - - canvasGroup.blocksRaycasts = canvasGroup.alpha == 0 ? false : true; - } - } -} +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + [RequireComponent(typeof(CanvasGroup))] + public class AutoRaycastCanvasGroup : MonoBehaviour + { + private CanvasGroup canvasGroup; + private void Update() + { + if (canvasGroup == null) canvasGroup = gameObject.GetComponent(); + + canvasGroup.blocksRaycasts = canvasGroup.alpha == 0 ? false : true; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AutoRaycastCanvasGroup.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/AutoRaycastCanvasGroup.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/BackgroundListMenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/BackgroundListMenuItem.cs index 4cff095..a5e9422 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/BackgroundListMenuItem.cs @@ -1,18 +1,18 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections.Generic; - -namespace AxibugEmuOnline.Client -{ - public class BackgroundListMenuItem : VirtualSubMenuItem - { - protected override void GetVirtualListDatas(Action datas) - { - List list = new List() - { - App.settings.BgColor, - }; - datas.Invoke(list); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections.Generic; + +namespace AxibugEmuOnline.Client +{ + public class BackgroundListMenuItem : VirtualSubMenuItem + { + protected override void GetVirtualListDatas(Action datas) + { + List list = new List() + { + App.settings.BgColor, + }; + datas.Invoke(list); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/BackgroundListMenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/BackgroundListMenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/BackgroundListMenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/GlobalFilterListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/GlobalFilterListMenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/GlobalFilterListMenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/GlobalFilterListMenuItem.cs index 2f0a050..139c83d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/GlobalFilterListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/GlobalFilterListMenuItem.cs @@ -1,32 +1,32 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace AxibugEmuOnline.Client -{ - public class GlobalFilterListMenuItem : VirtualSubMenuItem - { - public override bool OnEnterItem() - { - App.filter.EnableFilterPreview(); - - return base.OnEnterItem(); - } - - public override bool OnExitItem() - { - App.filter.ShutDownFilterPreview(); - App.filter.ShutDownFilter(); - - return base.OnExitItem(); - } - - protected override void GetVirtualListDatas(Action datas) - { - List list = new List(); - list.AddRange(App.filter.Filters.Select(f => (object)f)); - datas.Invoke(list); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace AxibugEmuOnline.Client +{ + public class GlobalFilterListMenuItem : VirtualSubMenuItem + { + public override bool OnEnterItem() + { + App.filter.EnableFilterPreview(); + + return base.OnEnterItem(); + } + + public override bool OnExitItem() + { + App.filter.ShutDownFilterPreview(); + App.filter.ShutDownFilter(); + + return base.OnExitItem(); + } + + protected override void GetVirtualListDatas(Action datas) + { + List list = new List(); + list.AddRange(App.filter.Filters.Select(f => (object)f)); + datas.Invoke(list); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/GlobalFilterListMenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/GlobalFilterListMenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/GlobalFilterListMenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/GlobalFilterListMenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/SettingItemSelector.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/SettingItemSelector.cs index ed0569b..68421fb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/SettingItemSelector.cs @@ -1,13 +1,13 @@ -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class SettingItemSelector : ItemSelector - { - protected override RectTransform OnGetTemplate(object data) - { - if (data is BgColorSettings) return ItemList[0]; - else return null; - } - } -} +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class SettingItemSelector : ItemSelector + { + protected override RectTransform OnGetTemplate(object data) + { + if (data is BgColorSettings) return ItemList[0]; + else return null; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/SettingItemSelector.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/SettingItemSelector.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/SettingItemSelector.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_BgSettingItem_Color.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_BgSettingItem_Color.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_BgSettingItem_Color.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_BgSettingItem_Color.cs index e29bea8..143d8d9 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_BgSettingItem_Color.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_BgSettingItem_Color.cs @@ -1,102 +1,102 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.UI; -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using System.Linq; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - /// - /// ɫUI - /// - public class UI_BgSettingItem_Color : MenuItem, IVirtualItem - { - public int Index { get; set; } - public BgColorSettings Datacontext { get; private set; } - - public void SetData(object data) - { - Datacontext = (BgColorSettings)data; - Datacontext.OnColorChanged += Setting_OnColorChanged; - - UpdateView(); - } - - private void Setting_OnColorChanged(XMBColor color) - { - UpdateView(); - } - - private void UpdateView() - { - var color = Datacontext.CurrentColor; - Icon.GetMaterial().SetColor("_Color1", color.color1); - Icon.GetMaterial().SetColor("_Color2", color.color2); - SetBaseInfo("ɫ", "ɫ", color.Name); - } - - public void SetDependencyProperty(object data) - { - SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); - } - - public void Release() - { - Datacontext.OnColorChanged -= Setting_OnColorChanged; - } - public override bool OnEnterItem() - { - var options = Datacontext.Presets.Select(preset => new ColorOption(preset)).ToList(); - var currentColor = Datacontext.CurrentColor; - var index = options.FindIndex(op => op.Color.GetHashCode() == currentColor.GetHashCode()); - OverlayManager.Pop(options, Mathf.Clamp(index, 0, options.Count - 1)); - return false; - } - - public class ColorOption : ExecuteMenu - { - public XMBColor Color; - - public ColorOption(XMBColor color) : base(color.Name) - { - Color = color; - } - - public override void OnShow(OptionUI_MenuItem ui) - { - ui.IconUI.gameObject.SetActiveEx(true); - ui.IconUI.SetMaterial(Resources.Load("Materials/XMBBackGroundPreview")); - ui.IconUI.GetMaterial().SetColor("_Color1", Color.color1); - ui.IconUI.GetMaterial().SetColor("_Color2", Color.color2); - } - - private static TweenerCore s_colorChangeTween; - public override void OnFocus() - { - float progress = 0; - XMBColor start = App.settings.BgColor.CurrentColor; - XMBColor endColor = Color; - - if (s_colorChangeTween != null) - { - s_colorChangeTween.Kill(); - s_colorChangeTween = null; - } - s_colorChangeTween = DOTween.To(() => progress, (x) => - { - progress = x; - var lerpColor = XMBColor.Lerp(start, endColor, x); - App.settings.BgColor.CurrentColor = lerpColor; - }, 1, 1f).SetEase(Ease.OutCubic); - s_colorChangeTween.onComplete = () => - { - s_colorChangeTween = null; - }; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) { } - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using System.Linq; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + /// + /// ɫUI + /// + public class UI_BgSettingItem_Color : MenuItem, IVirtualItem + { + public int Index { get; set; } + public BgColorSettings Datacontext { get; private set; } + + public void SetData(object data) + { + Datacontext = (BgColorSettings)data; + Datacontext.OnColorChanged += Setting_OnColorChanged; + + UpdateView(); + } + + private void Setting_OnColorChanged(XMBColor color) + { + UpdateView(); + } + + private void UpdateView() + { + var color = Datacontext.CurrentColor; + Icon.GetMaterial().SetColor("_Color1", color.color1); + Icon.GetMaterial().SetColor("_Color2", color.color2); + SetBaseInfo("ɫ", "ɫ", color.Name); + } + + public void SetDependencyProperty(object data) + { + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + } + + public void Release() + { + Datacontext.OnColorChanged -= Setting_OnColorChanged; + } + public override bool OnEnterItem() + { + var options = Datacontext.Presets.Select(preset => new ColorOption(preset)).ToList(); + var currentColor = Datacontext.CurrentColor; + var index = options.FindIndex(op => op.Color.GetHashCode() == currentColor.GetHashCode()); + OverlayManager.Pop(options, Mathf.Clamp(index, 0, options.Count - 1)); + return false; + } + + public class ColorOption : ExecuteMenu + { + public XMBColor Color; + + public ColorOption(XMBColor color) : base(color.Name) + { + Color = color; + } + + public override void OnShow(OptionUI_MenuItem ui) + { + ui.IconUI.gameObject.SetActiveEx(true); + ui.IconUI.SetMaterial(Resources.Load("Materials/XMBBackGroundPreview")); + ui.IconUI.GetMaterial().SetColor("_Color1", Color.color1); + ui.IconUI.GetMaterial().SetColor("_Color2", Color.color2); + } + + private static TweenerCore s_colorChangeTween; + public override void OnFocus() + { + float progress = 0; + XMBColor start = App.settings.BgColor.CurrentColor; + XMBColor endColor = Color; + + if (s_colorChangeTween != null) + { + s_colorChangeTween.Kill(); + s_colorChangeTween = null; + } + s_colorChangeTween = DOTween.To(() => progress, (x) => + { + progress = x; + var lerpColor = XMBColor.Lerp(start, endColor, x); + App.settings.BgColor.CurrentColor = lerpColor; + }, 1, 1f).SetEase(Ease.OutCubic); + s_colorChangeTween.onComplete = () => + { + s_colorChangeTween = null; + }; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) { } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_BgSettingItem_Color.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_BgSettingItem_Color.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_BgSettingItem_Color.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_BgSettingItem_Color.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_FilterItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_FilterItem.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_FilterItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_FilterItem.cs index 562f067..d37c33d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_FilterItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_FilterItem.cs @@ -1,183 +1,188 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.UI; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using static AxibugEmuOnline.Client.FilterManager; - -namespace AxibugEmuOnline.Client -{ - /// - /// ɫUI - /// - public class UI_FilterItem : MenuItem, IVirtualItem - { - public int Index { get; set; } - public Filter Datacontext { get; private set; } - - public void SetData(object data) - { - Datacontext = data as Filter; - - UpdateView(); - } - - private void UpdateView() - { - SetBaseInfo(Datacontext.Name, $":{Datacontext.Paramerters.Count}", null); - } - - public void SetDependencyProperty(object data) - { - SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); - - if (m_select) - { - App.filter.EnableFilterPreview(); - App.filter.EnableFilter(Datacontext); - } - } - - public void Release() { } - - public override bool OnEnterItem() - { - var opts = new List(); - opts.Add(new Opt_CreatePreset(Datacontext)); - opts.AddRange(Datacontext.Presets.Select(p => new Opt_Presets(Datacontext, p))); - - OverlayManager.Pop(opts, onClose: () => - { - App.filter.EnableFilterPreview(); - Datacontext.ResetPreset(); - App.filter.EnableFilter(Datacontext); - }); - return false; - } - - - public class Opt_CreatePreset : ExecuteMenu - { - private Filter m_filter; - - public Opt_CreatePreset(Filter filter) : base("˾Ԥ", Resources.LoadAll("Icons/XMB-Icons/misc")[0]) - { - m_filter = filter; - } - - public override void OnFocus() - { - m_filter.ResetPreset(); - App.filter.EnableFilter(m_filter); - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - cancelHide = true; - - OverlayManager.Input((presetName) => - { - var result = m_filter.CreatePreset(presetName, out var newPreset); - if (!result) OverlayManager.PopMsg(result); - else optionUI.AddOptionMenuWhenPoping(new Opt_Presets(m_filter, newPreset)); - }, "ΪԤһ", string.Empty); - } - } - public class Opt_Presets : ExpandMenu - { - private Filter m_filter; - private FilterPreset m_preset; - private OptionUI_MenuItem m_ui; - private List m_menu; - - public Opt_Presets(Filter filter, FilterPreset preset) : base(preset.Name, null) - { - m_filter = filter; - m_preset = preset; - - m_menu = new List(); - m_menu.Add(new Opt_Delete(m_filter, m_preset)); - foreach (var p in m_filter.Paramerters) m_menu.Add(new Opt_ParamEditor(m_filter, p, m_preset)); - } - - public override void OnShow(OptionUI_MenuItem ui) - { - EventInvoker.OnFilterPresetRemoved += EventInvoker_OnFilterPresetRemoved; - m_ui = ui; - base.OnShow(ui); - } - - public override void OnHide() - { - EventInvoker.OnFilterPresetRemoved -= EventInvoker_OnFilterPresetRemoved; - } - - private void EventInvoker_OnFilterPresetRemoved(Filter filter, FilterPreset removedPreset) - { - if (filter != m_filter || m_preset != removedPreset) return; - m_ui.OptionUI.RemoveItem(m_ui); - } - - public override void OnFocus() - { - m_filter.ApplyPreset(m_preset); - App.filter.EnableFilter(m_filter); - } - - protected override List GetOptionMenus() - { - return m_menu; - } - - public class Opt_ParamEditor : ValueSetMenu - { - private Filter m_filter; - private FilterEffect.EditableParamerter m_param; - private FilterPreset m_preset; - - public Opt_ParamEditor(Filter filter, FilterEffect.EditableParamerter editParam, FilterPreset preset) - : base(editParam.Name) - { - m_filter = filter; - m_param = editParam; - m_preset = preset; - } - - public override Type ValueType => m_param.ValueType; - - public override object ValueRaw => m_preset.GetParamValue(m_param.Name, ValueType) ?? m_param.Value; - - public override void OnValueChanged(object newValue) - { - m_preset.SetParamValue(m_param.Name, ValueType, newValue); - m_filter.SavePresets(); - m_param.Apply(newValue); - } - - public override object Min => m_param.MinValue; - - public override object Max => m_param.MaxValue; - } - - public class Opt_Delete : ExecuteMenu - { - private Filter m_filter; - private FilterPreset m_preset; - - public Opt_Delete(Filter filter, FilterPreset preset) : base("ɾԤ", null) - { - m_filter = filter; - m_preset = preset; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - m_filter.RemovePreset(m_preset); - } - } - - - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.UI; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using static AxibugEmuOnline.Client.FilterManager; + +namespace AxibugEmuOnline.Client +{ + /// + /// ɫUI + /// + public class UI_FilterItem : MenuItem, IVirtualItem + { + public int Index { get; set; } + public Filter Datacontext { get; private set; } + + public void SetData(object data) + { + Datacontext = data as Filter; + + UpdateView(); + } + + private void UpdateView() + { + SetBaseInfo(Datacontext.Name, $":{Datacontext.Paramerters.Count}", null); + } + + public void SetDependencyProperty(object data) + { + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + + if (m_select) + { + App.filter.EnableFilterPreview(); + App.filter.EnableFilter(Datacontext); + } + } + + public void Release() { } + + public override bool OnEnterItem() + { + var opts = new List(); + opts.Add(new Opt_CreatePreset(Datacontext)); + opts.AddRange(Datacontext.Presets.Select(p => new Opt_Presets(Datacontext, p))); + + OverlayManager.Pop(opts, onClose: () => + { + App.filter.EnableFilterPreview(); + Datacontext.ResetPreset(); + App.filter.EnableFilter(Datacontext); + }); + return false; + } + + + public class Opt_CreatePreset : ExecuteMenu + { + private Filter m_filter; + + public Opt_CreatePreset(Filter filter) : base("˾Ԥ", Resources.LoadAll("Icons/XMB-Icons/misc")[0]) + { + m_filter = filter; + } + + public override void OnFocus() + { + m_filter.ResetPreset(); + App.filter.EnableFilter(m_filter); + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + cancelHide = true; + + OverlayManager.Input((presetName) => + { + var result = m_filter.CreatePreset(presetName, out var newPreset); + if (!result) OverlayManager.PopMsg(result); + else optionUI.AddOptionMenuWhenPoping(new Opt_Presets(m_filter, newPreset)); + }, "ΪԤһ", string.Empty); + } + } + public class Opt_Presets : ExpandMenu + { + private Filter m_filter; + private FilterPreset m_preset; + private OptionUI_MenuItem m_ui; + private List m_menu; + + public Opt_Presets(Filter filter, FilterPreset preset) : base(preset.Name, null) + { + m_filter = filter; + m_preset = preset; + + m_menu = new List(); + m_menu.Add(new Opt_Delete(m_filter, m_preset)); + foreach (var p in m_filter.Paramerters) + { + m_menu.Add(new Opt_ParamEditor(m_filter, p, m_preset)); + } + } + + public override void OnShow(OptionUI_MenuItem ui) + { + EventInvoker.OnFilterPresetRemoved += EventInvoker_OnFilterPresetRemoved; + m_ui = ui; + base.OnShow(ui); + } + + public override void OnHide() + { + EventInvoker.OnFilterPresetRemoved -= EventInvoker_OnFilterPresetRemoved; + } + + private void EventInvoker_OnFilterPresetRemoved(Filter filter, FilterPreset removedPreset) + { + if (filter != m_filter || m_preset != removedPreset) return; + m_ui.OptionUI.RemoveItem(m_ui); + } + + public override void OnFocus() + { + m_filter.ApplyPreset(m_preset); + App.filter.EnableFilter(m_filter); + } + + protected override List GetOptionMenus() + { + return m_menu; + } + + public class Opt_ParamEditor : ValueSetMenu + { + private Filter m_filter; + private FilterEffect.EditableParamerter m_param; + private FilterPreset m_preset; + + public override bool Visible => m_param.ValueType.IsEnum || m_param.ValueType == typeof(float); + + public Opt_ParamEditor(Filter filter, FilterEffect.EditableParamerter editParam, FilterPreset preset) + : base(editParam.Name) + { + m_filter = filter; + m_param = editParam; + m_preset = preset; + } + + public override Type ValueType => m_param.ValueType; + + public override object ValueRaw => m_preset.GetParamValue(m_param.Name, ValueType) ?? m_param.Value; + + public override void OnValueChanged(object newValue) + { + m_preset.SetParamValue(m_param.Name, ValueType, newValue); + m_filter.SavePresets(); + m_param.Apply(newValue); + } + + public override object Min => m_param.MinValue; + + public override object Max => m_param.MaxValue; + } + + public class Opt_Delete : ExecuteMenu + { + private Filter m_filter; + private FilterPreset m_preset; + + public Opt_Delete(Filter filter, FilterPreset preset) : base("ɾԤ", null) + { + m_filter = filter; + m_preset = preset; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + m_filter.RemovePreset(m_preset); + } + } + + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_FilterItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_FilterItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/BgSettingsUI/UI_FilterItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/BgSettingsUI/UI_FilterItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandDispatcher.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandDispatcher.cs index 43a8a8b..70765f4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandDispatcher.cs @@ -1,137 +1,137 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class CommandDispatcher : MonoBehaviour - { - public static CommandDispatcher Instance { get; private set; } - - /// ƽע,Ӧָ - List m_register = new List(); - /// ռע,ָᱻбһռ - List m_registerHigh = new List(); - - ICommandListener m_listener; - /// ׼UI - public IKeyMapperChanger Normal { get; private set; } - /// ϷUI - public IKeyMapperChanger Gaming { get; private set; } - - private IKeyMapperChanger m_current; - public IKeyMapperChanger Current - { - get => m_current; - set - { - m_current = value; - - SetKeyMapper(m_current); - } - } - - private void Awake() - { - Instance = this; - - //ʼcommand - m_listener = new CommandListener(); - - //ʼλ޸ - Normal = new NormalChanger(); - Gaming = new GamingChanger(); - } - - private void OnDestroy() - { - Instance = null; - } - - public bool IsRegisted(CommandExecuter commandExecuter) - { - return m_register.Contains(commandExecuter) || m_registerHigh.Contains(commandExecuter); - } - - public void RegistController(CommandExecuter controller) - { - if (!controller.AloneMode) - { - if (m_register.Contains(controller)) { return; } - - m_register.Add(controller); - } - else - { - if (m_registerHigh.Contains(controller)) { return; } - - m_registerHigh.Add(controller); - } - } - - public void UnRegistController(CommandExecuter menuItemController) - { - if (!menuItemController.AloneMode) - m_register.Remove(menuItemController); - else - m_registerHigh.Remove(menuItemController); - } - - readonly List oneFrameRegister = new List(); - private void Update() - { - if (!InputUI.IsInputing) - { - peekRegister(oneFrameRegister); - m_listener.Update(oneFrameRegister); - } - - //λӳڰӦĶջ,ֹ޸ - if (m_waitMapperSetting != null) - { - m_listener.ApplyKeyMapper(m_waitMapperSetting); - m_waitMapperSetting = null; - } - } - - IKeyMapperChanger m_waitMapperSetting = null; - void SetKeyMapper(IKeyMapperChanger keyMapChanger) - { - m_waitMapperSetting = keyMapChanger; - } - - private List peekRegister(List results) - { - results.Clear(); - - if (m_registerHigh.Count > 0) - { - for (int i = m_registerHigh.Count - 1; i >= 0; i--) - { - var controller = m_registerHigh[i]; - if (controller.Enable) - { - results.Add(controller); - return results; - } - } - } - - foreach (var controller in m_register) - { - if (!controller.Enable) continue; - - results.Add(controller); - } - - return results; - } - -#if UNITY_EDITOR - public void GetRegisters(out IReadOnlyList normal, out IReadOnlyList alone) - { - normal = m_register; - alone = m_registerHigh; - } -#endif - } -} +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class CommandDispatcher : MonoBehaviour + { + public static CommandDispatcher Instance { get; private set; } + + /// ƽע,Ӧָ + List m_register = new List(); + /// ռע,ָᱻбһռ + List m_registerHigh = new List(); + + ICommandListener m_listener; + /// ׼UI + public IKeyMapperChanger Normal { get; private set; } + /// ϷUI + public IKeyMapperChanger Gaming { get; private set; } + + private IKeyMapperChanger m_current; + public IKeyMapperChanger Current + { + get => m_current; + set + { + m_current = value; + + SetKeyMapper(m_current); + } + } + + private void Awake() + { + Instance = this; + + //ʼcommand + m_listener = new CommandListener(); + + //ʼλ޸ + Normal = new NormalChanger(); + Gaming = new GamingChanger(); + } + + private void OnDestroy() + { + Instance = null; + } + + public bool IsRegisted(CommandExecuter commandExecuter) + { + return m_register.Contains(commandExecuter) || m_registerHigh.Contains(commandExecuter); + } + + public void RegistController(CommandExecuter controller) + { + if (!controller.AloneMode) + { + if (m_register.Contains(controller)) { return; } + + m_register.Add(controller); + } + else + { + if (m_registerHigh.Contains(controller)) { return; } + + m_registerHigh.Add(controller); + } + } + + public void UnRegistController(CommandExecuter menuItemController) + { + if (!menuItemController.AloneMode) + m_register.Remove(menuItemController); + else + m_registerHigh.Remove(menuItemController); + } + + readonly List oneFrameRegister = new List(); + private void Update() + { + if (!InputUI.IsInputing) + { + peekRegister(oneFrameRegister); + m_listener.Update(oneFrameRegister); + } + + //λӳڰӦĶջ,ֹ޸ + if (m_waitMapperSetting != null) + { + m_listener.ApplyKeyMapper(m_waitMapperSetting); + m_waitMapperSetting = null; + } + } + + IKeyMapperChanger m_waitMapperSetting = null; + void SetKeyMapper(IKeyMapperChanger keyMapChanger) + { + m_waitMapperSetting = keyMapChanger; + } + + private List peekRegister(List results) + { + results.Clear(); + + if (m_registerHigh.Count > 0) + { + for (int i = m_registerHigh.Count - 1; i >= 0; i--) + { + var controller = m_registerHigh[i]; + if (controller.Enable) + { + results.Add(controller); + return results; + } + } + } + + foreach (var controller in m_register) + { + if (!controller.Enable) continue; + + results.Add(controller); + } + + return results; + } + +#if UNITY_EDITOR + public void GetRegisters(out IReadOnlyList normal, out IReadOnlyList alone) + { + normal = m_register; + alone = m_registerHigh; + } +#endif + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandDispatcher.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandDispatcher.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandDispatcher.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandExcuter.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandExcuter.cs index 0da7fd4..507d848 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandExcuter.cs @@ -1,140 +1,140 @@ -using AxibugEmuOnline.Client.UI; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public abstract class CommandExecuter : MonoBehaviour - { - private PulseInvoker m_pulsInvoker_Left; - private PulseInvoker m_pulsInvoker_Right; - private PulseInvoker m_pulsInvoker_Up; - private PulseInvoker m_pulsInvoker_Down; - - float PulseInvoke_Delay = 0.4f; - float PulseInvoke_Interval = 0.05f; - - public abstract bool Enable { get; } - public virtual bool AloneMode { get; } - public bool Registed => CommandDispatcher.Instance.IsRegisted(this); - - protected virtual void Awake() - { - m_pulsInvoker_Left = new PulseInvoker(OnCmdSelectItemLeft, PulseInvoke_Delay, PulseInvoke_Interval); - m_pulsInvoker_Right = new PulseInvoker(OnCmdSelectItemRight, PulseInvoke_Delay, PulseInvoke_Interval); - m_pulsInvoker_Up = new PulseInvoker(OnCmdSelectItemUp, PulseInvoke_Delay, PulseInvoke_Interval); - m_pulsInvoker_Down = new PulseInvoker(OnCmdSelectItemDown, PulseInvoke_Delay, PulseInvoke_Interval); - } - - protected virtual void OnEnable() { } - protected virtual void OnDisable() { } - protected virtual void OnDestroy() { } - - protected virtual void Update() - { - if (Registed && Enable) - { - m_pulsInvoker_Left.Update(Time.deltaTime); - m_pulsInvoker_Right.Update(Time.deltaTime); - m_pulsInvoker_Up.Update(Time.deltaTime); - m_pulsInvoker_Down.Update(Time.deltaTime); - } - else - { - m_pulsInvoker_Left.DisActive(); - m_pulsInvoker_Right.DisActive(); - m_pulsInvoker_Up.DisActive(); - m_pulsInvoker_Down.DisActive(); - } - } - - - public void ResetPulsInvoker() - { - m_pulsInvoker_Left.DisActive(); - m_pulsInvoker_Right.DisActive(); - m_pulsInvoker_Up.DisActive(); - m_pulsInvoker_Down.DisActive(); - } - - public void ExecuteCommand(EnumCommand cmd, bool cancel) - { - if (cmd == EnumCommand.NONE) return; - if (!cancel) - { - switch (cmd) - { - case EnumCommand.SelectItemLeft: - m_pulsInvoker_Left.SetActive(); - OnCmdSelectItemLeft(); - break; - case EnumCommand.SelectItemRight: - m_pulsInvoker_Right.SetActive(); - OnCmdSelectItemRight(); - break; - case EnumCommand.SelectItemUp: - m_pulsInvoker_Up.SetActive(); - OnCmdSelectItemUp(); - break; - case EnumCommand.SelectItemDown: - m_pulsInvoker_Down.SetActive(); - OnCmdSelectItemDown(); - break; - case EnumCommand.Enter: - if (OnCmdEnter()) - { - m_pulsInvoker_Left.DisActive(); - m_pulsInvoker_Right.DisActive(); - m_pulsInvoker_Up.DisActive(); - m_pulsInvoker_Down.DisActive(); - } - break; - case EnumCommand.Back: - OnCmdBack(); - break; - case EnumCommand.OptionMenu: - OnCmdOptionMenu(); - break; - } - } - else - { - switch (cmd) - { - case EnumCommand.SelectItemLeft: - m_pulsInvoker_Left.DisActive(); break; - case EnumCommand.SelectItemRight: - m_pulsInvoker_Right.DisActive(); break; - case EnumCommand.SelectItemUp: - m_pulsInvoker_Up.DisActive(); break; - case EnumCommand.SelectItemDown: - m_pulsInvoker_Down.DisActive(); break; - } - } - } - - protected virtual void OnCmdSelectItemLeft() { } - - protected virtual void OnCmdSelectItemRight() { } - - protected virtual void OnCmdSelectItemUp() { } - - protected virtual void OnCmdSelectItemDown() { } - - protected virtual void OnCmdOptionMenu() { } - protected virtual bool OnCmdEnter() => false; - protected virtual void OnCmdBack() { } - - } - - public enum EnumCommand - { - NONE, - SelectItemLeft, - SelectItemRight, - SelectItemUp, - SelectItemDown, - Enter, - Back, - OptionMenu - } -} +using AxibugEmuOnline.Client.UI; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public abstract class CommandExecuter : MonoBehaviour + { + private PulseInvoker m_pulsInvoker_Left; + private PulseInvoker m_pulsInvoker_Right; + private PulseInvoker m_pulsInvoker_Up; + private PulseInvoker m_pulsInvoker_Down; + + float PulseInvoke_Delay = 0.4f; + float PulseInvoke_Interval = 0.05f; + + public abstract bool Enable { get; } + public virtual bool AloneMode { get; } + public bool Registed => CommandDispatcher.Instance.IsRegisted(this); + + protected virtual void Awake() + { + m_pulsInvoker_Left = new PulseInvoker(OnCmdSelectItemLeft, PulseInvoke_Delay, PulseInvoke_Interval); + m_pulsInvoker_Right = new PulseInvoker(OnCmdSelectItemRight, PulseInvoke_Delay, PulseInvoke_Interval); + m_pulsInvoker_Up = new PulseInvoker(OnCmdSelectItemUp, PulseInvoke_Delay, PulseInvoke_Interval); + m_pulsInvoker_Down = new PulseInvoker(OnCmdSelectItemDown, PulseInvoke_Delay, PulseInvoke_Interval); + } + + protected virtual void OnEnable() { } + protected virtual void OnDisable() { } + protected virtual void OnDestroy() { } + + protected virtual void Update() + { + if (Registed && Enable) + { + m_pulsInvoker_Left.Update(Time.deltaTime); + m_pulsInvoker_Right.Update(Time.deltaTime); + m_pulsInvoker_Up.Update(Time.deltaTime); + m_pulsInvoker_Down.Update(Time.deltaTime); + } + else + { + m_pulsInvoker_Left.DisActive(); + m_pulsInvoker_Right.DisActive(); + m_pulsInvoker_Up.DisActive(); + m_pulsInvoker_Down.DisActive(); + } + } + + + public void ResetPulsInvoker() + { + m_pulsInvoker_Left.DisActive(); + m_pulsInvoker_Right.DisActive(); + m_pulsInvoker_Up.DisActive(); + m_pulsInvoker_Down.DisActive(); + } + + public void ExecuteCommand(EnumCommand cmd, bool cancel) + { + if (cmd == EnumCommand.NONE) return; + if (!cancel) + { + switch (cmd) + { + case EnumCommand.SelectItemLeft: + m_pulsInvoker_Left.SetActive(); + OnCmdSelectItemLeft(); + break; + case EnumCommand.SelectItemRight: + m_pulsInvoker_Right.SetActive(); + OnCmdSelectItemRight(); + break; + case EnumCommand.SelectItemUp: + m_pulsInvoker_Up.SetActive(); + OnCmdSelectItemUp(); + break; + case EnumCommand.SelectItemDown: + m_pulsInvoker_Down.SetActive(); + OnCmdSelectItemDown(); + break; + case EnumCommand.Enter: + if (OnCmdEnter()) + { + m_pulsInvoker_Left.DisActive(); + m_pulsInvoker_Right.DisActive(); + m_pulsInvoker_Up.DisActive(); + m_pulsInvoker_Down.DisActive(); + } + break; + case EnumCommand.Back: + OnCmdBack(); + break; + case EnumCommand.OptionMenu: + OnCmdOptionMenu(); + break; + } + } + else + { + switch (cmd) + { + case EnumCommand.SelectItemLeft: + m_pulsInvoker_Left.DisActive(); break; + case EnumCommand.SelectItemRight: + m_pulsInvoker_Right.DisActive(); break; + case EnumCommand.SelectItemUp: + m_pulsInvoker_Up.DisActive(); break; + case EnumCommand.SelectItemDown: + m_pulsInvoker_Down.DisActive(); break; + } + } + } + + protected virtual void OnCmdSelectItemLeft() { } + + protected virtual void OnCmdSelectItemRight() { } + + protected virtual void OnCmdSelectItemUp() { } + + protected virtual void OnCmdSelectItemDown() { } + + protected virtual void OnCmdOptionMenu() { } + protected virtual bool OnCmdEnter() => false; + protected virtual void OnCmdBack() { } + + } + + public enum EnumCommand + { + NONE, + SelectItemLeft, + SelectItemRight, + SelectItemUp, + SelectItemDown, + Enter, + Back, + OptionMenu + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandExcuter.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandExcuter.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandListener.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandListener.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandListener.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandListener.cs index 2eb5f9d..a04550a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandListener.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandListener.cs @@ -1,38 +1,38 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class CommandListener : ICommandListener - { - Dictionary m_keyMapper = new Dictionary(); - List m_commands = new List(); - IEnumerable GetCommand() - { - m_commands.Clear(); - foreach (var item in m_keyMapper) - { - if (Input.GetKeyDown(item.Key)) m_commands.Add(new CommandState { Cmd = item.Value, Cancel = false }); - if (Input.GetKeyUp(item.Key)) m_commands.Add(new CommandState { Cmd = item.Value, Cancel = true }); - } - - return m_commands; - } - public void ApplyKeyMapper(IKeyMapperChanger changer) - { - var cfg = (Dictionary)changer.GetConfig(); - m_keyMapper = cfg; - } - - public void Update(IEnumerable executers) - { - foreach (var cmd in GetCommand()) - { - foreach (var executer in executers) - { - executer.ExecuteCommand(cmd.Cmd, cmd.Cancel); - } - } - } - } -} +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class CommandListener : ICommandListener + { + Dictionary m_keyMapper = new Dictionary(); + List m_commands = new List(); + IEnumerable GetCommand() + { + m_commands.Clear(); + foreach (var item in m_keyMapper) + { + if (Input.GetKeyDown(item.Key)) m_commands.Add(new CommandState { Cmd = item.Value, Cancel = false }); + if (Input.GetKeyUp(item.Key)) m_commands.Add(new CommandState { Cmd = item.Value, Cancel = true }); + } + + return m_commands; + } + public void ApplyKeyMapper(IKeyMapperChanger changer) + { + var cfg = (Dictionary)changer.GetConfig(); + m_keyMapper = cfg; + } + + public void Update(IEnumerable executers) + { + foreach (var cmd in GetCommand()) + { + foreach (var executer in executers) + { + executer.ExecuteCommand(cmd.Cmd, cmd.Cancel); + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandListener.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandListener.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandListener.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/CommandListener.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/ICommandListener.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/ICommandListener.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/ICommandListener.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/ICommandListener.cs index 559eb07..9d0e9be 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/ICommandListener.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/ICommandListener.cs @@ -1,25 +1,25 @@ -using System.Collections.Generic; - -namespace AxibugEmuOnline.Client -{ - public interface IKeyMapperChanger - { - string Name { get; } - object GetConfig(); - } - public interface ICommandListener - { - /// - /// 应用键位设置 - /// - /// - void ApplyKeyMapper(IKeyMapperChanger changer); - void Update(IEnumerable commands); - } - - public struct CommandState - { - public EnumCommand Cmd; - public bool Cancel; - } -} +using System.Collections.Generic; + +namespace AxibugEmuOnline.Client +{ + public interface IKeyMapperChanger + { + string Name { get; } + object GetConfig(); + } + public interface ICommandListener + { + /// + /// 应用键位设置 + /// + /// + void ApplyKeyMapper(IKeyMapperChanger changer); + void Update(IEnumerable commands); + } + + public struct CommandState + { + public EnumCommand Cmd; + public bool Cancel; + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/ICommandListener.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/ICommandListener.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/ICommandListener.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/CommandDispatcher/ICommandListener.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/GamesUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomItem.cs index abeefb8..65a339d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomItem.cs @@ -1,115 +1,115 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.UI; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class RomItem : MenuItem, IVirtualItem - { - [SerializeField] - Image m_romImage; - - [SerializeField] - GameObject DownloadingFlag; - [SerializeField] - Slider DownProgress; - [SerializeField] - GameObject FileReadyFlag; - - public int Index { get; set; } - - private RomLib m_romlib => App.nesRomLib; - private RomFile m_romfile; - - public void SetData(object data) - { - Reset(); - - m_romfile = (RomFile)data; - m_romfile.OnInfoFilled += OnRomInfoFilled; - m_romImage.sprite = null; - - UpdateView(); - - if (!m_romfile.InfoReady) - { - m_romlib.BeginFetchRomInfo(m_romfile); - } - - SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); - } - - public void SetDependencyProperty(object data) - { - SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); - } - - public void Release() - { - m_romfile.OnInfoFilled -= OnRomInfoFilled; - } - - private void OnRomInfoFilled() - { - UpdateView(); - } - - private void UpdateView() - { - if (!m_romfile.InfoReady) - { - SetBaseInfo("ȡ", "---", "---"); - } - else - { - SetBaseInfo(m_romfile.Alias, m_romfile.Descript, m_romfile.GameTypeDes); - App.CacheMgr.GetSpriteCache(m_romfile.ImageURL, (img, url) => - { - if (url != m_romfile.ImageURL) return; - - m_romImage.sprite = img; - }); - } - } - - public override bool OnEnterItem() - { - if (!m_romfile.RomReady) - { - m_romfile.BeginDownload(); - return false; - } - else - { - //һûԼṩRomʱ,ʹ - //App.emu.BeginGame(App.nesRomLib.GetExistRom("bad_apple_2_5.nes")); - App.emu.BeginGame(m_romfile); - - return false; - } - } - - - protected override void Update() - { - DownloadingFlag.SetActiveEx(false); - FileReadyFlag.SetActiveEx(false); - - if (m_romfile == null) return; - if (!m_romfile.InfoReady) return; - - if (m_romfile.IsDownloading) - { - DownloadingFlag.SetActiveEx(true); - DownProgress.value = m_romfile.Progress; - } - else if (m_romfile.RomReady) - { - FileReadyFlag.SetActiveEx(true); - } - - base.Update(); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.UI; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class RomItem : MenuItem, IVirtualItem + { + [SerializeField] + Image m_romImage; + + [SerializeField] + GameObject DownloadingFlag; + [SerializeField] + Slider DownProgress; + [SerializeField] + GameObject FileReadyFlag; + + public int Index { get; set; } + + private RomLib m_romlib => App.nesRomLib; + private RomFile m_romfile; + + public void SetData(object data) + { + Reset(); + + m_romfile = (RomFile)data; + m_romfile.OnInfoFilled += OnRomInfoFilled; + m_romImage.sprite = null; + + UpdateView(); + + if (!m_romfile.InfoReady) + { + m_romlib.BeginFetchRomInfo(m_romfile); + } + + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + } + + public void SetDependencyProperty(object data) + { + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + } + + public void Release() + { + m_romfile.OnInfoFilled -= OnRomInfoFilled; + } + + private void OnRomInfoFilled() + { + UpdateView(); + } + + private void UpdateView() + { + if (!m_romfile.InfoReady) + { + SetBaseInfo("ȡ", "---", "---"); + } + else + { + SetBaseInfo(m_romfile.Alias, m_romfile.Descript, m_romfile.GameTypeDes); + App.CacheMgr.GetSpriteCache(m_romfile.ImageURL, (img, url) => + { + if (url != m_romfile.ImageURL) return; + + m_romImage.sprite = img; + }); + } + } + + public override bool OnEnterItem() + { + if (!m_romfile.RomReady) + { + m_romfile.BeginDownload(); + return false; + } + else + { + //һûԼṩRomʱ,ʹ + //App.emu.BeginGame(App.nesRomLib.GetExistRom("bad_apple_2_5.nes")); + App.emu.BeginGame(m_romfile); + + return false; + } + } + + + protected override void Update() + { + DownloadingFlag.SetActiveEx(false); + FileReadyFlag.SetActiveEx(false); + + if (m_romfile == null) return; + if (!m_romfile.InfoReady) return; + + if (m_romfile.IsDownloading) + { + DownloadingFlag.SetActiveEx(true); + DownProgress.value = m_romfile.Progress; + } + else if (m_romfile.RomReady) + { + FileReadyFlag.SetActiveEx(true); + } + + base.Update(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomListMenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomListMenuItem.cs index 88fae1c..ed48b2c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomListMenuItem.cs @@ -1,107 +1,107 @@ -using AxibugEmuOnline.Client.ClientCore; -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class RomListMenuItem : VirtualSubMenuItem - { - [SerializeField] - protected EnumPlatform Platform; - - private RomLib RomLib - { - get - { - switch (Platform) - { - case EnumPlatform.NES: - return App.nesRomLib; - default: - throw new System.NotImplementedException($"δʵֵƽ̨ {Platform}"); - } - } - } - - private List m_options; - - protected override void Awake() - { - base.Awake(); - - m_options = new List() - { - new OptMenu_Search(this), - new OptMenu_ShowAll(this), - }; - } - - public string SearchKey; - protected override void GetVirtualListDatas(Action datas) - { - RomLib.FetchRomCount((roms) => datas.Invoke(roms), SearchKey); - } - - public override bool OnEnterItem() - { - var res = base.OnEnterItem(); - if (res) CommandDispatcher.Instance.RegistController(this); - - return true; - } - - public override bool OnExitItem() - { - var res = base.OnExitItem(); - if (res) CommandDispatcher.Instance.UnRegistController(this); - - return false; - } - - - protected override void OnCmdOptionMenu() - { - OverlayManager.Pop(m_options); - } - - public class OptMenu_Search : ExecuteMenu - { - private RomListMenuItem m_romListUI; - - public OptMenu_Search(RomListMenuItem romListUI, Sprite icon = null) : base("", icon) - { - m_romListUI = romListUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - OverlayManager.Input(OnSearchCommit, "Rom", m_romListUI.SearchKey); - } - - private void OnSearchCommit(string text) - { - m_romListUI.SearchKey = text; - m_romListUI.RefreshUI(); - } - } - - public class OptMenu_ShowAll : ExecuteMenu - { - private RomListMenuItem m_ui; - - public override bool Visible => !string.IsNullOrWhiteSpace(m_ui.SearchKey); - - public OptMenu_ShowAll(RomListMenuItem romListUI, Sprite icon = null) : base("ʾȫ", icon) - { - m_ui = romListUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - m_ui.SearchKey = null; - m_ui.RefreshUI(); - } - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class RomListMenuItem : VirtualSubMenuItem + { + [SerializeField] + protected EnumPlatform Platform; + + private RomLib RomLib + { + get + { + switch (Platform) + { + case EnumPlatform.NES: + return App.nesRomLib; + default: + throw new System.NotImplementedException($"δʵֵƽ̨ {Platform}"); + } + } + } + + private List m_options; + + protected override void Awake() + { + base.Awake(); + + m_options = new List() + { + new OptMenu_Search(this), + new OptMenu_ShowAll(this), + }; + } + + public string SearchKey; + protected override void GetVirtualListDatas(Action datas) + { + RomLib.FetchRomCount((roms) => datas.Invoke(roms), SearchKey); + } + + public override bool OnEnterItem() + { + var res = base.OnEnterItem(); + if (res) CommandDispatcher.Instance.RegistController(this); + + return true; + } + + public override bool OnExitItem() + { + var res = base.OnExitItem(); + if (res) CommandDispatcher.Instance.UnRegistController(this); + + return false; + } + + + protected override void OnCmdOptionMenu() + { + OverlayManager.Pop(m_options); + } + + public class OptMenu_Search : ExecuteMenu + { + private RomListMenuItem m_romListUI; + + public OptMenu_Search(RomListMenuItem romListUI, Sprite icon = null) : base("", icon) + { + m_romListUI = romListUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + OverlayManager.Input(OnSearchCommit, "Rom", m_romListUI.SearchKey); + } + + private void OnSearchCommit(string text) + { + m_romListUI.SearchKey = text; + m_romListUI.RefreshUI(); + } + } + + public class OptMenu_ShowAll : ExecuteMenu + { + private RomListMenuItem m_ui; + + public override bool Visible => !string.IsNullOrWhiteSpace(m_ui.SearchKey); + + public OptMenu_ShowAll(RomListMenuItem romListUI, Sprite icon = null) : base("ʾȫ", icon) + { + m_ui = romListUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + m_ui.SearchKey = null; + m_ui.RefreshUI(); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomListMenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/GamesUI/RomListMenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/GamesUI/RomListMenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs index 77eedfc..5a9c4b4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs @@ -1,138 +1,138 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Event; -using System.Collections.Generic; - -namespace AxibugEmuOnline.Client -{ - public class InGameUI : CommandExecuter - { - public static InGameUI Instance { get; private set; } - - public RomFile RomFile => m_rom; - public override bool Enable => gameObject.activeInHierarchy; - - /// ָʾϷʵǷģʽ - public bool IsNetPlay - { - get - { - if (!App.user.IsLoggedIn) return false; - if (App.roomMgr.mineRoomMiniInfo == null) return false; - if (App.roomMgr.RoomState <= AxibugProtobuf.RoomGameState.OnlyHost) return false; - - return true; - } - } - - private RomFile m_rom; - public IEmuCore Core { get; private set; } - private object m_state; - - private List menus = new List(); - private StepPerformer m_stepPerformer; - - protected override void Awake() - { - Instance = this; - gameObject.SetActiveEx(false); - - m_stepPerformer = new StepPerformer(this); - - menus.Add(new InGameUI_FilterSetting(this)); - menus.Add(new InGameUI_Reset(this)); - menus.Add(new InGameUI_SaveState(this)); - menus.Add(new InGameUI_LoadState(this)); - menus.Add(new InGameUI_QuitGame(this)); - - base.Awake(); - } - - protected override void OnDestroy() - { - Instance = null; - base.OnDestroy(); - } - - /// ٿ - public void SaveQuickState(object state) - { - m_state = state; - } - /// - /// ȡٿ - /// - /// - /// - public object GetQuickState() - { - return m_state; - } - - public void Show(RomFile currentRom, IEmuCore core) - { - m_state = null;//Ϸ - CommandDispatcher.Instance.RegistController(this); - - m_rom = currentRom; - Core = core; - m_stepPerformer.Reset(); - - if (App.user.IsLoggedIn && !App.roomMgr.InRoom) - { - App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash); - } - - Eventer.Instance.RegisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); - - gameObject.SetActiveEx(true); - - var filterSetting = App.filter.GetFilterSetting(currentRom); - if (filterSetting.filter != null) - { - var filter = filterSetting.filter; - var preset = filterSetting.preset ?? filter.DefaultPreset; - - filter.ApplyPreset(preset); - App.filter.EnableFilter(filter); - } - } - - private void OnServerStepUpdate(int step) - { - m_stepPerformer.Perform(step); - } - - public void Hide() - { - CommandDispatcher.Instance.UnRegistController(this); - gameObject.SetActiveEx(false); - - App.filter.ShutDownFilter(); - } - - protected override void OnCmdOptionMenu() - { - OverlayManager.Pop(menus, 0, PopMenu_OnHide); - - if (!IsNetPlay)//ģʽͣģ - { - Core.Pause(); - } - } - - //˵رʱ - private void PopMenu_OnHide() - { - if (!IsNetPlay)//ģʽָģͣ - Core.Resume(); - } - - - public void QuitGame() - { - Eventer.Instance.UnregisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); - App.roomMgr.SendLeavnRoom(); - App.emu.StopGame(); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Event; +using System.Collections.Generic; + +namespace AxibugEmuOnline.Client +{ + public class InGameUI : CommandExecuter + { + public static InGameUI Instance { get; private set; } + + public RomFile RomFile => m_rom; + public override bool Enable => gameObject.activeInHierarchy; + + /// ָʾϷʵǷģʽ + public bool IsNetPlay + { + get + { + if (!App.user.IsLoggedIn) return false; + if (App.roomMgr.mineRoomMiniInfo == null) return false; + if (App.roomMgr.RoomState <= AxibugProtobuf.RoomGameState.OnlyHost) return false; + + return true; + } + } + + private RomFile m_rom; + public IEmuCore Core { get; private set; } + private object m_state; + + private List menus = new List(); + private StepPerformer m_stepPerformer; + + protected override void Awake() + { + Instance = this; + gameObject.SetActiveEx(false); + + m_stepPerformer = new StepPerformer(this); + + menus.Add(new InGameUI_FilterSetting(this)); + menus.Add(new InGameUI_Reset(this)); + menus.Add(new InGameUI_SaveState(this)); + menus.Add(new InGameUI_LoadState(this)); + menus.Add(new InGameUI_QuitGame(this)); + + base.Awake(); + } + + protected override void OnDestroy() + { + Instance = null; + base.OnDestroy(); + } + + /// ٿ + public void SaveQuickState(object state) + { + m_state = state; + } + /// + /// ȡٿ + /// + /// + /// + public object GetQuickState() + { + return m_state; + } + + public void Show(RomFile currentRom, IEmuCore core) + { + m_state = null;//Ϸ + CommandDispatcher.Instance.RegistController(this); + + m_rom = currentRom; + Core = core; + m_stepPerformer.Reset(); + + if (App.user.IsLoggedIn && !App.roomMgr.InRoom) + { + App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash); + } + + Eventer.Instance.RegisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); + + gameObject.SetActiveEx(true); + + var filterSetting = App.filter.GetFilterSetting(currentRom); + if (filterSetting.filter != null) + { + var filter = filterSetting.filter; + var preset = filterSetting.preset ?? filter.DefaultPreset; + + filter.ApplyPreset(preset); + App.filter.EnableFilter(filter); + } + } + + private void OnServerStepUpdate(int step) + { + m_stepPerformer.Perform(step); + } + + public void Hide() + { + CommandDispatcher.Instance.UnRegistController(this); + gameObject.SetActiveEx(false); + + App.filter.ShutDownFilter(); + } + + protected override void OnCmdOptionMenu() + { + OverlayManager.Pop(menus, 0, PopMenu_OnHide); + + if (!IsNetPlay)//ģʽͣģ + { + Core.Pause(); + } + } + + //˵رʱ + private void PopMenu_OnHide() + { + if (!IsNetPlay)//ģʽָģͣ + Core.Resume(); + } + + + public void QuitGame() + { + Eventer.Instance.UnregisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); + App.roomMgr.SendLeavnRoom(); + App.emu.StopGame(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_FilterSetting.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_FilterSetting.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_FilterSetting.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_FilterSetting.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_LoadState.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_LoadState.cs index ca3500f..c6ddd58 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_LoadState.cs @@ -1,30 +1,30 @@ -using AxibugEmuOnline.Client.ClientCore; -using System.Diagnostics; - -namespace AxibugEmuOnline.Client -{ - public class InGameUI_LoadState : ExecuteMenu - { - private InGameUI m_gameUI; - public override bool Visible => !m_gameUI.IsNetPlay; - - public InGameUI_LoadState(InGameUI gameUI) : base("ȡ", null) - { - m_gameUI = gameUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - if (m_gameUI.IsNetPlay) return; - - object state = m_gameUI.GetQuickState(); - Stopwatch sw = Stopwatch.StartNew(); - if (state != null) - { - m_gameUI.Core.LoadState(state); - sw.Stop(); - App.log.Info($"{m_gameUI.RomFile.Platform}====>ռغʱ:{sw.Elapsed.TotalMilliseconds}ms"); - } - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System.Diagnostics; + +namespace AxibugEmuOnline.Client +{ + public class InGameUI_LoadState : ExecuteMenu + { + private InGameUI m_gameUI; + public override bool Visible => !m_gameUI.IsNetPlay; + + public InGameUI_LoadState(InGameUI gameUI) : base("ȡ", null) + { + m_gameUI = gameUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + if (m_gameUI.IsNetPlay) return; + + object state = m_gameUI.GetQuickState(); + Stopwatch sw = Stopwatch.StartNew(); + if (state != null) + { + m_gameUI.Core.LoadState(state); + sw.Stop(); + App.log.Info($"{m_gameUI.RomFile.Platform}====>ռغʱ:{sw.Elapsed.TotalMilliseconds}ms"); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_LoadState.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_LoadState.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_LoadState.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_QuitGame.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_QuitGame.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_QuitGame.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_QuitGame.cs index 64dc17c..03ed516 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_QuitGame.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_QuitGame.cs @@ -1,18 +1,18 @@ -namespace AxibugEmuOnline.Client -{ - public class InGameUI_QuitGame : ExecuteMenu - { - private InGameUI m_gameUI; - - - public InGameUI_QuitGame(InGameUI gameUI) : base("˳", null) - { - m_gameUI = gameUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - m_gameUI.QuitGame(); - } - } -} +namespace AxibugEmuOnline.Client +{ + public class InGameUI_QuitGame : ExecuteMenu + { + private InGameUI m_gameUI; + + + public InGameUI_QuitGame(InGameUI gameUI) : base("˳", null) + { + m_gameUI = gameUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + m_gameUI.QuitGame(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_QuitGame.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_QuitGame.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_QuitGame.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_QuitGame.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_Reset.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_Reset.cs index 8424dec..02cbbaf 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_Reset.cs @@ -1,25 +1,25 @@ -using AxibugEmuOnline.Client.ClientCore; - -namespace AxibugEmuOnline.Client -{ - public class InGameUI_Reset : ExecuteMenu - { - private InGameUI m_gameUI; - - public override bool Visible => !m_gameUI.IsNetPlay || App.roomMgr.IsHost; - - public InGameUI_Reset(InGameUI gameUI) : base("λ", null) - { - m_gameUI = gameUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - if (!m_gameUI.IsNetPlay) - { - App.emu.ResetGame(); - } - - } - } -} +using AxibugEmuOnline.Client.ClientCore; + +namespace AxibugEmuOnline.Client +{ + public class InGameUI_Reset : ExecuteMenu + { + private InGameUI m_gameUI; + + public override bool Visible => !m_gameUI.IsNetPlay || App.roomMgr.IsHost; + + public InGameUI_Reset(InGameUI gameUI) : base("λ", null) + { + m_gameUI = gameUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + if (!m_gameUI.IsNetPlay) + { + App.emu.ResetGame(); + } + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_Reset.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_Reset.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_Reset.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_SaveState.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_SaveState.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs index d435ca3..8c44d1e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_SaveState.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs @@ -1,29 +1,29 @@ -using AxibugEmuOnline.Client.ClientCore; -using System.Diagnostics; - -namespace AxibugEmuOnline.Client -{ - public class InGameUI_SaveState : ExecuteMenu - { - private InGameUI m_gameUI; - - public override bool Visible => !m_gameUI.IsNetPlay; - - public InGameUI_SaveState(InGameUI gameUI) : base("", null) - { - m_gameUI = gameUI; - } - - public override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - if (m_gameUI.IsNetPlay) return; - - Stopwatch sw = Stopwatch.StartNew(); - object state = m_gameUI.Core.GetState(); - - m_gameUI.SaveQuickState(state); - sw.Stop(); - App.log.Info($"{m_gameUI.RomFile.Platform}====>ȡպʱ:{sw.Elapsed.TotalMilliseconds}ms"); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using System.Diagnostics; + +namespace AxibugEmuOnline.Client +{ + public class InGameUI_SaveState : ExecuteMenu + { + private InGameUI m_gameUI; + + public override bool Visible => !m_gameUI.IsNetPlay; + + public InGameUI_SaveState(InGameUI gameUI) : base("", null) + { + m_gameUI = gameUI; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + if (m_gameUI.IsNetPlay) return; + + Stopwatch sw = Stopwatch.StartNew(); + object state = m_gameUI.Core.GetState(); + + m_gameUI.SaveQuickState(state); + sw.Stop(); + App.log.Info($"{m_gameUI.RomFile.Platform}====>ȡպʱ:{sw.Elapsed.TotalMilliseconds}ms"); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_SaveState.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI_SaveState.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/StepPerformer.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/StepPerformer.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/StepPerformer.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/StepPerformer.cs index 80f6bca..5a5372e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/StepPerformer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/StepPerformer.cs @@ -1,62 +1,62 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Common; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class StepPerformer - { - private InGameUI m_inGameUI; - private int m_step = -1; - - public StepPerformer(InGameUI inGameUI) - { - m_inGameUI = inGameUI; - } - - public void Perform(int step) - { - m_step = step; - - switch (m_step) - { - //等待主机上报快照 - case 0: - PauseCore(); - if (App.roomMgr.IsHost) - { - var stateRaw = m_inGameUI.Core.GetStateBytes(); - Debug.Log($"快照上报:{Helper.FileMD5Hash(stateRaw)}"); - App.roomMgr.SendHostRaw(stateRaw); - } - break; - //加载存档并发送Ready通知 - case 1: - PauseCore(); - Debug.Log($"快照加载:{Helper.FileMD5Hash(App.roomMgr.RawData)}"); - m_inGameUI.Core.LoadStateFromBytes(App.roomMgr.RawData); - App.roomMgr.SendRoomPlayerReady(); - break; - case 2: - m_step = -1; - ResumeCore(); - break; - } - } - - private void PauseCore() - { - m_inGameUI.Core.Pause(); - } - - private void ResumeCore() - { - m_inGameUI.Core.Resume(); - } - - internal void Reset() - { - m_step = -1; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Common; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class StepPerformer + { + private InGameUI m_inGameUI; + private int m_step = -1; + + public StepPerformer(InGameUI inGameUI) + { + m_inGameUI = inGameUI; + } + + public void Perform(int step) + { + m_step = step; + + switch (m_step) + { + //等待主机上报快照 + case 0: + PauseCore(); + if (App.roomMgr.IsHost) + { + var stateRaw = m_inGameUI.Core.GetStateBytes(); + Debug.Log($"快照上报:{Helper.FileMD5Hash(stateRaw)}"); + App.roomMgr.SendHostRaw(stateRaw); + } + break; + //加载存档并发送Ready通知 + case 1: + PauseCore(); + Debug.Log($"快照加载:{Helper.FileMD5Hash(App.roomMgr.RawData)}"); + m_inGameUI.Core.LoadStateFromBytes(App.roomMgr.RawData); + App.roomMgr.SendRoomPlayerReady(); + break; + case 2: + m_step = -1; + ResumeCore(); + break; + } + } + + private void PauseCore() + { + m_inGameUI.Core.Pause(); + } + + private void ResumeCore() + { + m_inGameUI.Core.Resume(); + } + + internal void Reset() + { + m_step = -1; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/StepPerformer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/StepPerformer.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/StepPerformer.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/StepPerformer.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/GameObjectPool.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/GameObjectPool.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/GameObjectPool.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/GameObjectPool.cs index fd44a4f..7d2a496 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/GameObjectPool.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/GameObjectPool.cs @@ -1,57 +1,57 @@ -using System.Collections.Generic; -using UnityEngine; - -public static class GameObjectPool -{ - private static GameObject PoolAttach; - private static Dictionary> s_poolMap = new Dictionary>(); - private static Dictionary s_instanceToSrc = new Dictionary(); - public static GameObject GetInstance(GameObject prefabSrc, Transform parent) - { - if (PoolAttach == null) - { - PoolAttach = new GameObject("[GameObjectPool]"); - PoolAttach.transform.localScale = Vector3.zero; - GameObject.DontDestroyOnLoad(PoolAttach); - } - - if (!s_poolMap.ContainsKey(prefabSrc)) s_poolMap[prefabSrc] = new Queue(); - - GameObject instance = null; - var pool = s_poolMap[prefabSrc]; - if (pool.Count > 0) - { - instance = pool.Dequeue(); - instance.transform.SetParent(parent, true); - instance.transform.localScale = prefabSrc.transform.localScale; - instance.transform.localRotation = prefabSrc.transform.localRotation; - instance.transform.localPosition = prefabSrc.transform.localPosition; - } - else - { - instance = GameObject.Instantiate(prefabSrc, parent); - s_instanceToSrc[instance] = prefabSrc; - } - - //instance.SetActive(true); - return instance; - } - - public static void Release(GameObject instance) - { - s_instanceToSrc.TryGetValue(instance, out var src); - if (src != null && s_poolMap.TryGetValue(src, out var pool)) - { - pool.Enqueue(instance); - //instance.SetActive(false); - if (instance == null) return; - if (PoolAttach == null) return; - - instance.transform.SetParent(PoolAttach.transform, true); - } - else - { - GameObject.Destroy(instance); - } - } -} +using System.Collections.Generic; +using UnityEngine; + +public static class GameObjectPool +{ + private static GameObject PoolAttach; + private static Dictionary> s_poolMap = new Dictionary>(); + private static Dictionary s_instanceToSrc = new Dictionary(); + public static GameObject GetInstance(GameObject prefabSrc, Transform parent) + { + if (PoolAttach == null) + { + PoolAttach = new GameObject("[GameObjectPool]"); + PoolAttach.transform.localScale = Vector3.zero; + GameObject.DontDestroyOnLoad(PoolAttach); + } + + if (!s_poolMap.ContainsKey(prefabSrc)) s_poolMap[prefabSrc] = new Queue(); + + GameObject instance = null; + var pool = s_poolMap[prefabSrc]; + if (pool.Count > 0) + { + instance = pool.Dequeue(); + instance.transform.SetParent(parent, true); + instance.transform.localScale = prefabSrc.transform.localScale; + instance.transform.localRotation = prefabSrc.transform.localRotation; + instance.transform.localPosition = prefabSrc.transform.localPosition; + } + else + { + instance = GameObject.Instantiate(prefabSrc, parent); + s_instanceToSrc[instance] = prefabSrc; + } + + //instance.SetActive(true); + return instance; + } + + public static void Release(GameObject instance) + { + s_instanceToSrc.TryGetValue(instance, out var src); + if (src != null && s_poolMap.TryGetValue(src, out var pool)) + { + pool.Enqueue(instance); + //instance.SetActive(false); + if (instance == null) return; + if (PoolAttach == null) return; + + instance.transform.SetParent(PoolAttach.transform, true); + } + else + { + GameObject.Destroy(instance); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/GameObjectPool.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/GameObjectPool.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/GameObjectPool.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/GameObjectPool.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresent.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresent.cs index b3de33a..af37d14 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresent.cs @@ -1,554 +1,554 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -public class ItemPresent : GridLayoutGroup, IVirtualLayout -{ - public RectTransform ItemTemplate; - public RectTransform ViewRect; - - private Dictionary _cacheItemScripts = new Dictionary(); - private List _dataList; - private object _dependencyProperty; - private Vector2 _layoutCellsize; - - public Action OnItemDelayShowPorcessComplete; - - -#if UNITY_EDITOR - public int EditorOnlyItemCount - { - get => ItemCount; - set => ItemCount = value; - } -#endif - - private int ItemCount - { - get => children.Count; - set - { - if (value == ItemCount) return; - - if (value <= 0) - { - foreach (var child in children) - { - child.Dispose(); - } - - children.Clear(); - } - else - { - var gap = value - children.Count; - - if (gap > 0) - { - for (int i = 0; i < gap; i++) - { - ItemProxy item = new ItemProxy(this); - children.Add(item); - item.Width = cellSize.x; - item.Height = cellSize.y; - item.Index = children.Count - 1; - } - } - else if (gap < 0) - { - for (int i = 0; i < -gap; i++) - { - int removeIndex = children.Count - 1; - children[removeIndex].Dispose(); - children.RemoveAt(removeIndex); - } - } - } - - SetDirty(); - } - } - private List children = new List(); - - private List handleChildren = new List(); - private bool m_dataDirty; - private ItemSelector m_itemSelector; - protected override void Awake() - { - m_itemSelector = gameObject.GetComponent(); - } - - public override void CalculateLayoutInputHorizontal() - { - handleChildren.Clear(); - for (int i = 0; i < children.Count; i++) - { - var child = children[i]; - if (child.IsDestroyed || !child.Visible) - continue; - - handleChildren.Add(child); - } - m_Tracker.Clear(); - updateFixHeightAndWidth(); - - int minColumns = 0; - int preferredColumns = 0; - if (m_Constraint == Constraint.FixedColumnCount) - { - minColumns = preferredColumns = m_ConstraintCount; - } - else if (m_Constraint == Constraint.FixedRowCount) - { - minColumns = preferredColumns = Mathf.CeilToInt(handleChildren.Count / (float)m_ConstraintCount - 0.001f); - } - else - { - minColumns = 1; - preferredColumns = Mathf.CeilToInt(Mathf.Sqrt(handleChildren.Count)); - } - - SetLayoutInputForAxis( - padding.horizontal + (_layoutCellsize.x + spacing.x) * minColumns - spacing.x, - padding.horizontal + (_layoutCellsize.x + spacing.x) * preferredColumns - spacing.x, - -1, 0); - } - - public void MoveToScrollViewCenter(ScrollRect scrollRect, int dataIndex) - { - if (m_dataDirty) - { - for (int i = 0; i < children.Count; i++) - { - var child = children[i]; - child.UpdateLayout(); - } - Canvas.ForceUpdateCanvases(); - } - - var targetProxy = children[dataIndex]; - var width = rectTransform.rect.width; - var height = rectTransform.rect.height; - - // Item is here - var itemCenterPositionInScroll = GetWorldPointInWidget(scrollRect.transform as RectTransform, GetWidgetWorldPoint(targetProxy)); - //Debug.Log("Item Anchor Pos In Scroll: " + itemCenterPositionInScroll); - // But must be here - var targetPositionInScroll = GetWorldPointInWidget(scrollRect.transform as RectTransform, GetWidgetWorldPoint(scrollRect.viewport)); - //Debug.Log("Target Anchor Pos In Scroll: " + targetPositionInScroll); - // So it has to move this distance - var difference = targetPositionInScroll - itemCenterPositionInScroll; - difference.z = 0f; - - var newNormalizedPosition = new Vector2(difference.x / (rectTransform.rect.width - scrollRect.viewport.rect.width), - difference.y / (rectTransform.rect.height - scrollRect.viewport.rect.height)); - - newNormalizedPosition = scrollRect.normalizedPosition - newNormalizedPosition; - - newNormalizedPosition.x = Mathf.Clamp01(newNormalizedPosition.x); - newNormalizedPosition.y = Mathf.Clamp01(newNormalizedPosition.y); - - scrollRect.normalizedPosition = newNormalizedPosition; - //DOTween.To(() => scrollRect.normalizedPosition, x => scrollRect.normalizedPosition = x, newNormalizedPosition, 0.2f); - } - - Vector3 GetWidgetWorldPoint(RectTransform target) - { - //pivot position + item size has to be included - var pivotOffset = new Vector3( - (0.5f - target.pivot.x) * target.rect.size.x, - (0.5f - target.pivot.y) * target.rect.size.y, - 0f); - var localPosition = target.localPosition + pivotOffset; - return target.parent.TransformPoint(localPosition); - } - - Vector3 GetWidgetWorldPoint(ItemProxy proxy) - { - Vector3[] temp = new Vector3[4]; - rectTransform.GetLocalCorners(temp); - var pos = (Vector2)temp[1] + proxy.AnchoredPosition; - pos = rectTransform.TransformPoint(pos); - - return pos; - } - - Vector3 GetWorldPointInWidget(RectTransform target, Vector3 worldPoint) - { - return target.InverseTransformPoint(worldPoint); - } - - public override void CalculateLayoutInputVertical() - { - int minRows = 0; - if (m_Constraint == Constraint.FixedColumnCount) - { - minRows = Mathf.CeilToInt(handleChildren.Count / (float)m_ConstraintCount - 0.001f); - } - else if (m_Constraint == Constraint.FixedRowCount) - { - minRows = m_ConstraintCount; - } - else - { - float width = rectTransform.rect.width; - int cellCountX = Mathf.Max(1, Mathf.FloorToInt((width - padding.horizontal + spacing.x + 0.001f) / (_layoutCellsize.x + spacing.x))); - minRows = Mathf.CeilToInt(handleChildren.Count / (float)cellCountX); - } - - float minSpace = padding.vertical + (_layoutCellsize.y + spacing.y) * minRows - spacing.y; - SetLayoutInputForAxis(minSpace, minSpace, -1, 1); - } - - public override void SetLayoutHorizontal() - { - SetProxyCellsAlongAxis(0); - } - - public override void SetLayoutVertical() - { - SetProxyCellsAlongAxis(1); - - foreach (var item in handleChildren) - { - item.UpdateLayout(); - } - } - - - - private void SetProxyCellsAlongAxis(int axis) - { - // Normally a Layout Controller should only set horizontal values when invoked for the horizontal axis - // and only vertical values when invoked for the vertical axis. - // However, in this case we set both the horizontal and vertical position when invoked for the vertical axis. - // Since we only set the horizontal position and not the size, it shouldn't affect children's layout, - // and thus shouldn't break the rule that all horizontal layout must be calculated before all vertical layout. - var proxyChildCount = handleChildren.Count; - if (axis == 0) - { - // Only set the sizes when invoked for horizontal axis, not the positions. - - for (int i = 0; i < proxyChildCount; i++) - { - ItemProxy proxy = handleChildren[i]; - - proxy.Width = _layoutCellsize.x; - proxy.Height = _layoutCellsize.y; - } - return; - } - - float width = rectTransform.rect.size.x; - float height = rectTransform.rect.size.y; - - int cellCountX = 1; - int cellCountY = 1; - if (m_Constraint == Constraint.FixedColumnCount) - { - cellCountX = m_ConstraintCount; - - if (proxyChildCount > cellCountX) - cellCountY = proxyChildCount / cellCountX + (proxyChildCount % cellCountX > 0 ? 1 : 0); - } - else if (m_Constraint == Constraint.FixedRowCount) - { - cellCountY = m_ConstraintCount; - - if (proxyChildCount > cellCountY) - cellCountX = proxyChildCount / cellCountY + (proxyChildCount % cellCountY > 0 ? 1 : 0); - } - else - { - if (_layoutCellsize.x + spacing.x <= 0) - cellCountX = int.MaxValue; - else - cellCountX = Mathf.Max(1, Mathf.FloorToInt((width - padding.horizontal + spacing.x + 0.001f) / (cellSize.x + spacing.x))); - - if (_layoutCellsize.y + spacing.y <= 0) - cellCountY = int.MaxValue; - else - cellCountY = Mathf.Max(1, Mathf.FloorToInt((height - padding.vertical + spacing.y + 0.001f) / (cellSize.y + spacing.y))); - } - - int cornerX = (int)startCorner % 2; - int cornerY = (int)startCorner / 2; - - int cellsPerMainAxis, actualCellCountX, actualCellCountY; - if (startAxis == Axis.Horizontal) - { - cellsPerMainAxis = cellCountX; - actualCellCountX = Mathf.Clamp(cellCountX, 1, proxyChildCount); - actualCellCountY = Mathf.Clamp(cellCountY, 1, Mathf.CeilToInt(proxyChildCount / (float)cellsPerMainAxis)); - } - else - { - cellsPerMainAxis = cellCountY; - actualCellCountY = Mathf.Clamp(cellCountY, 1, proxyChildCount); - actualCellCountX = Mathf.Clamp(cellCountX, 1, Mathf.CeilToInt(proxyChildCount / (float)cellsPerMainAxis)); - } - - Vector2 requiredSpace = new Vector2( - actualCellCountX * _layoutCellsize.x + (actualCellCountX - 1) * spacing.x, - actualCellCountY * _layoutCellsize.y + (actualCellCountY - 1) * spacing.y - ); - Vector2 startOffset = new Vector2( - GetStartOffset(0, requiredSpace.x), - GetStartOffset(1, requiredSpace.y) - ); - - for (int i = 0; i < proxyChildCount; i++) - { - int positionX; - int positionY; - if (startAxis == Axis.Horizontal) - { - positionX = i % cellsPerMainAxis; - positionY = i / cellsPerMainAxis; - } - else - { - positionX = i / cellsPerMainAxis; - positionY = i % cellsPerMainAxis; - } - - if (cornerX == 1) - positionX = actualCellCountX - 1 - positionX; - if (cornerY == 1) - positionY = actualCellCountY - 1 - positionY; - - SetProxyChildAlongAxis(handleChildren[i], 0, startOffset.x + (_layoutCellsize[0] + spacing[0]) * positionX, _layoutCellsize[0]); - SetProxyChildAlongAxis(handleChildren[i], 1, startOffset.y + (_layoutCellsize[1] + spacing[1]) * positionY, _layoutCellsize[1]); - } - } - - private void SetProxyChildAlongAxis(ItemProxy proxy, int axis, float pos, float size) - { - var scaleFactor = 1.0f; - - if (proxy == null) - return; - - Vector2 sizeDelta = new Vector2(proxy.Width, proxy.Height); - sizeDelta[axis] = size; - proxy.Width = sizeDelta.x; - proxy.Height = sizeDelta.y; - - Vector2 anchoredPosition = proxy.AnchoredPosition; - anchoredPosition[axis] = (axis == 0) ? (pos + size * proxy.Pivot[axis] * scaleFactor) : (-pos - size * (1f - proxy.Pivot[axis]) * scaleFactor); - proxy.AnchoredPosition = anchoredPosition; - } - - public void UpdateProxyVisualState() - { - if (m_dataDirty) - { - foreach (var proxy in children) - { - proxy.UpdateView(true); - } - Canvas.ForceUpdateCanvases(); - - m_dataDirty = false; - } - - if (ViewRect == null) - { - foreach (var proxy in children) - { - proxy.IsInViewRect = true; - } - return; - } - - Vector3[] corners = new Vector3[4]; - ViewRect.GetLocalCorners(corners); - Rect parentRect = ViewRect.rect; - parentRect.position = corners[0]; - - rectTransform.GetLocalCorners(corners); - Vector2 leftUpCorner = corners[1]; - - foreach (var proxy in children) - { - var localPos = leftUpCorner + proxy.AnchoredPosition; - localPos.x -= proxy.Width * 0.5f; - localPos.y -= proxy.Height * 0.5f; - localPos = transform.localToWorldMatrix.MultiplyPoint(localPos); - localPos = ViewRect.worldToLocalMatrix.MultiplyPoint(localPos); - - Rect proxyRect = new Rect(localPos, new Vector2(proxy.Width, proxy.Height)); - - if (parentRect.Overlaps(proxyRect)) proxy.IsInViewRect = true; - else proxy.IsInViewRect = false; - } - } - - public bool PauseUpdateView; - private void LateUpdate() - { - if (!PauseUpdateView) - { - updateFixHeightAndWidth(); - - UpdateProxyVisualState(); - HandleProxyShow(); - } - } - - private void updateFixHeightAndWidth() - { - _layoutCellsize = cellSize; - } - - private List NeedDelayShowItems = new List(); - private bool hasNeedShowInLastFrame = false; - private float stepDuration = 0f; - private void HandleProxyShow(bool allLoad = true, float delayStep = 0.02f) - { - if (allLoad) - { - foreach (var proxy in children) - { - if (proxy.NeedHide) - proxy.UpdateView(); - else if (proxy.NeedShow) - proxy.UpdateView(); - } - } - else - { - NeedDelayShowItems.Clear(); - foreach (var proxy in children) - { - if (proxy.NeedHide) - proxy.UpdateView(); - else if (proxy.NeedShow && !proxy.firstShow) - proxy.UpdateView(); - else if (proxy.NeedShow && proxy.firstShow) - { - NeedDelayShowItems.Add(proxy); - } - } - - if (NeedDelayShowItems.Count == 0 && hasNeedShowInLastFrame) - { - // Debug.Log("Show Complete!", gameObject); - OnItemDelayShowPorcessComplete?.Invoke(); - } - hasNeedShowInLastFrame = NeedDelayShowItems.Count > 0; - - stepDuration += Time.deltaTime; - while (stepDuration >= delayStep) - { - foreach (var proxy in NeedDelayShowItems) - { - if (proxy.NeedShow) - { - proxy.UpdateView(); - break; - } - } - stepDuration -= delayStep; - } - } - } - - protected override void OnDestroy() - { - Clear(); - } - - public void Clear() - { - foreach (var proxy in children) - proxy.Dispose(); - - children.Clear(); - } - - - public void SetData(object dataList) - { - Clear(); - - if (dataList == null) - { - ItemCount = 0; - if (_dataList != null) - _dataList.Clear(); - } - else if (dataList is IEnumerable ienumrable) - { - List temp = new List(); - foreach (var item in ienumrable) - { - temp.Add(item); - } - ItemCount = temp.Count; - _dataList = temp; - } - else - { - Debug.LogException(new Exception("ItemPresent SetData ݵIJͲ֧"), gameObject); - return; - } - - m_dataDirty = true; - } - - public void UpdateDependencyProperty(object dp) - { - _dependencyProperty = dp; - foreach (var proxy in children) - { - proxy.UpdateDP(); - } - - //m_dataDirty = true; - } - - public Dictionary CacheItemScripts => _cacheItemScripts; - - public object DependencyProperty => _dependencyProperty; - - public RectTransform RectTransform => rectTransform; - public Vector2 GetItemAnchorePos(int index) - { - var proxy = children[index]; - return proxy.AnchoredPosition; - } - public RectTransform GetItemUIIfExist(int index) - { - if (index < 0) return null; - if (children.Count <= index) return null; - - var proxy = children[index]; - return proxy.RuntimeItemUI; - } - public List DataList - { - get => _dataList; - set => SetData(value); - } - - private ScrollRect _scrollRect; - public RectTransform GetItemUIByDataIndex(int dataIndex) - { - if (_scrollRect == null) - { - _scrollRect = GetComponentInParent(); - } - //if (_scrollRect != null) MoveToScrollViewCenter(_scrollRect, dataIndex); - - return this.GetItemUIIfExist(dataIndex); - } - - public RectTransform GetTemplate(object data) - { - if (m_itemSelector == null) return ItemTemplate; - else return m_itemSelector.GetItemTemplate(data); - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +public class ItemPresent : GridLayoutGroup, IVirtualLayout +{ + public RectTransform ItemTemplate; + public RectTransform ViewRect; + + private Dictionary _cacheItemScripts = new Dictionary(); + private List _dataList; + private object _dependencyProperty; + private Vector2 _layoutCellsize; + + public Action OnItemDelayShowPorcessComplete; + + +#if UNITY_EDITOR + public int EditorOnlyItemCount + { + get => ItemCount; + set => ItemCount = value; + } +#endif + + private int ItemCount + { + get => children.Count; + set + { + if (value == ItemCount) return; + + if (value <= 0) + { + foreach (var child in children) + { + child.Dispose(); + } + + children.Clear(); + } + else + { + var gap = value - children.Count; + + if (gap > 0) + { + for (int i = 0; i < gap; i++) + { + ItemProxy item = new ItemProxy(this); + children.Add(item); + item.Width = cellSize.x; + item.Height = cellSize.y; + item.Index = children.Count - 1; + } + } + else if (gap < 0) + { + for (int i = 0; i < -gap; i++) + { + int removeIndex = children.Count - 1; + children[removeIndex].Dispose(); + children.RemoveAt(removeIndex); + } + } + } + + SetDirty(); + } + } + private List children = new List(); + + private List handleChildren = new List(); + private bool m_dataDirty; + private ItemSelector m_itemSelector; + protected override void Awake() + { + m_itemSelector = gameObject.GetComponent(); + } + + public override void CalculateLayoutInputHorizontal() + { + handleChildren.Clear(); + for (int i = 0; i < children.Count; i++) + { + var child = children[i]; + if (child.IsDestroyed || !child.Visible) + continue; + + handleChildren.Add(child); + } + m_Tracker.Clear(); + updateFixHeightAndWidth(); + + int minColumns = 0; + int preferredColumns = 0; + if (m_Constraint == Constraint.FixedColumnCount) + { + minColumns = preferredColumns = m_ConstraintCount; + } + else if (m_Constraint == Constraint.FixedRowCount) + { + minColumns = preferredColumns = Mathf.CeilToInt(handleChildren.Count / (float)m_ConstraintCount - 0.001f); + } + else + { + minColumns = 1; + preferredColumns = Mathf.CeilToInt(Mathf.Sqrt(handleChildren.Count)); + } + + SetLayoutInputForAxis( + padding.horizontal + (_layoutCellsize.x + spacing.x) * minColumns - spacing.x, + padding.horizontal + (_layoutCellsize.x + spacing.x) * preferredColumns - spacing.x, + -1, 0); + } + + public void MoveToScrollViewCenter(ScrollRect scrollRect, int dataIndex) + { + if (m_dataDirty) + { + for (int i = 0; i < children.Count; i++) + { + var child = children[i]; + child.UpdateLayout(); + } + Canvas.ForceUpdateCanvases(); + } + + var targetProxy = children[dataIndex]; + var width = rectTransform.rect.width; + var height = rectTransform.rect.height; + + // Item is here + var itemCenterPositionInScroll = GetWorldPointInWidget(scrollRect.transform as RectTransform, GetWidgetWorldPoint(targetProxy)); + //Debug.Log("Item Anchor Pos In Scroll: " + itemCenterPositionInScroll); + // But must be here + var targetPositionInScroll = GetWorldPointInWidget(scrollRect.transform as RectTransform, GetWidgetWorldPoint(scrollRect.viewport)); + //Debug.Log("Target Anchor Pos In Scroll: " + targetPositionInScroll); + // So it has to move this distance + var difference = targetPositionInScroll - itemCenterPositionInScroll; + difference.z = 0f; + + var newNormalizedPosition = new Vector2(difference.x / (rectTransform.rect.width - scrollRect.viewport.rect.width), + difference.y / (rectTransform.rect.height - scrollRect.viewport.rect.height)); + + newNormalizedPosition = scrollRect.normalizedPosition - newNormalizedPosition; + + newNormalizedPosition.x = Mathf.Clamp01(newNormalizedPosition.x); + newNormalizedPosition.y = Mathf.Clamp01(newNormalizedPosition.y); + + scrollRect.normalizedPosition = newNormalizedPosition; + //DOTween.To(() => scrollRect.normalizedPosition, x => scrollRect.normalizedPosition = x, newNormalizedPosition, 0.2f); + } + + Vector3 GetWidgetWorldPoint(RectTransform target) + { + //pivot position + item size has to be included + var pivotOffset = new Vector3( + (0.5f - target.pivot.x) * target.rect.size.x, + (0.5f - target.pivot.y) * target.rect.size.y, + 0f); + var localPosition = target.localPosition + pivotOffset; + return target.parent.TransformPoint(localPosition); + } + + Vector3 GetWidgetWorldPoint(ItemProxy proxy) + { + Vector3[] temp = new Vector3[4]; + rectTransform.GetLocalCorners(temp); + var pos = (Vector2)temp[1] + proxy.AnchoredPosition; + pos = rectTransform.TransformPoint(pos); + + return pos; + } + + Vector3 GetWorldPointInWidget(RectTransform target, Vector3 worldPoint) + { + return target.InverseTransformPoint(worldPoint); + } + + public override void CalculateLayoutInputVertical() + { + int minRows = 0; + if (m_Constraint == Constraint.FixedColumnCount) + { + minRows = Mathf.CeilToInt(handleChildren.Count / (float)m_ConstraintCount - 0.001f); + } + else if (m_Constraint == Constraint.FixedRowCount) + { + minRows = m_ConstraintCount; + } + else + { + float width = rectTransform.rect.width; + int cellCountX = Mathf.Max(1, Mathf.FloorToInt((width - padding.horizontal + spacing.x + 0.001f) / (_layoutCellsize.x + spacing.x))); + minRows = Mathf.CeilToInt(handleChildren.Count / (float)cellCountX); + } + + float minSpace = padding.vertical + (_layoutCellsize.y + spacing.y) * minRows - spacing.y; + SetLayoutInputForAxis(minSpace, minSpace, -1, 1); + } + + public override void SetLayoutHorizontal() + { + SetProxyCellsAlongAxis(0); + } + + public override void SetLayoutVertical() + { + SetProxyCellsAlongAxis(1); + + foreach (var item in handleChildren) + { + item.UpdateLayout(); + } + } + + + + private void SetProxyCellsAlongAxis(int axis) + { + // Normally a Layout Controller should only set horizontal values when invoked for the horizontal axis + // and only vertical values when invoked for the vertical axis. + // However, in this case we set both the horizontal and vertical position when invoked for the vertical axis. + // Since we only set the horizontal position and not the size, it shouldn't affect children's layout, + // and thus shouldn't break the rule that all horizontal layout must be calculated before all vertical layout. + var proxyChildCount = handleChildren.Count; + if (axis == 0) + { + // Only set the sizes when invoked for horizontal axis, not the positions. + + for (int i = 0; i < proxyChildCount; i++) + { + ItemProxy proxy = handleChildren[i]; + + proxy.Width = _layoutCellsize.x; + proxy.Height = _layoutCellsize.y; + } + return; + } + + float width = rectTransform.rect.size.x; + float height = rectTransform.rect.size.y; + + int cellCountX = 1; + int cellCountY = 1; + if (m_Constraint == Constraint.FixedColumnCount) + { + cellCountX = m_ConstraintCount; + + if (proxyChildCount > cellCountX) + cellCountY = proxyChildCount / cellCountX + (proxyChildCount % cellCountX > 0 ? 1 : 0); + } + else if (m_Constraint == Constraint.FixedRowCount) + { + cellCountY = m_ConstraintCount; + + if (proxyChildCount > cellCountY) + cellCountX = proxyChildCount / cellCountY + (proxyChildCount % cellCountY > 0 ? 1 : 0); + } + else + { + if (_layoutCellsize.x + spacing.x <= 0) + cellCountX = int.MaxValue; + else + cellCountX = Mathf.Max(1, Mathf.FloorToInt((width - padding.horizontal + spacing.x + 0.001f) / (cellSize.x + spacing.x))); + + if (_layoutCellsize.y + spacing.y <= 0) + cellCountY = int.MaxValue; + else + cellCountY = Mathf.Max(1, Mathf.FloorToInt((height - padding.vertical + spacing.y + 0.001f) / (cellSize.y + spacing.y))); + } + + int cornerX = (int)startCorner % 2; + int cornerY = (int)startCorner / 2; + + int cellsPerMainAxis, actualCellCountX, actualCellCountY; + if (startAxis == Axis.Horizontal) + { + cellsPerMainAxis = cellCountX; + actualCellCountX = Mathf.Clamp(cellCountX, 1, proxyChildCount); + actualCellCountY = Mathf.Clamp(cellCountY, 1, Mathf.CeilToInt(proxyChildCount / (float)cellsPerMainAxis)); + } + else + { + cellsPerMainAxis = cellCountY; + actualCellCountY = Mathf.Clamp(cellCountY, 1, proxyChildCount); + actualCellCountX = Mathf.Clamp(cellCountX, 1, Mathf.CeilToInt(proxyChildCount / (float)cellsPerMainAxis)); + } + + Vector2 requiredSpace = new Vector2( + actualCellCountX * _layoutCellsize.x + (actualCellCountX - 1) * spacing.x, + actualCellCountY * _layoutCellsize.y + (actualCellCountY - 1) * spacing.y + ); + Vector2 startOffset = new Vector2( + GetStartOffset(0, requiredSpace.x), + GetStartOffset(1, requiredSpace.y) + ); + + for (int i = 0; i < proxyChildCount; i++) + { + int positionX; + int positionY; + if (startAxis == Axis.Horizontal) + { + positionX = i % cellsPerMainAxis; + positionY = i / cellsPerMainAxis; + } + else + { + positionX = i / cellsPerMainAxis; + positionY = i % cellsPerMainAxis; + } + + if (cornerX == 1) + positionX = actualCellCountX - 1 - positionX; + if (cornerY == 1) + positionY = actualCellCountY - 1 - positionY; + + SetProxyChildAlongAxis(handleChildren[i], 0, startOffset.x + (_layoutCellsize[0] + spacing[0]) * positionX, _layoutCellsize[0]); + SetProxyChildAlongAxis(handleChildren[i], 1, startOffset.y + (_layoutCellsize[1] + spacing[1]) * positionY, _layoutCellsize[1]); + } + } + + private void SetProxyChildAlongAxis(ItemProxy proxy, int axis, float pos, float size) + { + var scaleFactor = 1.0f; + + if (proxy == null) + return; + + Vector2 sizeDelta = new Vector2(proxy.Width, proxy.Height); + sizeDelta[axis] = size; + proxy.Width = sizeDelta.x; + proxy.Height = sizeDelta.y; + + Vector2 anchoredPosition = proxy.AnchoredPosition; + anchoredPosition[axis] = (axis == 0) ? (pos + size * proxy.Pivot[axis] * scaleFactor) : (-pos - size * (1f - proxy.Pivot[axis]) * scaleFactor); + proxy.AnchoredPosition = anchoredPosition; + } + + public void UpdateProxyVisualState() + { + if (m_dataDirty) + { + foreach (var proxy in children) + { + proxy.UpdateView(true); + } + Canvas.ForceUpdateCanvases(); + + m_dataDirty = false; + } + + if (ViewRect == null) + { + foreach (var proxy in children) + { + proxy.IsInViewRect = true; + } + return; + } + + Vector3[] corners = new Vector3[4]; + ViewRect.GetLocalCorners(corners); + Rect parentRect = ViewRect.rect; + parentRect.position = corners[0]; + + rectTransform.GetLocalCorners(corners); + Vector2 leftUpCorner = corners[1]; + + foreach (var proxy in children) + { + var localPos = leftUpCorner + proxy.AnchoredPosition; + localPos.x -= proxy.Width * 0.5f; + localPos.y -= proxy.Height * 0.5f; + localPos = transform.localToWorldMatrix.MultiplyPoint(localPos); + localPos = ViewRect.worldToLocalMatrix.MultiplyPoint(localPos); + + Rect proxyRect = new Rect(localPos, new Vector2(proxy.Width, proxy.Height)); + + if (parentRect.Overlaps(proxyRect)) proxy.IsInViewRect = true; + else proxy.IsInViewRect = false; + } + } + + public bool PauseUpdateView; + private void LateUpdate() + { + if (!PauseUpdateView) + { + updateFixHeightAndWidth(); + + UpdateProxyVisualState(); + HandleProxyShow(); + } + } + + private void updateFixHeightAndWidth() + { + _layoutCellsize = cellSize; + } + + private List NeedDelayShowItems = new List(); + private bool hasNeedShowInLastFrame = false; + private float stepDuration = 0f; + private void HandleProxyShow(bool allLoad = true, float delayStep = 0.02f) + { + if (allLoad) + { + foreach (var proxy in children) + { + if (proxy.NeedHide) + proxy.UpdateView(); + else if (proxy.NeedShow) + proxy.UpdateView(); + } + } + else + { + NeedDelayShowItems.Clear(); + foreach (var proxy in children) + { + if (proxy.NeedHide) + proxy.UpdateView(); + else if (proxy.NeedShow && !proxy.firstShow) + proxy.UpdateView(); + else if (proxy.NeedShow && proxy.firstShow) + { + NeedDelayShowItems.Add(proxy); + } + } + + if (NeedDelayShowItems.Count == 0 && hasNeedShowInLastFrame) + { + // Debug.Log("Show Complete!", gameObject); + OnItemDelayShowPorcessComplete?.Invoke(); + } + hasNeedShowInLastFrame = NeedDelayShowItems.Count > 0; + + stepDuration += Time.deltaTime; + while (stepDuration >= delayStep) + { + foreach (var proxy in NeedDelayShowItems) + { + if (proxy.NeedShow) + { + proxy.UpdateView(); + break; + } + } + stepDuration -= delayStep; + } + } + } + + protected override void OnDestroy() + { + Clear(); + } + + public void Clear() + { + foreach (var proxy in children) + proxy.Dispose(); + + children.Clear(); + } + + + public void SetData(object dataList) + { + Clear(); + + if (dataList == null) + { + ItemCount = 0; + if (_dataList != null) + _dataList.Clear(); + } + else if (dataList is IEnumerable ienumrable) + { + List temp = new List(); + foreach (var item in ienumrable) + { + temp.Add(item); + } + ItemCount = temp.Count; + _dataList = temp; + } + else + { + Debug.LogException(new Exception("ItemPresent SetData ݵIJͲ֧"), gameObject); + return; + } + + m_dataDirty = true; + } + + public void UpdateDependencyProperty(object dp) + { + _dependencyProperty = dp; + foreach (var proxy in children) + { + proxy.UpdateDP(); + } + + //m_dataDirty = true; + } + + public Dictionary CacheItemScripts => _cacheItemScripts; + + public object DependencyProperty => _dependencyProperty; + + public RectTransform RectTransform => rectTransform; + public Vector2 GetItemAnchorePos(int index) + { + var proxy = children[index]; + return proxy.AnchoredPosition; + } + public RectTransform GetItemUIIfExist(int index) + { + if (index < 0) return null; + if (children.Count <= index) return null; + + var proxy = children[index]; + return proxy.RuntimeItemUI; + } + public List DataList + { + get => _dataList; + set => SetData(value); + } + + private ScrollRect _scrollRect; + public RectTransform GetItemUIByDataIndex(int dataIndex) + { + if (_scrollRect == null) + { + _scrollRect = GetComponentInParent(); + } + //if (_scrollRect != null) MoveToScrollViewCenter(_scrollRect, dataIndex); + + return this.GetItemUIIfExist(dataIndex); + } + + public RectTransform GetTemplate(object data) + { + if (m_itemSelector == null) return ItemTemplate; + else return m_itemSelector.GetItemTemplate(data); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresent.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresent.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresent.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.asmdef.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs index 2d4e289..0ce4cfb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs @@ -1,30 +1,30 @@ -using UnityEditor; -using UnityEditor.UI; -using UnityEngine; - -[CustomEditor(typeof(ItemPresent))] -public class ItemPresentEditor : GridLayoutGroupEditor -{ - public override void OnInspectorGUI() - { - ItemPresent behaviour = target as ItemPresent; - var itemTemplate = serializedObject.FindProperty("ItemTemplate"); - var viewRect = serializedObject.FindProperty("ViewRect"); - GUILayout.BeginHorizontal(); - EditorGUILayout.PropertyField(itemTemplate, new GUIContent("元素"), true); - if (GUILayout.Button("同步大小", GUILayout.Width(80))) - { - behaviour.cellSize = behaviour.ItemTemplate.rect.size; - GUIUtility.keyboardControl = 0; - } - GUILayout.EndHorizontal(); - - EditorGUILayout.PropertyField(viewRect, true); - - EditorGUILayout.Space(); - - serializedObject.ApplyModifiedProperties(); - - base.OnInspectorGUI(); - } -} +using UnityEditor; +using UnityEditor.UI; +using UnityEngine; + +[CustomEditor(typeof(ItemPresent))] +public class ItemPresentEditor : GridLayoutGroupEditor +{ + public override void OnInspectorGUI() + { + ItemPresent behaviour = target as ItemPresent; + var itemTemplate = serializedObject.FindProperty("ItemTemplate"); + var viewRect = serializedObject.FindProperty("ViewRect"); + GUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(itemTemplate, new GUIContent("元素"), true); + if (GUILayout.Button("同步大小", GUILayout.Width(80))) + { + behaviour.cellSize = behaviour.ItemTemplate.rect.size; + GUIUtility.keyboardControl = 0; + } + GUILayout.EndHorizontal(); + + EditorGUILayout.PropertyField(viewRect, true); + + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + + base.OnInspectorGUI(); + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemPresentEditor/ItemPresentEditor.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemProxy.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemProxy.cs index 58f857e..b91d692 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemProxy.cs @@ -1,245 +1,245 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - - - -public interface IVirtualLayout -{ - Dictionary CacheItemScripts { get; } - public List DataList { get; } - public object DependencyProperty { get; } - public RectTransform RectTransform { get; } - public RectTransform GetTemplate(object data); - public Vector2 GetItemAnchorePos(int index); - public RectTransform GetItemUIIfExist(int index); - - public void UpdateProxyVisualState(); - public void UpdateDependencyProperty(object dp); - public void SetData(object dataList); - public void MoveToScrollViewCenter(ScrollRect scrollRect, int dataIndex); -} - -public class ItemProxy -{ - public bool IsDestroyed; - public bool Visible = true; - public int Index; - public bool IsInViewRect; - - public Vector2 Pivot => _template.pivot; - public Vector2 AnchoredPosition; - - public float Width; - public float Height; - - private IVirtualLayout _parent; - - private RectTransform _template => _parent.GetTemplate(_parent.DataList[Index]); - private RectTransform _runtimeInstance; - private LayoutGroup _layoutElement; - - public RectTransform RuntimeItemUI => _runtimeInstance; - public bool firstShow { get; private set; } = true; - - public float PreferredWidth - { - get - { - if (_layoutElement == null) return 0; - - return _layoutElement.preferredWidth; - } - } - public float PreferredHeight - { - get - { - if (_layoutElement == null) return 0; - - return _layoutElement.preferredHeight; - } - } - - public ScripteInterface GetLuaObj() - { - if (_runtimeInstance == null) return null; - - _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface lfi); - - return lfi; - } - - public ItemProxy(IVirtualLayout parent) - { - _parent = parent; - } - - public void Dispose() - { - if (_runtimeInstance != null) - { - if (Application.isPlaying) - { - GameObjectPool.Release(_runtimeInstance.gameObject); - } - else - GameObject.DestroyImmediate(_runtimeInstance.gameObject); - } - } - - public bool NeedShow - { - get - { - if (IsInViewRect && _runtimeInstance == null) return true; - else - { - if (_runtimeInstance != null && IsInViewRect && _runtimeInstance.anchoredPosition != AnchoredPosition) - return true; - else - return false; - } - } - - } - public bool NeedHide => !IsInViewRect && _runtimeInstance != null; - - public void UpdateView(bool force = false) - { - if (IsInViewRect) - { - if (_runtimeInstance == null) - { - _runtimeInstance = GetInstance(); - _layoutElement = _runtimeInstance.GetComponent(); - UpdateViewData(); - } - else if (force) - { - UpdateViewData(); - } - - UpdateLayout(); - } - else - { - ReleaseInstance(); - } - } - - public void UpdateLayout() - { - if (_runtimeInstance != null) - { - _runtimeInstance.gameObject.SetActive(true); - _runtimeInstance.anchorMax = Vector2.up; - _runtimeInstance.anchorMin = Vector2.up; - _runtimeInstance.anchoredPosition = AnchoredPosition; - _runtimeInstance.sizeDelta = new Vector2(Width, Height); - } - if (_layoutElement != null) - { - _layoutElement.CalculateLayoutInputHorizontal(); - _layoutElement.CalculateLayoutInputVertical(); - _layoutElement.SetLayoutHorizontal(); - _layoutElement.SetLayoutVertical(); - } - - } - - private void UpdateViewData() - { - if (Application.isPlaying) - { - if (!_parent.CacheItemScripts.ContainsKey(_runtimeInstance.gameObject)) - { - var vItem = _runtimeInstance.gameObject.GetComponent(); - ScripteInterface newSI = new ScripteInterface(vItem); - _parent.CacheItemScripts[_runtimeInstance.gameObject] = newSI; - } - - _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface si); - si.SetDataList(_parent.DataList[Index], Index); - if (_parent.DependencyProperty != null) - si.SetDependencyProperty(_parent.DependencyProperty); - } - } - - public void UpdateDP() - { - if (_runtimeInstance == null) return; - - _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface luaInterface); - if (luaInterface == null) return; - - if (_parent.DependencyProperty != null) - luaInterface.SetDependencyProperty(_parent.DependencyProperty); - } - - private RectTransform GetInstance() - { - var res = GameObjectPool.GetInstance(_template.gameObject, _parent.RectTransform).GetComponent(); - return res; - } - - private void ReleaseInstance() - { - if (_runtimeInstance == null) return; - - _layoutElement = null; - - if (Application.isPlaying) - { - _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface si); - if (si != null) si.Release(); - GameObjectPool.Release(_runtimeInstance.gameObject); - _runtimeInstance = null; - } - else - { - GameObject.DestroyImmediate(_runtimeInstance.gameObject); - _runtimeInstance = null; - } - } -} - -public class ScripteInterface -{ - private IVirtualItem _itemInstance; - public IVirtualItem ItemInstance => _itemInstance; - - public ScripteInterface(IVirtualItem lc) - { - _itemInstance = lc; - } - - public void SetDataList(object dataItem, int index) - { - if (_itemInstance == null) return; - _itemInstance.Index = index; - _itemInstance.SetData(dataItem); - } - public void Release() - { - if (_itemInstance == null) return; - _itemInstance.Release(); - } - - public void SetDependencyProperty(object dependencyProperty) - { - if (_itemInstance == null) return; - - _itemInstance.SetDependencyProperty(dependencyProperty); - } - -} - -public interface IVirtualItem -{ - GameObject gameObject { get; } - int Index { get; set; } - void SetData(object data); - void SetDependencyProperty(object data); - void Release(); -} +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + + + +public interface IVirtualLayout +{ + Dictionary CacheItemScripts { get; } + public List DataList { get; } + public object DependencyProperty { get; } + public RectTransform RectTransform { get; } + public RectTransform GetTemplate(object data); + public Vector2 GetItemAnchorePos(int index); + public RectTransform GetItemUIIfExist(int index); + + public void UpdateProxyVisualState(); + public void UpdateDependencyProperty(object dp); + public void SetData(object dataList); + public void MoveToScrollViewCenter(ScrollRect scrollRect, int dataIndex); +} + +public class ItemProxy +{ + public bool IsDestroyed; + public bool Visible = true; + public int Index; + public bool IsInViewRect; + + public Vector2 Pivot => _template.pivot; + public Vector2 AnchoredPosition; + + public float Width; + public float Height; + + private IVirtualLayout _parent; + + private RectTransform _template => _parent.GetTemplate(_parent.DataList[Index]); + private RectTransform _runtimeInstance; + private LayoutGroup _layoutElement; + + public RectTransform RuntimeItemUI => _runtimeInstance; + public bool firstShow { get; private set; } = true; + + public float PreferredWidth + { + get + { + if (_layoutElement == null) return 0; + + return _layoutElement.preferredWidth; + } + } + public float PreferredHeight + { + get + { + if (_layoutElement == null) return 0; + + return _layoutElement.preferredHeight; + } + } + + public ScripteInterface GetLuaObj() + { + if (_runtimeInstance == null) return null; + + _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface lfi); + + return lfi; + } + + public ItemProxy(IVirtualLayout parent) + { + _parent = parent; + } + + public void Dispose() + { + if (_runtimeInstance != null) + { + if (Application.isPlaying) + { + GameObjectPool.Release(_runtimeInstance.gameObject); + } + else + GameObject.DestroyImmediate(_runtimeInstance.gameObject); + } + } + + public bool NeedShow + { + get + { + if (IsInViewRect && _runtimeInstance == null) return true; + else + { + if (_runtimeInstance != null && IsInViewRect && _runtimeInstance.anchoredPosition != AnchoredPosition) + return true; + else + return false; + } + } + + } + public bool NeedHide => !IsInViewRect && _runtimeInstance != null; + + public void UpdateView(bool force = false) + { + if (IsInViewRect) + { + if (_runtimeInstance == null) + { + _runtimeInstance = GetInstance(); + _layoutElement = _runtimeInstance.GetComponent(); + UpdateViewData(); + } + else if (force) + { + UpdateViewData(); + } + + UpdateLayout(); + } + else + { + ReleaseInstance(); + } + } + + public void UpdateLayout() + { + if (_runtimeInstance != null) + { + _runtimeInstance.gameObject.SetActive(true); + _runtimeInstance.anchorMax = Vector2.up; + _runtimeInstance.anchorMin = Vector2.up; + _runtimeInstance.anchoredPosition = AnchoredPosition; + _runtimeInstance.sizeDelta = new Vector2(Width, Height); + } + if (_layoutElement != null) + { + _layoutElement.CalculateLayoutInputHorizontal(); + _layoutElement.CalculateLayoutInputVertical(); + _layoutElement.SetLayoutHorizontal(); + _layoutElement.SetLayoutVertical(); + } + + } + + private void UpdateViewData() + { + if (Application.isPlaying) + { + if (!_parent.CacheItemScripts.ContainsKey(_runtimeInstance.gameObject)) + { + var vItem = _runtimeInstance.gameObject.GetComponent(); + ScripteInterface newSI = new ScripteInterface(vItem); + _parent.CacheItemScripts[_runtimeInstance.gameObject] = newSI; + } + + _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface si); + si.SetDataList(_parent.DataList[Index], Index); + if (_parent.DependencyProperty != null) + si.SetDependencyProperty(_parent.DependencyProperty); + } + } + + public void UpdateDP() + { + if (_runtimeInstance == null) return; + + _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface luaInterface); + if (luaInterface == null) return; + + if (_parent.DependencyProperty != null) + luaInterface.SetDependencyProperty(_parent.DependencyProperty); + } + + private RectTransform GetInstance() + { + var res = GameObjectPool.GetInstance(_template.gameObject, _parent.RectTransform).GetComponent(); + return res; + } + + private void ReleaseInstance() + { + if (_runtimeInstance == null) return; + + _layoutElement = null; + + if (Application.isPlaying) + { + _parent.CacheItemScripts.TryGetValue(_runtimeInstance.gameObject, out ScripteInterface si); + if (si != null) si.Release(); + GameObjectPool.Release(_runtimeInstance.gameObject); + _runtimeInstance = null; + } + else + { + GameObject.DestroyImmediate(_runtimeInstance.gameObject); + _runtimeInstance = null; + } + } +} + +public class ScripteInterface +{ + private IVirtualItem _itemInstance; + public IVirtualItem ItemInstance => _itemInstance; + + public ScripteInterface(IVirtualItem lc) + { + _itemInstance = lc; + } + + public void SetDataList(object dataItem, int index) + { + if (_itemInstance == null) return; + _itemInstance.Index = index; + _itemInstance.SetData(dataItem); + } + public void Release() + { + if (_itemInstance == null) return; + _itemInstance.Release(); + } + + public void SetDependencyProperty(object dependencyProperty) + { + if (_itemInstance == null) return; + + _itemInstance.SetDependencyProperty(dependencyProperty); + } + +} + +public interface IVirtualItem +{ + GameObject gameObject { get; } + int Index { get; set; } + void SetData(object data); + void SetDependencyProperty(object data); + void Release(); +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemProxy.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemProxy.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemProxy.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemSelector.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemSelector.cs index 9292bc6..0ee4972 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemSelector.cs @@ -1,16 +1,16 @@ -using System.Collections.Generic; -using UnityEngine; - -public abstract class ItemSelector : MonoBehaviour -{ - [SerializeField] - protected List ItemList; - - public RectTransform GetItemTemplate(object data) - { - return OnGetTemplate(data); - } - - protected abstract RectTransform OnGetTemplate(object data); -} - +using System.Collections.Generic; +using UnityEngine; + +public abstract class ItemSelector : MonoBehaviour +{ + [SerializeField] + protected List ItemList; + + public RectTransform GetItemTemplate(object data) + { + return OnGetTemplate(data); + } + + protected abstract RectTransform OnGetTemplate(object data); +} + diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemSelector.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ItemPresent/ItemSelector.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ItemPresent/ItemSelector.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/LaunchUI.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/LaunchUI.cs index ec76815..5d5ba4d 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/LaunchUI.cs @@ -1,94 +1,94 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.UI; -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class LaunchUI : MonoBehaviour - { - [SerializeField] - RectTransform MainMenuRoot; - [SerializeField] - MainMenuController MainMenu; - public Image BG; - - Vector2 m_mainLayoutPosition; - [SerializeField] - Vector2 m_detailLayoutPosition; - [SerializeField] - float m_LayoutChangeSpeed = 10; - - public static LaunchUI Instance { get; private set; } - - TweenerCore m_layoutTween; - - private void Awake() - { - Instance = this; - m_mainLayoutPosition = MainMenuRoot.anchoredPosition; - MainMenu.ListenControlAction = true; - } - - private void Start() - { - CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; - } - - private void Update() - { - if (CommandDispatcher.Instance.Current == CommandDispatcher.Instance.Gaming && App.emu.Core.IsNull()) - CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; - } - - public void HideMainMenu() - { - BG.gameObject.SetActiveEx(false); - MainMenuRoot.gameObject.SetActiveEx(false); - } - - public void ShowMainMenu() - { - BG.gameObject.SetActiveEx(true); - MainMenuRoot.gameObject.SetActiveEx(true); - } - - public void ToDetailMenuLayout() - { - if (m_layoutTween != null) - { - m_layoutTween.Kill(); - m_layoutTween = null; - } - m_layoutTween = DOTween - .To( - () => MainMenuRoot.anchoredPosition, - (x) => MainMenuRoot.anchoredPosition = x, - m_detailLayoutPosition, - m_LayoutChangeSpeed) - .SetSpeedBased(); - MainMenu.ListenControlAction = false; - MainMenu.EnterDetailState(); - } - - public void ToMainMenuLayout() - { - if (m_layoutTween != null) - { - m_layoutTween.Kill(); - m_layoutTween = null; - } - m_layoutTween = DOTween.To( - () => MainMenuRoot.anchoredPosition, - (x) => MainMenuRoot.anchoredPosition = x, - m_mainLayoutPosition, - m_LayoutChangeSpeed) - .SetSpeedBased(); - MainMenu.ListenControlAction = true; - MainMenu.ExitDetailState(); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class LaunchUI : MonoBehaviour + { + [SerializeField] + RectTransform MainMenuRoot; + [SerializeField] + MainMenuController MainMenu; + public Image BG; + + Vector2 m_mainLayoutPosition; + [SerializeField] + Vector2 m_detailLayoutPosition; + [SerializeField] + float m_LayoutChangeSpeed = 10; + + public static LaunchUI Instance { get; private set; } + + TweenerCore m_layoutTween; + + private void Awake() + { + Instance = this; + m_mainLayoutPosition = MainMenuRoot.anchoredPosition; + MainMenu.ListenControlAction = true; + } + + private void Start() + { + CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; + } + + private void Update() + { + if (CommandDispatcher.Instance.Current == CommandDispatcher.Instance.Gaming && App.emu.Core.IsNull()) + CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; + } + + public void HideMainMenu() + { + BG.gameObject.SetActiveEx(false); + MainMenuRoot.gameObject.SetActiveEx(false); + } + + public void ShowMainMenu() + { + BG.gameObject.SetActiveEx(true); + MainMenuRoot.gameObject.SetActiveEx(true); + } + + public void ToDetailMenuLayout() + { + if (m_layoutTween != null) + { + m_layoutTween.Kill(); + m_layoutTween = null; + } + m_layoutTween = DOTween + .To( + () => MainMenuRoot.anchoredPosition, + (x) => MainMenuRoot.anchoredPosition = x, + m_detailLayoutPosition, + m_LayoutChangeSpeed) + .SetSpeedBased(); + MainMenu.ListenControlAction = false; + MainMenu.EnterDetailState(); + } + + public void ToMainMenuLayout() + { + if (m_layoutTween != null) + { + m_layoutTween.Kill(); + m_layoutTween = null; + } + m_layoutTween = DOTween.To( + () => MainMenuRoot.anchoredPosition, + (x) => MainMenuRoot.anchoredPosition = x, + m_mainLayoutPosition, + m_LayoutChangeSpeed) + .SetSpeedBased(); + MainMenu.ListenControlAction = true; + MainMenu.ExitDetailState(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/LaunchUI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/LaunchUI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/LaunchUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MainMenuController.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MainMenuController.cs index e97d2cd..eea5a6a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MainMenuController.cs @@ -1,179 +1,179 @@ -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client.UI -{ - public class MainMenuController : MenuItemController - { - [SerializeField] - HorizontalLayoutGroup GroupRoot; - [SerializeField] - MenuItem Template; - [SerializeField] - List MenuSetting; - [SerializeField] - float HoriRollSpd = 1f; - [SerializeField] - int InitSelect = -1; - - private RectTransform groupRootRect => m_menuItemRoot as RectTransform; - - private TweenerCore rollTween; - private List m_runtimeMenuUICanvas; - private Sequence seq; - - - protected override void Start() - { - base.Start(); - - m_runtimeMenuUICanvas = m_runtimeMenuUI.Select(menu => menu.gameObject.AddComponent()).ToList(); - m_runtimeMenuUICanvas.ForEach(canv => canv.gameObject.AddComponent()); - - if (InitSelect != -1) - { - m_selectIndex = InitSelect; - PlaySelectItemAnim(false); - } - } - public override void Init(List menuDataList) { } - - public void EnterDetailState() - { - if (seq != null) - { - seq.Kill(); - seq = null; - } - - var selectItem = m_runtimeMenuUICanvas[SelectIndex]; - var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList(); - seq = DOTween.Sequence(); - - seq.Append( - DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f) - ) - .Join( - DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 0, 0.2f) - ); - - seq.Play(); - } - - public void ExitDetailState() - { - if (seq != null) - { - seq.Kill(); - seq = null; - } - - var selectItem = m_runtimeMenuUICanvas[SelectIndex]; - var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList(); - seq = DOTween.Sequence(); - - seq.Append( - DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f) - ) - .Join( - DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 1, 0.2f) - ); - - seq.Play(); - } - - protected override void OnSelectMenuChanged() - { - PlaySelectItemAnim(true); - } - - private void PlaySelectItemAnim(bool useAnim) - { - var step = GroupRoot.spacing; - var needSelectItem = m_runtimeMenuUI[SelectIndex]; - var offset = needSelectItem.Rect.anchoredPosition.x; - - var targetPosition = groupRootRect.anchoredPosition; - targetPosition.x = -offset; - - if (rollTween != null) { rollTween.Kill(); rollTween = null; } - - for (var i = 0; i < m_runtimeMenuUI.Count; i++) - { - var item = m_runtimeMenuUI[i]; - item.SetSelectState(i == SelectIndex); - } - - if (useAnim) - { - rollTween = DOTween.To( - () => groupRootRect.anchoredPosition, - (x) => groupRootRect.anchoredPosition = x, - targetPosition, - HoriRollSpd) - .SetSpeedBased(); - } - else - { - groupRootRect.anchoredPosition = targetPosition; - } - } - - protected override void OnCmdSelectItemLeft() - { - SelectIndex--; - } - - protected override void OnCmdSelectItemRight() - { - SelectIndex++; - } - -#if UNITY_EDITOR - [ContextMenu("UpdateMenuUI")] - public void UpdateMenuUI() - { - while (GroupRoot.transform.childCount > 0) - { - DestroyImmediate(GroupRoot.transform.GetChild(GroupRoot.transform.childCount - 1).gameObject); - } - - for (int i = 0; i < MenuSetting.Count; i++) - { - var settingData = MenuSetting[i]; - - var templatePrefab = settingData.OverrideTemplate != null ? settingData.OverrideTemplate.gameObject : Template.gameObject; - MenuItem itemScript = null; - var prefabClone = UnityEditor.PrefabUtility.InstantiatePrefab(templatePrefab) as GameObject; - itemScript = prefabClone.GetComponent(); - itemScript.gameObject.SetActive(true); - itemScript.transform.SetParent(GroupRoot.transform); - - itemScript.SetData(settingData); - - itemScript.transform.localScale = Vector3.one; - } - - UnityEditor.EditorUtility.SetDirty(this); - } -#endif - } - - [Serializable] - public class MenuData - { - public Sprite Icon; - public string Name; - public string SubTitle; - public string Description; - public MenuItem OverrideTemplate; - public List SubMenus; - } -} +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client.UI +{ + public class MainMenuController : MenuItemController + { + [SerializeField] + HorizontalLayoutGroup GroupRoot; + [SerializeField] + MenuItem Template; + [SerializeField] + List MenuSetting; + [SerializeField] + float HoriRollSpd = 1f; + [SerializeField] + int InitSelect = -1; + + private RectTransform groupRootRect => m_menuItemRoot as RectTransform; + + private TweenerCore rollTween; + private List m_runtimeMenuUICanvas; + private Sequence seq; + + + protected override void Start() + { + base.Start(); + + m_runtimeMenuUICanvas = m_runtimeMenuUI.Select(menu => menu.gameObject.AddComponent()).ToList(); + m_runtimeMenuUICanvas.ForEach(canv => canv.gameObject.AddComponent()); + + if (InitSelect != -1) + { + m_selectIndex = InitSelect; + PlaySelectItemAnim(false); + } + } + public override void Init(List menuDataList) { } + + public void EnterDetailState() + { + if (seq != null) + { + seq.Kill(); + seq = null; + } + + var selectItem = m_runtimeMenuUICanvas[SelectIndex]; + var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList(); + seq = DOTween.Sequence(); + + seq.Append( + DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f) + ) + .Join( + DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 0, 0.2f) + ); + + seq.Play(); + } + + public void ExitDetailState() + { + if (seq != null) + { + seq.Kill(); + seq = null; + } + + var selectItem = m_runtimeMenuUICanvas[SelectIndex]; + var hideItem = m_runtimeMenuUICanvas.Where(i => i != selectItem).ToList(); + seq = DOTween.Sequence(); + + seq.Append( + DOTween.To(() => selectItem.alpha, (x) => selectItem.alpha = x, 1, 0.2f) + ) + .Join( + DOTween.To(() => hideItem[0].alpha, (x) => hideItem.ForEach(i => i.alpha = x), 1, 0.2f) + ); + + seq.Play(); + } + + protected override void OnSelectMenuChanged() + { + PlaySelectItemAnim(true); + } + + private void PlaySelectItemAnim(bool useAnim) + { + var step = GroupRoot.spacing; + var needSelectItem = m_runtimeMenuUI[SelectIndex]; + var offset = needSelectItem.Rect.anchoredPosition.x; + + var targetPosition = groupRootRect.anchoredPosition; + targetPosition.x = -offset; + + if (rollTween != null) { rollTween.Kill(); rollTween = null; } + + for (var i = 0; i < m_runtimeMenuUI.Count; i++) + { + var item = m_runtimeMenuUI[i]; + item.SetSelectState(i == SelectIndex); + } + + if (useAnim) + { + rollTween = DOTween.To( + () => groupRootRect.anchoredPosition, + (x) => groupRootRect.anchoredPosition = x, + targetPosition, + HoriRollSpd) + .SetSpeedBased(); + } + else + { + groupRootRect.anchoredPosition = targetPosition; + } + } + + protected override void OnCmdSelectItemLeft() + { + SelectIndex--; + } + + protected override void OnCmdSelectItemRight() + { + SelectIndex++; + } + +#if UNITY_EDITOR + [ContextMenu("UpdateMenuUI")] + public void UpdateMenuUI() + { + while (GroupRoot.transform.childCount > 0) + { + DestroyImmediate(GroupRoot.transform.GetChild(GroupRoot.transform.childCount - 1).gameObject); + } + + for (int i = 0; i < MenuSetting.Count; i++) + { + var settingData = MenuSetting[i]; + + var templatePrefab = settingData.OverrideTemplate != null ? settingData.OverrideTemplate.gameObject : Template.gameObject; + MenuItem itemScript = null; + var prefabClone = UnityEditor.PrefabUtility.InstantiatePrefab(templatePrefab) as GameObject; + itemScript = prefabClone.GetComponent(); + itemScript.gameObject.SetActive(true); + itemScript.transform.SetParent(GroupRoot.transform); + + itemScript.SetData(settingData); + + itemScript.transform.localScale = Vector3.one; + } + + UnityEditor.EditorUtility.SetDirty(this); + } +#endif + } + + [Serializable] + public class MenuData + { + public Sprite Icon; + public string Name; + public string SubTitle; + public string Description; + public MenuItem OverrideTemplate; + public List SubMenus; + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MainMenuController.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/MainMenuController.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MainMenuController.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItem.cs index 41587a1..f1db706 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItem.cs @@ -1,119 +1,119 @@ -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client.UI -{ - public class MenuItem : CommandExecuter - { - [SerializeField] - protected Image Icon; - [SerializeField] - protected Text Txt; - [SerializeField] - protected Text SubTitle; - [SerializeField] - protected Image spline; - [SerializeField] - protected Text Descript; - [SerializeField] - protected Transform Root; - [SerializeField] - protected Image ShadowIcon; - [SerializeField] - protected CanvasGroup InfoNode; - [SerializeField] - protected SubMenuItemGroup SubMenuItemGroup; - - public float SelectScale = 1f; - public float UnSelectScale = 0.85f; - - public RectTransform Rect => transform as RectTransform; - - protected bool m_select; - protected TweenerCore progressTween; - protected float m_progress; - - protected override void Awake() - { - base.Awake(); - Reset(); - } - - public void SetData(MenuData data) - { - Reset(); - - SetBaseInfo(data.Name, data.Description, data.SubTitle); - SetIcon(data.Icon); - if (SubMenuItemGroup != null) SubMenuItemGroup.Init(data.SubMenus); - } - - protected void Reset() - { - m_select = false; - m_progress = 0f; - - Root.localScale = Vector3.one * UnSelectScale; - - if (progressTween != null) { progressTween.Kill(); progressTween = null; } - - if (ShadowIcon != null) ShadowIcon.gameObject.SetActive(false); - - if (InfoNode != null) InfoNode.alpha = 0; - if (spline != null) spline.SetAlpha(0); - if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(false); - if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(false); - } - - protected void SetBaseInfo(string name, string descript, string subTitle) - { - this.name = name; - - if (Txt != null) Txt.text = name; - if (SubTitle != null) SubTitle.text = subTitle; - if (Descript != null) Descript.text = descript; - } - - protected void SetIcon(Sprite icon) - { - if (Icon != null) Icon.sprite = icon; - if (ShadowIcon != null) ShadowIcon.sprite = icon; - } - - public virtual void SetSelectState(bool selected) - { - if (m_select == selected) return; - - m_select = selected; - - if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(selected); - if (SubMenuItemGroup != null) - { - SubMenuItemGroup.SetSelect(selected); - } - - if (progressTween != null) { progressTween.Kill(); progressTween = null; } - - progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 0.3f) - .OnUpdate(() => - { - if (InfoNode != null) InfoNode.alpha = m_progress; - if (spline != null) spline.SetAlpha(m_progress); - Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); - - if (m_select) OnSelected(m_progress); - }); - } - - protected virtual void OnSelected(float progress) { } - - public virtual bool OnEnterItem() => true; - - public virtual bool OnExitItem() => true; - - public override bool Enable => true; - } -} +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client.UI +{ + public class MenuItem : CommandExecuter + { + [SerializeField] + protected Image Icon; + [SerializeField] + protected Text Txt; + [SerializeField] + protected Text SubTitle; + [SerializeField] + protected Image spline; + [SerializeField] + protected Text Descript; + [SerializeField] + protected Transform Root; + [SerializeField] + protected Image ShadowIcon; + [SerializeField] + protected CanvasGroup InfoNode; + [SerializeField] + protected SubMenuItemGroup SubMenuItemGroup; + + public float SelectScale = 1f; + public float UnSelectScale = 0.85f; + + public RectTransform Rect => transform as RectTransform; + + protected bool m_select; + protected TweenerCore progressTween; + protected float m_progress; + + protected override void Awake() + { + base.Awake(); + Reset(); + } + + public void SetData(MenuData data) + { + Reset(); + + SetBaseInfo(data.Name, data.Description, data.SubTitle); + SetIcon(data.Icon); + if (SubMenuItemGroup != null) SubMenuItemGroup.Init(data.SubMenus); + } + + protected void Reset() + { + m_select = false; + m_progress = 0f; + + Root.localScale = Vector3.one * UnSelectScale; + + if (progressTween != null) { progressTween.Kill(); progressTween = null; } + + if (ShadowIcon != null) ShadowIcon.gameObject.SetActive(false); + + if (InfoNode != null) InfoNode.alpha = 0; + if (spline != null) spline.SetAlpha(0); + if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(false); + if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(false); + } + + protected void SetBaseInfo(string name, string descript, string subTitle) + { + this.name = name; + + if (Txt != null) Txt.text = name; + if (SubTitle != null) SubTitle.text = subTitle; + if (Descript != null) Descript.text = descript; + } + + protected void SetIcon(Sprite icon) + { + if (Icon != null) Icon.sprite = icon; + if (ShadowIcon != null) ShadowIcon.sprite = icon; + } + + public virtual void SetSelectState(bool selected) + { + if (m_select == selected) return; + + m_select = selected; + + if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(selected); + if (SubMenuItemGroup != null) + { + SubMenuItemGroup.SetSelect(selected); + } + + if (progressTween != null) { progressTween.Kill(); progressTween = null; } + + progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 0.3f) + .OnUpdate(() => + { + if (InfoNode != null) InfoNode.alpha = m_progress; + if (spline != null) spline.SetAlpha(m_progress); + Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); + + if (m_select) OnSelected(m_progress); + }); + } + + protected virtual void OnSelected(float progress) { } + + public virtual bool OnEnterItem() => true; + + public virtual bool OnExitItem() => true; + + public override bool Enable => true; + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/MenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItemController.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItemController.cs index 8c4fdbd..c64e4b1 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItemController.cs @@ -1,109 +1,109 @@ -using AxibugEmuOnline.Client.UI; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public abstract class MenuItemController : CommandExecuter - { - [SerializeField] - protected Transform m_menuItemRoot; - protected List m_runtimeMenuUI = new List(); - - protected MenuItem m_enteredItem = null; - - protected int m_selectIndex = -1; - - public virtual int SelectIndex - { - get => m_selectIndex; - set - { - value = Mathf.Clamp(value, 0, m_runtimeMenuUI.Count - 1); - if (m_selectIndex == value) return; - m_selectIndex = value; - - OnSelectMenuChanged(); - } - } - - protected virtual void Start() - { - if (m_menuItemRoot != null) - { - for (int i = 0; i < m_menuItemRoot.childCount; i++) - { - Transform child = m_menuItemRoot.GetChild(i); - m_runtimeMenuUI.Add(child.GetComponent()); - } - } - - Canvas.ForceUpdateCanvases(); - SelectIndex = 0; - } - - protected virtual MenuItem GetItemUIByIndex(int index) - { - return m_runtimeMenuUI[SelectIndex]; - } - - protected override bool OnCmdEnter() - { - if (m_enteredItem == null) - { - var willEnterItem = GetItemUIByIndex(SelectIndex); - bool res = willEnterItem.OnEnterItem(); - if (res) - { - m_enteredItem = willEnterItem; - } - return res; - } - - return false; - } - - protected override void OnCmdBack() - { - if (m_enteredItem != null) - { - m_enteredItem.OnExitItem(); - m_enteredItem = null; - } - } - - protected abstract void OnSelectMenuChanged(); - } - - public abstract class MenuItemController : MenuItemController - { - public override bool Enable => enabled && ListenControlAction; - - private bool m_listenControlAction; - public bool ListenControlAction - { - get => m_listenControlAction; - set - { - m_listenControlAction = value; - - if (value) - CommandDispatcher.Instance.RegistController(this); - else - CommandDispatcher.Instance.UnRegistController(this); - - if (!value) - ResetPulsInvoker(); - } - } - - public abstract void Init(List menuDataList); - - - protected override void OnDestroy() - { - if (CommandDispatcher.Instance != null) - CommandDispatcher.Instance.UnRegistController(this); - } - } -} +using AxibugEmuOnline.Client.UI; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public abstract class MenuItemController : CommandExecuter + { + [SerializeField] + protected Transform m_menuItemRoot; + protected List m_runtimeMenuUI = new List(); + + protected MenuItem m_enteredItem = null; + + protected int m_selectIndex = -1; + + public virtual int SelectIndex + { + get => m_selectIndex; + set + { + value = Mathf.Clamp(value, 0, m_runtimeMenuUI.Count - 1); + if (m_selectIndex == value) return; + m_selectIndex = value; + + OnSelectMenuChanged(); + } + } + + protected virtual void Start() + { + if (m_menuItemRoot != null) + { + for (int i = 0; i < m_menuItemRoot.childCount; i++) + { + Transform child = m_menuItemRoot.GetChild(i); + m_runtimeMenuUI.Add(child.GetComponent()); + } + } + + Canvas.ForceUpdateCanvases(); + SelectIndex = 0; + } + + protected virtual MenuItem GetItemUIByIndex(int index) + { + return m_runtimeMenuUI[SelectIndex]; + } + + protected override bool OnCmdEnter() + { + if (m_enteredItem == null) + { + var willEnterItem = GetItemUIByIndex(SelectIndex); + bool res = willEnterItem.OnEnterItem(); + if (res) + { + m_enteredItem = willEnterItem; + } + return res; + } + + return false; + } + + protected override void OnCmdBack() + { + if (m_enteredItem != null) + { + m_enteredItem.OnExitItem(); + m_enteredItem = null; + } + } + + protected abstract void OnSelectMenuChanged(); + } + + public abstract class MenuItemController : MenuItemController + { + public override bool Enable => enabled && ListenControlAction; + + private bool m_listenControlAction; + public bool ListenControlAction + { + get => m_listenControlAction; + set + { + m_listenControlAction = value; + + if (value) + CommandDispatcher.Instance.RegistController(this); + else + CommandDispatcher.Instance.UnRegistController(this); + + if (!value) + ResetPulsInvoker(); + } + } + + public abstract void Init(List menuDataList); + + + protected override void OnDestroy() + { + if (CommandDispatcher.Instance != null) + CommandDispatcher.Instance.UnRegistController(this); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItemController.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/MenuItemController.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs index 1fcdf22..d65d4da 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs @@ -1,438 +1,439 @@ -using DG.Tweening; -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class OptionUI : CommandExecuter - { - [SerializeField] - RectTransform MenuRoot; - [SerializeField] - Selector SelectBorder; - - [Space] - [Header("ģ")] - [SerializeField] OptionUI_ExecuteItem TEMPLATE_EXECUTEITEM; - [SerializeField] OptionUI_ValueEditItem TEMPLATE_VALUEEDITITEM; - - private OptionUI m_child; - private OptionUI m_parent; - - public override bool AloneMode => true; - public override bool Enable => m_bPoped && (m_child == null || !m_child.m_bPoped); - - private bool m_bPoped = false; - private List m_runtimeMenuItems = new List(); - - private int m_selectIndex = -1; - public int SelectIndex - { - get { return m_selectIndex; } - set - { - value = Mathf.Clamp(value, 0, m_runtimeMenuItems.Count - 1); - if (m_selectIndex == value) return; - - var gap = value - m_selectIndex; - - while (!m_runtimeMenuItems[value].Visible) - { - var temp = value; - if (gap > 0) - { - temp++; - } - else - { - temp--; - } - - if (temp >= 0 && temp < m_runtimeMenuItems.Count) - value = temp; - } - - m_selectIndex = value; - - OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; - optionUI_MenuItem.OnFocus(); - var itemUIRect = optionUI_MenuItem.transform as RectTransform; - SelectBorder.Target = itemUIRect; - } - } - - protected override void Awake() - { - TEMPLATE_EXECUTEITEM.gameObject.SetActiveEx(false); - TEMPLATE_VALUEEDITITEM.gameObject.SetActiveEx(false); - - SelectBorder.gameObject.SetActiveEx(false); - base.Awake(); - } - - protected override void Update() - { - SelectBorder.Active = Enable; - UpdateMenuState(); - - base.Update(); - } - - private void UpdateMenuState() - { - bool dirty = false; - dirty = checkDirty(); - if (dirty) - { - RebuildSelectIndex(); - } - } - - private void RebuildSelectIndex() - { - Canvas.ForceUpdateCanvases(); - - SelectIndex = Mathf.Clamp(SelectIndex, 0, m_runtimeMenuItems.Count - 1); - var selectItem = m_runtimeMenuItems[SelectIndex]; - - if (selectItem.Visible == false) - { - bool find = false; - int currentSelect = SelectIndex; - while (currentSelect > 0) - { - currentSelect--; - if (m_runtimeMenuItems[currentSelect].Visible) - { - find = true; - } - } - if (!find) - { - currentSelect = SelectIndex; - while (currentSelect < m_runtimeMenuItems.Count) - { - if (m_runtimeMenuItems[currentSelect].Visible) - { - find = true; - } - currentSelect++; - } - } - - if (find) - SelectIndex = currentSelect; - } - else - { - var itemUIRect = selectItem.transform as RectTransform; - SelectBorder.Target = itemUIRect; - } - } - - private bool checkDirty() - { - bool dirty = false; - foreach (var menuItem in m_runtimeMenuItems) - { - if (menuItem.gameObject.activeSelf != menuItem.Visible) - { - dirty = true; - menuItem.gameObject.SetActive(menuItem.Visible); - } - } - - return dirty; - } - - IKeyMapperChanger m_lastCS; - private Action m_onClose; - - /// - /// ˵ʱ,̬һ˵ѡ - /// - /// - public void AddOptionMenuWhenPoping(OptionMenu menu) - { - if (!m_bPoped) return; - - CreateRuntimeMenuItem(menu); - Canvas.ForceUpdateCanvases(); - - OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; - SelectBorder.Target = optionUI_MenuItem.transform as RectTransform; - } - - public void Pop(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu - { - m_onClose = onClose; - ReleaseRuntimeMenus(); - foreach (var menu in menus) CreateRuntimeMenuItem(menu); - CommandDispatcher.Instance.RegistController(this); - SelectBorder.gameObject.SetActiveEx(true); - - Canvas.ForceUpdateCanvases(); - - m_selectIndex = defaultIndex; - OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[defaultIndex]; - optionUI_MenuItem.OnFocus(); - - var itemUIRect = optionUI_MenuItem.transform as RectTransform; - SelectBorder.Target = itemUIRect; - SelectBorder.RefreshPosition(); - - if (!m_bPoped) - { - m_bPoped = true; - Vector2 start = new Vector2(0, MenuRoot.anchoredPosition.y); - Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); - DOTween.To( - () => start, - (value) => - { - var moveDelta = value - start; - start = value; - - var topParent = m_parent; - while (topParent != null && topParent.m_parent != null) - { - topParent = topParent.m_parent; - } - if (topParent != null) - { - topParent.MenuRoot.anchoredPosition += moveDelta; - } - else - { - MenuRoot.anchoredPosition += moveDelta; - } - }, - end, - 0.3f - ).SetEase(Ease.OutCubic); - - m_lastCS = CommandDispatcher.Instance.Current; - CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; - } - - } - - public void Hide() - { - if (m_bPoped) - { - Vector2 start = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); - Vector2 end = new Vector2(0, MenuRoot.anchoredPosition.y); - - - ReleaseRuntimeMenus(); - m_runtimeMenuItems.Clear(); - - SelectBorder.gameObject.SetActiveEx(false); - - CommandDispatcher.Instance.UnRegistController(this); - Canvas.ForceUpdateCanvases(); - - DOTween.To( - () => start, - (value) => - { - var moveDelta = value - start; - start = value; - - var topParent = m_parent; - while (topParent != null && topParent.m_parent != null) - { - topParent = topParent.m_parent; - } - if (topParent != null) - { - topParent.MenuRoot.anchoredPosition += moveDelta; - } - else - { - MenuRoot.anchoredPosition += moveDelta; - } - }, - end, - 0.3f - ).SetEase(Ease.OutCubic); - - m_bPoped = false; - - CommandDispatcher.Instance.Current = m_lastCS; - - m_onClose?.Invoke(); - m_onClose = null; - } - } - - private void CreateRuntimeMenuItem(OptionMenu menuData) - { - if (menuData is ExecuteMenu executeMenu) - { - var menuUI = Instantiate(TEMPLATE_EXECUTEITEM.gameObject, TEMPLATE_EXECUTEITEM.transform.parent).GetComponent(); - menuUI.gameObject.SetActive(true); - menuUI.SetData(this, executeMenu); - m_runtimeMenuItems.Add(menuUI); - } - else if (menuData is ValueSetMenu valueSetMenu) - { - var menuUI = Instantiate(TEMPLATE_VALUEEDITITEM.gameObject, TEMPLATE_VALUEEDITITEM.transform.parent).GetComponent(); - menuUI.gameObject.SetActive(true); - menuUI.SetData(this, valueSetMenu); - m_runtimeMenuItems.Add(menuUI); - } - else throw new NotImplementedException($"ݲֵ֧IJ˵{menuData.GetType().Name}"); - } - - private void ReleaseRuntimeMenus() - { - foreach (var item in m_runtimeMenuItems) - { - item.OnHide(); - Destroy(item.gameObject); - } - m_runtimeMenuItems.Clear(); - } - - protected override void OnCmdSelectItemDown() - { - SelectIndex++; - } - - protected override void OnCmdSelectItemUp() - { - SelectIndex--; - } - - protected override void OnCmdBack() - { - Hide(); - } - - protected override void OnCmdSelectItemLeft() - { - var executer = m_runtimeMenuItems[SelectIndex]; - if (executer != null) - { - executer.OnLeft(); - } - } - - protected override void OnCmdSelectItemRight() - { - var executer = m_runtimeMenuItems[SelectIndex]; - if (!executer.IsExpandMenu) - { - executer.OnRight(); - return; - } - - OnCmdEnter(); - } - - protected override bool OnCmdEnter() - { - var executer = m_runtimeMenuItems[SelectIndex]; - bool cancelHide = false; - executer.OnExecute(this, ref cancelHide); - if (!cancelHide) Hide(); - - return false; - } - - /// - /// չ¼˵ - /// - /// - /// - /// - /// - public void ExpandSubMenu(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu - { - if (m_child == null) - { - var sourcePrefab = Resources.Load("UIPrefabs/OptionUI"); - m_child = Instantiate(sourcePrefab, transform).GetComponent(); - m_child.name = $"{name}_Sub"; - m_child.m_parent = this; - } - - Canvas.ForceUpdateCanvases(); - - m_child.Pop(menus, 0, onClose); - } - - public void RemoveItem(OptionUI_MenuItem ui) - { - var index = m_runtimeMenuItems.IndexOf(ui); - if (index == -1) return; - - m_runtimeMenuItems.Remove(ui); - ui.OnHide(); - Destroy(ui.gameObject); - - RebuildSelectIndex(); - } - } - - /// - /// ִΪIJ˵ - /// - public abstract class ExecuteMenu : OptionMenu - { - public ExecuteMenu(string name, Sprite icon = null) : base(name, icon) { } - - public abstract void OnExcute(OptionUI optionUI, ref bool cancelHide); - } - - /// - /// չΪIJ˵ - /// - public abstract class ExpandMenu : ExecuteMenu - { - protected ExpandMenu(string name, Sprite icon = null) : base(name, icon) { } - - public sealed override void OnExcute(OptionUI optionUI, ref bool cancelHide) - { - cancelHide = true; - optionUI.ExpandSubMenu(GetOptionMenus()); - } - - protected abstract List GetOptionMenus(); - } - - /// ҪֱӼ̳ - public abstract class OptionMenu - { - public string Name { get; protected set; } - public Sprite Icon { get; protected set; } - public virtual bool Visible => true; - public virtual bool Enable => true; - - public OptionMenu(string name, Sprite icon = null) - { - Name = name; - Icon = icon; - } - - public virtual void OnFocus() { } - public virtual void OnShow(OptionUI_MenuItem ui) { } - public virtual void OnHide() { } - } - /// - /// ֵʾͱ༭IJ˵ - /// - public abstract class ValueSetMenu : OptionMenu - { - public ValueSetMenu(string name) : base(name) { } - - public abstract Type ValueType { get; } - public abstract object ValueRaw { get; } - public abstract void OnValueChanged(object newValue); - public abstract object Min { get; } - public abstract object Max { get; } - } -} +using DG.Tweening; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class OptionUI : CommandExecuter + { + [SerializeField] + RectTransform MenuRoot; + [SerializeField] + Selector SelectBorder; + + [Space] + [Header("ģ")] + [SerializeField] OptionUI_ExecuteItem TEMPLATE_EXECUTEITEM; + [SerializeField] OptionUI_ValueEditItem TEMPLATE_VALUEEDITITEM; + + private OptionUI m_child; + private OptionUI m_parent; + + public override bool AloneMode => true; + public override bool Enable => m_bPoped && (m_child == null || !m_child.m_bPoped); + + private bool m_bPoped = false; + private List m_runtimeMenuItems = new List(); + + private int m_selectIndex = -1; + public int SelectIndex + { + get { return m_selectIndex; } + set + { + value = Mathf.Clamp(value, 0, m_runtimeMenuItems.Count - 1); + if (m_selectIndex == value) return; + + var gap = value - m_selectIndex; + + while (!m_runtimeMenuItems[value].Visible) + { + var temp = value; + if (gap > 0) + { + temp++; + } + else + { + temp--; + } + + if (temp >= 0 && temp < m_runtimeMenuItems.Count) + value = temp; + } + + m_selectIndex = value; + + OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; + optionUI_MenuItem.OnFocus(); + var itemUIRect = optionUI_MenuItem.transform as RectTransform; + SelectBorder.Target = itemUIRect; + } + } + + protected override void Awake() + { + TEMPLATE_EXECUTEITEM.gameObject.SetActiveEx(false); + TEMPLATE_VALUEEDITITEM.gameObject.SetActiveEx(false); + + SelectBorder.gameObject.SetActiveEx(false); + base.Awake(); + } + + protected override void Update() + { + SelectBorder.Active = Enable; + UpdateMenuState(); + + base.Update(); + } + + private void UpdateMenuState() + { + bool dirty = false; + dirty = checkDirty(); + if (dirty) + { + RebuildSelectIndex(); + } + } + + private void RebuildSelectIndex() + { + Canvas.ForceUpdateCanvases(); + + SelectIndex = Mathf.Clamp(SelectIndex, 0, m_runtimeMenuItems.Count - 1); + var selectItem = m_runtimeMenuItems[SelectIndex]; + + if (selectItem.Visible == false) + { + bool find = false; + int currentSelect = SelectIndex; + while (currentSelect > 0) + { + currentSelect--; + if (m_runtimeMenuItems[currentSelect].Visible) + { + find = true; + } + } + if (!find) + { + currentSelect = SelectIndex; + while (currentSelect < m_runtimeMenuItems.Count) + { + if (m_runtimeMenuItems[currentSelect].Visible) + { + find = true; + } + currentSelect++; + } + } + + if (find) + SelectIndex = currentSelect; + } + else + { + var itemUIRect = selectItem.transform as RectTransform; + SelectBorder.Target = itemUIRect; + } + } + + private bool checkDirty() + { + bool dirty = false; + foreach (var menuItem in m_runtimeMenuItems) + { + if (menuItem.gameObject.activeSelf != menuItem.Visible) + { + dirty = true; + menuItem.gameObject.SetActive(menuItem.Visible); + } + } + + return dirty; + } + + IKeyMapperChanger m_lastCS; + private Action m_onClose; + + /// + /// ˵ʱ,̬һ˵ѡ + /// + /// + public void AddOptionMenuWhenPoping(OptionMenu menu) + { + if (!m_bPoped) return; + + CreateRuntimeMenuItem(menu); + Canvas.ForceUpdateCanvases(); + + OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[m_selectIndex]; + SelectBorder.Target = null; + SelectBorder.Target = optionUI_MenuItem.transform as RectTransform; + } + + public void Pop(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu + { + m_onClose = onClose; + ReleaseRuntimeMenus(); + foreach (var menu in menus) CreateRuntimeMenuItem(menu); + CommandDispatcher.Instance.RegistController(this); + SelectBorder.gameObject.SetActiveEx(true); + + Canvas.ForceUpdateCanvases(); + + m_selectIndex = defaultIndex; + OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[defaultIndex]; + optionUI_MenuItem.OnFocus(); + + var itemUIRect = optionUI_MenuItem.transform as RectTransform; + SelectBorder.Target = itemUIRect; + SelectBorder.RefreshPosition(); + + if (!m_bPoped) + { + m_bPoped = true; + Vector2 start = new Vector2(0, MenuRoot.anchoredPosition.y); + Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); + DOTween.To( + () => start, + (value) => + { + var moveDelta = value - start; + start = value; + + var topParent = m_parent; + while (topParent != null && topParent.m_parent != null) + { + topParent = topParent.m_parent; + } + if (topParent != null) + { + topParent.MenuRoot.anchoredPosition += moveDelta; + } + else + { + MenuRoot.anchoredPosition += moveDelta; + } + }, + end, + 0.3f + ).SetEase(Ease.OutCubic); + + m_lastCS = CommandDispatcher.Instance.Current; + CommandDispatcher.Instance.Current = CommandDispatcher.Instance.Normal; + } + + } + + public void Hide() + { + if (m_bPoped) + { + Vector2 start = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); + Vector2 end = new Vector2(0, MenuRoot.anchoredPosition.y); + + + ReleaseRuntimeMenus(); + m_runtimeMenuItems.Clear(); + + SelectBorder.gameObject.SetActiveEx(false); + + CommandDispatcher.Instance.UnRegistController(this); + Canvas.ForceUpdateCanvases(); + + DOTween.To( + () => start, + (value) => + { + var moveDelta = value - start; + start = value; + + var topParent = m_parent; + while (topParent != null && topParent.m_parent != null) + { + topParent = topParent.m_parent; + } + if (topParent != null) + { + topParent.MenuRoot.anchoredPosition += moveDelta; + } + else + { + MenuRoot.anchoredPosition += moveDelta; + } + }, + end, + 0.3f + ).SetEase(Ease.OutCubic); + + m_bPoped = false; + + CommandDispatcher.Instance.Current = m_lastCS; + + m_onClose?.Invoke(); + m_onClose = null; + } + } + + private void CreateRuntimeMenuItem(OptionMenu menuData) + { + if (menuData is ExecuteMenu executeMenu) + { + var menuUI = Instantiate(TEMPLATE_EXECUTEITEM.gameObject, TEMPLATE_EXECUTEITEM.transform.parent).GetComponent(); + menuUI.gameObject.SetActive(true); + menuUI.SetData(this, executeMenu); + m_runtimeMenuItems.Add(menuUI); + } + else if (menuData is ValueSetMenu valueSetMenu) + { + var menuUI = Instantiate(TEMPLATE_VALUEEDITITEM.gameObject, TEMPLATE_VALUEEDITITEM.transform.parent).GetComponent(); + menuUI.gameObject.SetActive(true); + menuUI.SetData(this, valueSetMenu); + m_runtimeMenuItems.Add(menuUI); + } + else throw new NotImplementedException($"ݲֵ֧IJ˵{menuData.GetType().Name}"); + } + + private void ReleaseRuntimeMenus() + { + foreach (var item in m_runtimeMenuItems) + { + item.OnHide(); + Destroy(item.gameObject); + } + m_runtimeMenuItems.Clear(); + } + + protected override void OnCmdSelectItemDown() + { + SelectIndex++; + } + + protected override void OnCmdSelectItemUp() + { + SelectIndex--; + } + + protected override void OnCmdBack() + { + Hide(); + } + + protected override void OnCmdSelectItemLeft() + { + var executer = m_runtimeMenuItems[SelectIndex]; + if (executer != null) + { + executer.OnLeft(); + } + } + + protected override void OnCmdSelectItemRight() + { + var executer = m_runtimeMenuItems[SelectIndex]; + if (!executer.IsExpandMenu) + { + executer.OnRight(); + return; + } + + OnCmdEnter(); + } + + protected override bool OnCmdEnter() + { + var executer = m_runtimeMenuItems[SelectIndex]; + bool cancelHide = false; + executer.OnExecute(this, ref cancelHide); + if (!cancelHide) Hide(); + + return false; + } + + /// + /// չ¼˵ + /// + /// + /// + /// + /// + public void ExpandSubMenu(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu + { + if (m_child == null) + { + var sourcePrefab = Resources.Load("UIPrefabs/OptionUI"); + m_child = Instantiate(sourcePrefab, transform).GetComponent(); + m_child.name = $"{name}_Sub"; + m_child.m_parent = this; + } + + Canvas.ForceUpdateCanvases(); + + m_child.Pop(menus, 0, onClose); + } + + public void RemoveItem(OptionUI_MenuItem ui) + { + var index = m_runtimeMenuItems.IndexOf(ui); + if (index == -1) return; + + m_runtimeMenuItems.Remove(ui); + ui.OnHide(); + Destroy(ui.gameObject); + + RebuildSelectIndex(); + } + } + + /// + /// ִΪIJ˵ + /// + public abstract class ExecuteMenu : OptionMenu + { + public ExecuteMenu(string name, Sprite icon = null) : base(name, icon) { } + + public abstract void OnExcute(OptionUI optionUI, ref bool cancelHide); + } + + /// + /// չΪIJ˵ + /// + public abstract class ExpandMenu : ExecuteMenu + { + protected ExpandMenu(string name, Sprite icon = null) : base(name, icon) { } + + public sealed override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + cancelHide = true; + optionUI.ExpandSubMenu(GetOptionMenus()); + } + + protected abstract List GetOptionMenus(); + } + + /// ҪֱӼ̳ + public abstract class OptionMenu + { + public string Name { get; protected set; } + public Sprite Icon { get; protected set; } + public virtual bool Visible => true; + public virtual bool Enable => true; + + public OptionMenu(string name, Sprite icon = null) + { + Name = name; + Icon = icon; + } + + public virtual void OnFocus() { } + public virtual void OnShow(OptionUI_MenuItem ui) { } + public virtual void OnHide() { } + } + /// + /// ֵʾͱ༭IJ˵ + /// + public abstract class ValueSetMenu : OptionMenu + { + public ValueSetMenu(string name) : base(name) { } + + public abstract Type ValueType { get; } + public abstract object ValueRaw { get; } + public abstract void OnValueChanged(object newValue); + public abstract object Min { get; } + public abstract object Max { get; } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ExecuteItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ExecuteItem.cs index a6ba63c..bc92bb6 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ExecuteItem.cs @@ -1,21 +1,21 @@ -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class OptionUI_ExecuteItem : OptionUI_MenuItem - { - public GameObject ExpandFlag; - - protected override void OnSetData(OptionMenu menuData) - { - base.OnSetData(menuData); - - ExpandFlag.SetActiveEx(IsExpandMenu); - } - - public override void OnExecute(OptionUI optionUI, ref bool cancelHide) - { - MenuData.OnExcute(optionUI, ref cancelHide); - } - } -} +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class OptionUI_ExecuteItem : OptionUI_MenuItem + { + public GameObject ExpandFlag; + + protected override void OnSetData(OptionMenu menuData) + { + base.OnSetData(menuData); + + ExpandFlag.SetActiveEx(IsExpandMenu); + } + + public override void OnExecute(OptionUI optionUI, ref bool cancelHide) + { + MenuData.OnExcute(optionUI, ref cancelHide); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ExecuteItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ExecuteItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ExecuteItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_MenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_MenuItem.cs index f3ae05b..0925646 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_MenuItem.cs @@ -1,64 +1,64 @@ -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public abstract class OptionUI_MenuItem : MonoBehaviour - { - [SerializeField] Text m_MenuNameTxt; - [SerializeField] Image m_Icon; - - public Image IconUI => m_Icon; - - public bool Visible => m_Menu.Visible; - public OptionUI OptionUI { get; private set; } - protected OptionMenu m_Menu; - - public void SetData(OptionUI optionUI, OptionMenu menuData) - { - OptionUI = optionUI; - m_Menu = menuData; - m_MenuNameTxt.text = menuData.Name; - if (menuData.Icon == null) m_Icon.gameObject.SetActiveEx(false); - else - { - m_Icon.gameObject.SetActiveEx(true); - m_Icon.SetMaterial(null); - m_Icon.sprite = menuData.Icon; - } - - OnSetData(menuData); - } - - public bool IsExpandMenu => m_Menu is ExpandMenu; - - protected abstract void OnSetData(OptionMenu menuData); - - public abstract void OnExecute(OptionUI optionUI, ref bool cancelHide); - public virtual void OnLeft() { } - public virtual void OnRight() { } - public abstract void OnFocus(); - public virtual void OnHide() { } - } - - public abstract class OptionUI_MenuItem : OptionUI_MenuItem - where T : OptionMenu - { - protected T MenuData => m_Menu as T; - - protected override void OnSetData(OptionMenu menuData) - { - MenuData.OnShow(this); - } - - public override void OnFocus() - { - MenuData.OnFocus(); - } - - public override void OnHide() - { - MenuData.OnHide(); - } - } -} +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public abstract class OptionUI_MenuItem : MonoBehaviour + { + [SerializeField] Text m_MenuNameTxt; + [SerializeField] Image m_Icon; + + public Image IconUI => m_Icon; + + public bool Visible => m_Menu.Visible; + public OptionUI OptionUI { get; private set; } + protected OptionMenu m_Menu; + + public void SetData(OptionUI optionUI, OptionMenu menuData) + { + OptionUI = optionUI; + m_Menu = menuData; + m_MenuNameTxt.text = menuData.Name; + if (menuData.Icon == null) m_Icon.gameObject.SetActiveEx(false); + else + { + m_Icon.gameObject.SetActiveEx(true); + m_Icon.SetMaterial(null); + m_Icon.sprite = menuData.Icon; + } + + OnSetData(menuData); + } + + public bool IsExpandMenu => m_Menu is ExpandMenu; + + protected abstract void OnSetData(OptionMenu menuData); + + public abstract void OnExecute(OptionUI optionUI, ref bool cancelHide); + public virtual void OnLeft() { } + public virtual void OnRight() { } + public abstract void OnFocus(); + public virtual void OnHide() { } + } + + public abstract class OptionUI_MenuItem : OptionUI_MenuItem + where T : OptionMenu + { + protected T MenuData => m_Menu as T; + + protected override void OnSetData(OptionMenu menuData) + { + MenuData.OnShow(this); + } + + public override void OnFocus() + { + MenuData.OnFocus(); + } + + public override void OnHide() + { + MenuData.OnHide(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_MenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_MenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_MenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem.cs index 9c88a3f..8d63570 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem.cs @@ -29,7 +29,7 @@ namespace AxibugEmuOnline.Client } else { - App.log.Error($"δֵ֧:{valueMenu.ValueType}"); + App.log.Warning($"δֵ֧:{valueMenu.ValueType}"); return; } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_EnumEdit.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_FloatEdit.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/InputUI.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/InputUI.cs index 56ac632..1eebe31 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/InputUI.cs @@ -1,75 +1,75 @@ -using System; -using System.Collections; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class InputUI : OverlayUI - { - [SerializeField] - InputField m_input; - - Action OnCommit; - - public static bool IsInputing { get; private set; } - - - - protected override void OnShow(object param) - { - (Action callback, string placeHolder, string defaultText) t = ((Action callback, string placeHolder, string defaultText))param; - - OnCommit = t.callback; - (m_input.placeholder as Text).text = t.placeHolder; - m_input.text = t.defaultText; - } - - protected override void Update() - { - base.Update(); - - IsInputing = m_input.isFocused; - - if (IsInputing && Input.GetButtonDown("Submit")) - { - OnCmdEnter(); - } - } - - protected override void OnDisable() - { - base.OnDisable(); - IsInputing = false; - } - - protected override void OnEnable() - { - base.OnEnable(); - - StartCoroutine(ActiveInput()); - } - - private IEnumerator ActiveInput() - { - yield return new WaitForEndOfFrame(); - - m_input.Select(); - m_input.ActivateInputField(); - - yield break; - } - - protected override bool OnCmdEnter() - { - OnCommit?.Invoke(m_input.text); - Close(); - return true; - } - - protected override void OnCmdBack() - { - Close(); - } - } -} +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class InputUI : OverlayUI + { + [SerializeField] + InputField m_input; + + Action OnCommit; + + public static bool IsInputing { get; private set; } + + + + protected override void OnShow(object param) + { + (Action callback, string placeHolder, string defaultText) t = ((Action callback, string placeHolder, string defaultText))param; + + OnCommit = t.callback; + (m_input.placeholder as Text).text = t.placeHolder; + m_input.text = t.defaultText; + } + + protected override void Update() + { + base.Update(); + + IsInputing = m_input.isFocused; + + if (IsInputing && Input.GetButtonDown("Submit")) + { + OnCmdEnter(); + } + } + + protected override void OnDisable() + { + base.OnDisable(); + IsInputing = false; + } + + protected override void OnEnable() + { + base.OnEnable(); + + StartCoroutine(ActiveInput()); + } + + private IEnumerator ActiveInput() + { + yield return new WaitForEndOfFrame(); + + m_input.Select(); + m_input.ActivateInputField(); + + yield break; + } + + protected override bool OnCmdEnter() + { + OnCommit?.Invoke(m_input.text); + Close(); + return true; + } + + protected override void OnCmdBack() + { + Close(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/InputUI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/InputUI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/InputUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs index d1b5b82..21bf7d7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs @@ -1,39 +1,39 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class OverlayManager : MonoBehaviour - { - static OverlayManager s_ins; - - [SerializeField] - InputUI m_InputUI; - [SerializeField] - OptionUI m_OptionUI; - - private void Awake() - { - s_ins = this; - - m_InputUI.gameObject.SetActive(false); - } - - public static InputUI Input(Action callback, string placeHolder, string defaultText) - { - s_ins.m_InputUI.Show((callback, placeHolder, defaultText)); - - return s_ins.m_InputUI; - } - public static void Pop(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu - { - s_ins.m_OptionUI.Pop(menus, defaultIndex, onClose); - } - - public static void PopMsg(string msg) - { - - } - } -} +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class OverlayManager : MonoBehaviour + { + static OverlayManager s_ins; + + [SerializeField] + InputUI m_InputUI; + [SerializeField] + OptionUI m_OptionUI; + + private void Awake() + { + s_ins = this; + + m_InputUI.gameObject.SetActive(false); + } + + public static InputUI Input(Action callback, string placeHolder, string defaultText) + { + s_ins.m_InputUI.Show((callback, placeHolder, defaultText)); + + return s_ins.m_InputUI; + } + public static void Pop(List menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu + { + s_ins.m_OptionUI.Pop(menus, defaultIndex, onClose); + } + + public static void PopMsg(string msg) + { + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayManager.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayUI.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayUI.cs index 957f0d1..8b784d2 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayUI.cs @@ -1,56 +1,56 @@ -using DG.Tweening; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public abstract class OverlayUI : CommandExecuter - { - public override bool AloneMode => true; - public override bool Enable => true; - - public float StartAlpha = 0; - public float StartScale = 1.2f; - public float Duration = 0.5f; - public Ease Ease; - - [SerializeField] - protected Transform m_root; - [SerializeField] - protected CanvasGroup m_cg; - - protected override void OnEnable() - { - base.OnEnable(); - - float progress = 0; - DOTween.To(() => progress, (x) => - { - progress = x; - m_cg.alpha = Mathf.Lerp(StartAlpha, 1, x); - m_root.localScale = Vector3.Lerp(Vector3.one * StartScale, Vector3.one, x); - }, 1, Duration).SetEase(Ease).SetLink(gameObject, LinkBehaviour.KillOnDisable); - - CommandDispatcher.Instance.RegistController(this); - } - - protected override void OnDisable() - { - base.OnDisable(); - - CommandDispatcher.Instance.UnRegistController(this); - } - - public void Show(object param) - { - gameObject.SetActive(true); - OnShow(param); - } - public void Close() - { - OnClose(); - gameObject.SetActive(false); - } - protected abstract void OnShow(object param); - protected virtual void OnClose() { } - } -} +using DG.Tweening; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public abstract class OverlayUI : CommandExecuter + { + public override bool AloneMode => true; + public override bool Enable => true; + + public float StartAlpha = 0; + public float StartScale = 1.2f; + public float Duration = 0.5f; + public Ease Ease; + + [SerializeField] + protected Transform m_root; + [SerializeField] + protected CanvasGroup m_cg; + + protected override void OnEnable() + { + base.OnEnable(); + + float progress = 0; + DOTween.To(() => progress, (x) => + { + progress = x; + m_cg.alpha = Mathf.Lerp(StartAlpha, 1, x); + m_root.localScale = Vector3.Lerp(Vector3.one * StartScale, Vector3.one, x); + }, 1, Duration).SetEase(Ease).SetLink(gameObject, LinkBehaviour.KillOnDisable); + + CommandDispatcher.Instance.RegistController(this); + } + + protected override void OnDisable() + { + base.OnDisable(); + + CommandDispatcher.Instance.UnRegistController(this); + } + + public void Show(object param) + { + gameObject.SetActive(true); + OnShow(param); + } + public void Close() + { + OnClose(); + gameObject.SetActive(false); + } + protected abstract void OnShow(object param); + protected virtual void OnClose() { } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayUI.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/OverlayUI/OverlayUI.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayUI.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/PulseInvoker.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/PulseInvoker.cs similarity index 95% rename from AxibugEmuOnline.Client/Assets/Script/UI/PulseInvoker.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/PulseInvoker.cs index 20fc46f..7020991 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/PulseInvoker.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/PulseInvoker.cs @@ -1,59 +1,59 @@ -namespace AxibugEmuOnline.Client.UI -{ - using System; - - public class PulseInvoker - { - private Action _action; - private float _interval; - private float _delay; - private float _elapsedTime; - private bool _isActive; - private bool _isDelayed; - - public PulseInvoker(Action action, float delay, float interval) - { - _action = action; - - _delay = delay; - _interval = interval; - } - - public void SetActive() - { - _elapsedTime = 0f; - _isActive = true; - _isDelayed = true; - } - - public void DisActive() - { - _isActive = false; - } - - public void Update(float deltaTime) - { - if (!_isActive) return; - - _elapsedTime += deltaTime; - - if (_isDelayed) - { - if (_elapsedTime >= _delay) - { - _elapsedTime -= _delay; - _isDelayed = false; - _action?.Invoke(); - } - } - else - { - if (_elapsedTime >= _interval) - { - _elapsedTime -= _interval; - _action?.Invoke(); - } - } - } - } -} +namespace AxibugEmuOnline.Client.UI +{ + using System; + + public class PulseInvoker + { + private Action _action; + private float _interval; + private float _delay; + private float _elapsedTime; + private bool _isActive; + private bool _isDelayed; + + public PulseInvoker(Action action, float delay, float interval) + { + _action = action; + + _delay = delay; + _interval = interval; + } + + public void SetActive() + { + _elapsedTime = 0f; + _isActive = true; + _isDelayed = true; + } + + public void DisActive() + { + _isActive = false; + } + + public void Update(float deltaTime) + { + if (!_isActive) return; + + _elapsedTime += deltaTime; + + if (_isDelayed) + { + if (_elapsedTime >= _delay) + { + _elapsedTime -= _delay; + _isDelayed = false; + _action?.Invoke(); + } + } + else + { + if (_elapsedTime >= _interval) + { + _elapsedTime -= _interval; + _action?.Invoke(); + } + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/PulseInvoker.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/PulseInvoker.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/PulseInvoker.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/PulseInvoker.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/RoomUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs index 06d6dd0..25919e4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs @@ -1,142 +1,142 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Event; -using AxibugEmuOnline.Client.Manager; -using AxibugEmuOnline.Client.UI; -using AxibugProtobuf; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class RoomItem : MenuItem, IVirtualItem - { - [SerializeField] - Image m_roomPreview; - [SerializeField] - Slider m_downloadProgress; - [SerializeField] - GameObject m_downloadingFlag; - [SerializeField] - GameObject m_romReadyFlag; - - private RomFile m_romFile; - - public int Index { get; set; } - public int roomID { get; private set; } - - protected override void Awake() - { - base.Awake(); - - Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleUpdate, OnRoomSignelUpdate); - } - - private void OnRoomSignelUpdate(int roomID) - { - if (this.roomID != roomID) return; - - if (App.roomMgr.GetRoomListMiniInfo(roomID, out var roomInfo)) - UpdateUI(roomInfo); - } - - public void SetData(object data) - { - var roomInfo = data as Protobuf_Room_MiniInfo; - roomID = roomInfo.RoomID; - - UpdateUI(roomInfo); - } - - public override bool OnEnterItem() - { - if (m_romFile == null) return false; - - if (!m_romFile.RomReady) - { - m_romFile.BeginDownload(); - return false; - } - else - { - if (!App.roomMgr.GetRoomListMiniInfo(roomID, out Protobuf_Room_MiniInfo MiniInfo)) - { - OverlayManager.PopMsg("䲻"); - return false; - } - - int[] freeSlots = null; - if (!MiniInfo.GetFreeSlot(out freeSlots)) - { - OverlayManager.PopMsg("޿λ"); - return false; - } - - App.roomMgr.SendJoinRoom(roomID, freeSlots[0]); - return true; - } - } - - private void UpdateUI(Protobuf_Room_MiniInfo roomInfo) - { - var hostNick = roomInfo.GetHostNickName(); - roomInfo.GetRoomPlayers(out var cur, out var max); - SetBaseInfo("--", $"{hostNick}ķ", $"{cur}/{max}"); - SetIcon(null); - - roomInfo.FetchRomFileInRoomInfo(EnumPlatform.NES, (room, romFile) => - { - if (room.RoomID != roomID) return; - - m_romFile = romFile; - Txt.text = romFile.Alias; - - UpdateRomInfoView(); - App.CacheMgr.GetSpriteCache(romFile.ImageURL, OnGetRomImage); - }); - } - - protected override void Update() - { - UpdateRomInfoView(); - base.Update(); - } - - private void UpdateRomInfoView() - { - float? downloadingProgress = null; - bool romReady = false; - - if (m_romFile != null) - { - if (m_romFile.IsDownloading) - downloadingProgress = m_romFile.Progress; - if (m_romFile.RomReady) - romReady = true; - } - - m_downloadingFlag.SetActiveEx(downloadingProgress.HasValue); - if (downloadingProgress.HasValue) - m_downloadProgress.value = downloadingProgress.Value; - - m_romReadyFlag.SetActiveEx(romReady); - } - - private void OnGetRomImage(Sprite sprite, string url) - { - if (m_romFile == null) return; - if (m_romFile.ImageURL != url) return; - - SetIcon(sprite); - } - - public void SetDependencyProperty(object data) - { - SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); - } - - public void Release() - { - Reset(); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Event; +using AxibugEmuOnline.Client.Manager; +using AxibugEmuOnline.Client.UI; +using AxibugProtobuf; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class RoomItem : MenuItem, IVirtualItem + { + [SerializeField] + Image m_roomPreview; + [SerializeField] + Slider m_downloadProgress; + [SerializeField] + GameObject m_downloadingFlag; + [SerializeField] + GameObject m_romReadyFlag; + + private RomFile m_romFile; + + public int Index { get; set; } + public int roomID { get; private set; } + + protected override void Awake() + { + base.Awake(); + + Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleUpdate, OnRoomSignelUpdate); + } + + private void OnRoomSignelUpdate(int roomID) + { + if (this.roomID != roomID) return; + + if (App.roomMgr.GetRoomListMiniInfo(roomID, out var roomInfo)) + UpdateUI(roomInfo); + } + + public void SetData(object data) + { + var roomInfo = data as Protobuf_Room_MiniInfo; + roomID = roomInfo.RoomID; + + UpdateUI(roomInfo); + } + + public override bool OnEnterItem() + { + if (m_romFile == null) return false; + + if (!m_romFile.RomReady) + { + m_romFile.BeginDownload(); + return false; + } + else + { + if (!App.roomMgr.GetRoomListMiniInfo(roomID, out Protobuf_Room_MiniInfo MiniInfo)) + { + OverlayManager.PopMsg("䲻"); + return false; + } + + int[] freeSlots = null; + if (!MiniInfo.GetFreeSlot(out freeSlots)) + { + OverlayManager.PopMsg("޿λ"); + return false; + } + + App.roomMgr.SendJoinRoom(roomID, freeSlots[0]); + return true; + } + } + + private void UpdateUI(Protobuf_Room_MiniInfo roomInfo) + { + var hostNick = roomInfo.GetHostNickName(); + roomInfo.GetRoomPlayers(out var cur, out var max); + SetBaseInfo("--", $"{hostNick}ķ", $"{cur}/{max}"); + SetIcon(null); + + roomInfo.FetchRomFileInRoomInfo(EnumPlatform.NES, (room, romFile) => + { + if (room.RoomID != roomID) return; + + m_romFile = romFile; + Txt.text = romFile.Alias; + + UpdateRomInfoView(); + App.CacheMgr.GetSpriteCache(romFile.ImageURL, OnGetRomImage); + }); + } + + protected override void Update() + { + UpdateRomInfoView(); + base.Update(); + } + + private void UpdateRomInfoView() + { + float? downloadingProgress = null; + bool romReady = false; + + if (m_romFile != null) + { + if (m_romFile.IsDownloading) + downloadingProgress = m_romFile.Progress; + if (m_romFile.RomReady) + romReady = true; + } + + m_downloadingFlag.SetActiveEx(downloadingProgress.HasValue); + if (downloadingProgress.HasValue) + m_downloadProgress.value = downloadingProgress.Value; + + m_romReadyFlag.SetActiveEx(romReady); + } + + private void OnGetRomImage(Sprite sprite, string url) + { + if (m_romFile == null) return; + if (m_romFile.ImageURL != url) return; + + SetIcon(sprite); + } + + public void SetDependencyProperty(object data) + { + SetSelectState(data is ThirdMenuRoot tr && tr.SelectIndex == Index); + } + + public void Release() + { + Reset(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomListMenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomListMenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomListMenuItem.cs index 1e85ed3..2c0a873 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomListMenuItem.cs @@ -1,71 +1,71 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugEmuOnline.Client.Event; -using System; - -namespace AxibugEmuOnline.Client -{ - public class RoomListMenuItem : VirtualSubMenuItem - { - bool m_entering; - - protected override void Awake() - { - Eventer.Instance.RegisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); - Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleClose, OnRoomClosed); - Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleAdd, OnRoomSingleAdd); - base.Awake(); - } - - - protected override void OnDestroy() - { - Eventer.Instance.UnregisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); - Eventer.Instance.UnregisterEvent(EEvent.OnRoomListSingleUpdate, OnRoomSingleAdd); - Eventer.Instance.UnregisterEvent(EEvent.OnRoomListSingleClose, OnRoomClosed); - } - - public override bool OnEnterItem() - { - var res = base.OnEnterItem(); - if (res) m_entering = true; - return res; - } - - public override bool OnExitItem() - { - var res = base.OnExitItem(); - if (res) m_entering = false; - return res; - } - - private void OnRoomSingleAdd(int obj) - { - if (m_entering) - { - RefreshUI(); - } - } - - private void OnRoomListUpdateAll() - { - if (m_entering) - { - RefreshUI(); - } - } - private void OnRoomClosed(int obj) - { - if (m_entering) - { - RefreshUI(); - } - } - - protected override void GetVirtualListDatas(Action datas) - { - var roomList = App.roomMgr.GetRoomList(); - datas.Invoke(roomList); - } - - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugEmuOnline.Client.Event; +using System; + +namespace AxibugEmuOnline.Client +{ + public class RoomListMenuItem : VirtualSubMenuItem + { + bool m_entering; + + protected override void Awake() + { + Eventer.Instance.RegisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); + Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleClose, OnRoomClosed); + Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleAdd, OnRoomSingleAdd); + base.Awake(); + } + + + protected override void OnDestroy() + { + Eventer.Instance.UnregisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll); + Eventer.Instance.UnregisterEvent(EEvent.OnRoomListSingleUpdate, OnRoomSingleAdd); + Eventer.Instance.UnregisterEvent(EEvent.OnRoomListSingleClose, OnRoomClosed); + } + + public override bool OnEnterItem() + { + var res = base.OnEnterItem(); + if (res) m_entering = true; + return res; + } + + public override bool OnExitItem() + { + var res = base.OnExitItem(); + if (res) m_entering = false; + return res; + } + + private void OnRoomSingleAdd(int obj) + { + if (m_entering) + { + RefreshUI(); + } + } + + private void OnRoomListUpdateAll() + { + if (m_entering) + { + RefreshUI(); + } + } + private void OnRoomClosed(int obj) + { + if (m_entering) + { + RefreshUI(); + } + } + + protected override void GetVirtualListDatas(Action datas) + { + var roomList = App.roomMgr.GetRoomList(); + datas.Invoke(roomList); + } + + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomListMenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomListMenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/RoomUI/RoomListMenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomListMenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/Selector.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Selector.cs similarity index 87% rename from AxibugEmuOnline.Client/Assets/Script/UI/Selector.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Selector.cs index a982a08..2fbe407 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/Selector.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Selector.cs @@ -1,73 +1,81 @@ -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class Selector : MonoBehaviour - { - [SerializeField] - private Animator animator; - private RectTransform m_rect => transform as RectTransform; - - private RectTransform m_target; - private TweenerCore m_trackTween; - - public RectTransform Target - { - get => m_target; - set - { - if (m_target == value) return; - - m_target = value; - - var itemUIRect = m_target.transform as RectTransform; - m_rect.pivot = itemUIRect.pivot; - m_rect.sizeDelta = itemUIRect.rect.size; - m_rect.SetAsLastSibling(); - - animator.SetTrigger("reactive"); - - if (m_trackTween != null) - { - m_trackTween.Kill(); - m_trackTween = null; - } - m_trackTween = DOTween.To(() => m_rect.position, (value) => m_rect.position = value, itemUIRect.position, 0.125f); - m_trackTween.onComplete = () => m_trackTween = null; - } - } - - private bool m_active; - public bool Active - { - get => m_active; - set - { - if (m_active == value) return; - m_active = value; - - animator.SetBool("active", value); - } - } - - public void RefreshPosition() - { - if (Target != null) - { - m_rect.position = Target.position; - } - } - - private void LateUpdate() - { - if (m_trackTween != null && m_trackTween.endValue != Target.position) - { - m_trackTween.ChangeEndValue(Target.position, true); - } - if (Target == null) return; - } - } -} +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class Selector : MonoBehaviour + { + [SerializeField] + private Animator animator; + private RectTransform m_rect => transform as RectTransform; + + private RectTransform m_target; + private TweenerCore m_trackTween; + + public RectTransform Target + { + get => m_target; + set + { + if (m_target == value) return; + + m_target = value; + if (m_target == null) + { + if (m_trackTween != null) + { + m_trackTween.Kill(); + m_trackTween = null; + } + return; + } + + var itemUIRect = m_target.transform as RectTransform; + m_rect.pivot = itemUIRect.pivot; + m_rect.sizeDelta = itemUIRect.rect.size; + m_rect.SetAsLastSibling(); + + animator.SetTrigger("reactive"); + + if (m_trackTween != null) + { + m_trackTween.Kill(); + m_trackTween = null; + } + m_trackTween = DOTween.To(() => m_rect.position, (value) => m_rect.position = value, itemUIRect.position, 0.125f); + m_trackTween.onComplete = () => m_trackTween = null; + } + } + + private bool m_active; + public bool Active + { + get => m_active; + set + { + if (m_active == value) return; + m_active = value; + + animator.SetBool("active", value); + } + } + + public void RefreshPosition() + { + if (Target != null) + { + m_rect.position = Target.position; + } + } + + private void LateUpdate() + { + if (m_trackTween != null && m_trackTween.endValue != Target.position) + { + m_trackTween.ChangeEndValue(Target.position, true); + } + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/Selector.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Selector.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/Selector.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Selector.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/SubMenuItemGroup.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/SubMenuItemGroup.cs index 85dfe70..d749d4c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/SubMenuItemGroup.cs @@ -1,204 +1,204 @@ -using AxibugEmuOnline.Client.UI; -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class SubMenuItemGroup : MenuItemController - { - [SerializeField] - MenuItem SubMenuItemTemplate; - [SerializeField] - CanvasGroup alphaGroup; - private TweenerCore selectTween; - - private bool m_selected; - - private TweenerCore rollTween; - - - protected override void Awake() - { - m_selected = false; - if (alphaGroup != null) alphaGroup.alpha = 0; - - base.Awake(); - } - - public override void Init(List menuDataList) - { -#if UNITY_EDITOR - while (transform.childCount > 0) - { - DestroyImmediate(transform.GetChild(0).gameObject); - } -#else - for (int i = 0; i < transform.childCount; i++) - { - Destroy(transform.GetChild(i).gameObject); - } -#endif - - m_runtimeMenuUI.Clear(); - foreach (MenuData menuData in menuDataList) - { - var template = menuData.OverrideTemplate != null ? menuData.OverrideTemplate : SubMenuItemTemplate; - - var item = Clone(template, transform); - item.SetData(menuData); - m_runtimeMenuUI.Add(item); - } - - calcItemPosition(); - - for (var i = 0; i < m_runtimeMenuUI.Count; i++) - { - var item = m_runtimeMenuUI[i]; - var needPos = m_itemUIPosition[i]; - item.Rect.anchoredPosition = needPos; - } - } - - protected override bool OnCmdEnter() - { - base.OnCmdEnter(); - - LaunchUI.Instance.ToDetailMenuLayout(); - var item = GetItemUIByIndex(SelectIndex); - item.SetSelectState(false); - - return true; - } - - protected override void OnCmdBack() - { - base.OnCmdBack(); - - LaunchUI.Instance.ToMainMenuLayout(); - var item = GetItemUIByIndex(SelectIndex); - item.SetSelectState(true); - } - - protected override void OnCmdSelectItemUp() - { - if (m_enteredItem == null) - SelectIndex--; - } - - protected override void OnCmdSelectItemDown() - { - if (m_enteredItem == null) - SelectIndex++; - } - - public virtual void SetSelect(bool select) - { - if (m_selected == select) return; - m_selected = select; - - if (selectTween != null) - { - selectTween.Kill(); - selectTween = null; - } - - if (select) - { - selectTween = DOTween.To(() => alphaGroup.alpha, (x) => alphaGroup.alpha = x, 1, 10).SetSpeedBased(); - } - else - { - selectTween = DOTween.To(() => alphaGroup.alpha, (x) => alphaGroup.alpha = x, 0, 10).SetSpeedBased(); - } - - ListenControlAction = m_selected; - } - - protected override void OnCmdSelectItemLeft() - { - base.OnCmdSelectItemLeft(); - - OnCmdBack(); - } - - protected override void OnSelectMenuChanged() - { - if (rollTween != null) { rollTween.Kill(); rollTween = null; } - - float duration = 0.5f; - - calcItemPosition(); - - for (var i = 0; i < m_runtimeMenuUI.Count; i++) - { - var item = m_runtimeMenuUI[i]; - bool isSelectItem = i == SelectIndex; - item.SetSelectState(isSelectItem); - } - - rollTween = DOTween.To(() => 1, (x) => { }, 1, duration).OnUpdate(() => - { - var tweenProgress = rollTween.position / rollTween.Duration(); - for (var i = 0; i < m_runtimeMenuUI.Count; i++) - { - var item = m_runtimeMenuUI[i]; - var needPos = m_itemUIPosition[i]; - item.Rect.anchoredPosition = Vector2.Lerp(item.Rect.anchoredPosition, needPos, tweenProgress); - } - }).OnComplete(() => - { - for (var i = 0; i < m_runtimeMenuUI.Count; i++) - { - var item = m_runtimeMenuUI[i]; - var needPos = m_itemUIPosition[i]; - item.Rect.anchoredPosition = needPos; - } - }); - } - - [SerializeField] - Vector2 m_selectItemPosition = new Vector2(50, -51); - [SerializeField] - float step = 50f; - [SerializeField] - float splitStep = 200f; - - List m_itemUIPosition = new List(); - private void calcItemPosition() - { - m_itemUIPosition.Clear(); - for (int i = 0; i < m_runtimeMenuUI.Count; i++) - { - var gap = SelectIndex - i; - var start = m_selectItemPosition; - start.y += step * gap; - if (i < SelectIndex) start.y += splitStep; - - m_itemUIPosition.Add(start); - } - } - - private MenuItem Clone(MenuItem template, Transform parent) - { -#if UNITY_EDITOR - if (Application.isPlaying) - { - var item = GameObject.Instantiate(template.gameObject, parent).GetComponent(); - item.transform.localPosition = Vector3.zero; - return item; - } - else - { - var clone = UnityEditor.PrefabUtility.InstantiatePrefab(template.gameObject, parent) as GameObject; - clone.transform.localPosition = Vector3.zero; - return clone.GetComponent(); - } -#else - return GameObject.Instantiate(SubMenuItemTemplate.gameObject, parent).GetComponent(); -#endif - } - } -} +using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class SubMenuItemGroup : MenuItemController + { + [SerializeField] + MenuItem SubMenuItemTemplate; + [SerializeField] + CanvasGroup alphaGroup; + private TweenerCore selectTween; + + private bool m_selected; + + private TweenerCore rollTween; + + + protected override void Awake() + { + m_selected = false; + if (alphaGroup != null) alphaGroup.alpha = 0; + + base.Awake(); + } + + public override void Init(List menuDataList) + { +#if UNITY_EDITOR + while (transform.childCount > 0) + { + DestroyImmediate(transform.GetChild(0).gameObject); + } +#else + for (int i = 0; i < transform.childCount; i++) + { + Destroy(transform.GetChild(i).gameObject); + } +#endif + + m_runtimeMenuUI.Clear(); + foreach (MenuData menuData in menuDataList) + { + var template = menuData.OverrideTemplate != null ? menuData.OverrideTemplate : SubMenuItemTemplate; + + var item = Clone(template, transform); + item.SetData(menuData); + m_runtimeMenuUI.Add(item); + } + + calcItemPosition(); + + for (var i = 0; i < m_runtimeMenuUI.Count; i++) + { + var item = m_runtimeMenuUI[i]; + var needPos = m_itemUIPosition[i]; + item.Rect.anchoredPosition = needPos; + } + } + + protected override bool OnCmdEnter() + { + base.OnCmdEnter(); + + LaunchUI.Instance.ToDetailMenuLayout(); + var item = GetItemUIByIndex(SelectIndex); + item.SetSelectState(false); + + return true; + } + + protected override void OnCmdBack() + { + base.OnCmdBack(); + + LaunchUI.Instance.ToMainMenuLayout(); + var item = GetItemUIByIndex(SelectIndex); + item.SetSelectState(true); + } + + protected override void OnCmdSelectItemUp() + { + if (m_enteredItem == null) + SelectIndex--; + } + + protected override void OnCmdSelectItemDown() + { + if (m_enteredItem == null) + SelectIndex++; + } + + public virtual void SetSelect(bool select) + { + if (m_selected == select) return; + m_selected = select; + + if (selectTween != null) + { + selectTween.Kill(); + selectTween = null; + } + + if (select) + { + selectTween = DOTween.To(() => alphaGroup.alpha, (x) => alphaGroup.alpha = x, 1, 10).SetSpeedBased(); + } + else + { + selectTween = DOTween.To(() => alphaGroup.alpha, (x) => alphaGroup.alpha = x, 0, 10).SetSpeedBased(); + } + + ListenControlAction = m_selected; + } + + protected override void OnCmdSelectItemLeft() + { + base.OnCmdSelectItemLeft(); + + OnCmdBack(); + } + + protected override void OnSelectMenuChanged() + { + if (rollTween != null) { rollTween.Kill(); rollTween = null; } + + float duration = 0.5f; + + calcItemPosition(); + + for (var i = 0; i < m_runtimeMenuUI.Count; i++) + { + var item = m_runtimeMenuUI[i]; + bool isSelectItem = i == SelectIndex; + item.SetSelectState(isSelectItem); + } + + rollTween = DOTween.To(() => 1, (x) => { }, 1, duration).OnUpdate(() => + { + var tweenProgress = rollTween.position / rollTween.Duration(); + for (var i = 0; i < m_runtimeMenuUI.Count; i++) + { + var item = m_runtimeMenuUI[i]; + var needPos = m_itemUIPosition[i]; + item.Rect.anchoredPosition = Vector2.Lerp(item.Rect.anchoredPosition, needPos, tweenProgress); + } + }).OnComplete(() => + { + for (var i = 0; i < m_runtimeMenuUI.Count; i++) + { + var item = m_runtimeMenuUI[i]; + var needPos = m_itemUIPosition[i]; + item.Rect.anchoredPosition = needPos; + } + }); + } + + [SerializeField] + Vector2 m_selectItemPosition = new Vector2(50, -51); + [SerializeField] + float step = 50f; + [SerializeField] + float splitStep = 200f; + + List m_itemUIPosition = new List(); + private void calcItemPosition() + { + m_itemUIPosition.Clear(); + for (int i = 0; i < m_runtimeMenuUI.Count; i++) + { + var gap = SelectIndex - i; + var start = m_selectItemPosition; + start.y += step * gap; + if (i < SelectIndex) start.y += splitStep; + + m_itemUIPosition.Add(start); + } + } + + private MenuItem Clone(MenuItem template, Transform parent) + { +#if UNITY_EDITOR + if (Application.isPlaying) + { + var item = GameObject.Instantiate(template.gameObject, parent).GetComponent(); + item.transform.localPosition = Vector3.zero; + return item; + } + else + { + var clone = UnityEditor.PrefabUtility.InstantiatePrefab(template.gameObject, parent) as GameObject; + clone.transform.localPosition = Vector3.zero; + return clone.GetComponent(); + } +#else + return GameObject.Instantiate(SubMenuItemTemplate.gameObject, parent).GetComponent(); +#endif + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/SubMenuItemGroup.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/SubMenuItemGroup.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ThirdMenuRoot.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ThirdMenuRoot.cs index 9d06be3..de6a8d6 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ThirdMenuRoot.cs @@ -1,158 +1,158 @@ -using AxibugEmuOnline.Client.UI; -using DG.Tweening; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class ThirdMenuRoot : SubMenuItemGroup - { - private RectTransform m_rect; - private RectTransform m_parent; - - [SerializeField] - private RectTransform m_selectArrow; - [SerializeField] - float ArrowOffset = 50; - [SerializeField] - float WidthFix = 50; - [SerializeField] - public ItemPresent itemGroup; - [SerializeField] - ScrollRect srollRect; - - public override int SelectIndex - { - get => m_selectIndex; - set - { - if (itemGroup.DataList == null) return; - - value = Mathf.Clamp(value, 0, itemGroup.DataList.Count - 1); - if (m_selectIndex == value) return; - bool useAnim = m_selectIndex != -1; - m_selectIndex = value; - - RollToIndex(m_selectIndex, useAnim); - OnSelectMenuChanged(); - } - } - - public void ResetToFirst() - { - m_selectIndex = -1; - SelectIndex = 0; - } - - protected override MenuItem GetItemUIByIndex(int index) - { - return itemGroup.GetItemUIByDataIndex(index)?.GetComponent(); - } - - protected override void Awake() - { - m_rect = transform as RectTransform; - m_parent = transform.parent as RectTransform; - - base.Awake(); - } - - public override void Init(List menuDataList) { } - - protected override bool OnCmdEnter() - { - var item = GetItemUIByIndex(SelectIndex); - if (item != null) - return item.OnEnterItem(); - else - return true; - } - - protected override void OnCmdBack() - { - var item = GetItemUIByIndex(SelectIndex); - item?.OnExitItem(); - } - - private void LateUpdate() - { - SyncRectToLaunchUI(); - } - - protected override void OnSelectMenuChanged() - { - itemGroup.UpdateDependencyProperty(this); - } - - void RollToIndex(int index, bool useAnim = false) - { - SyncRectToLaunchUI(); - Vector2 itemPos = itemGroup.GetItemAnchorePos(index); - - Vector2 targetPos = itemGroup.transform.InverseTransformPoint(m_selectArrow.position); - Vector3[] corners = new Vector3[4]; - itemGroup.RectTransform.GetLocalCorners(corners); - targetPos = targetPos - (Vector2)corners[1]; - - float gap = targetPos.y - itemPos.y; - - srollRect.velocity = Vector2.zero; - if (!useAnim) - srollRect.content.anchoredPosition += new Vector2(0, gap); - else - { - var srcPos = m_selectArrow.position; - var endValue = srollRect.content.anchoredPosition + new Vector2(0, gap); - var tween = DOTween.To( - () => srollRect.content.anchoredPosition, - (x) => srollRect.content.anchoredPosition = x, - endValue, 0.125f); - } - } - - Vector3[] corner = new Vector3[4]; - private void SyncRectToLaunchUI() - { - if (LaunchUI.Instance == null) return; - var launchUIRect = LaunchUI.Instance.transform as RectTransform; - - m_rect.pivot = new Vector2(1, 0.5f); - m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, launchUIRect.rect.width); - m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, launchUIRect.rect.height); - m_rect.position = launchUIRect.position; - var temp = m_rect.localPosition; - var offsetX = (m_rect.pivot.x - 0.5f) * m_rect.rect.size.x; - temp.x += offsetX; - var offsetY = (m_rect.pivot.y - 0.5f) * m_rect.rect.size.y; - temp.y += offsetY; - m_rect.localPosition = temp; - m_rect.localScale = launchUIRect.localScale; - - m_parent.GetWorldCorners(corner); - var parentPosition = corner[0]; - parentPosition = launchUIRect.InverseTransformPoint(parentPosition); - launchUIRect.GetWorldCorners(corner); - var rootPosition = corner[0]; - rootPosition = launchUIRect.InverseTransformPoint(rootPosition); - - var widthGap = parentPosition.x - rootPosition.x; - m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, launchUIRect.rect.width - widthGap - WidthFix); - - m_selectArrow.position = m_parent.transform.position; - temp = m_selectArrow.anchoredPosition; - temp.x += ArrowOffset; - m_selectArrow.anchoredPosition = temp; - } - - protected override void OnCmdSelectItemDown() - { - base.OnCmdSelectItemDown(); - } - - protected override void OnCmdSelectItemUp() - { - base.OnCmdSelectItemUp(); - } - } -} +using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class ThirdMenuRoot : SubMenuItemGroup + { + private RectTransform m_rect; + private RectTransform m_parent; + + [SerializeField] + private RectTransform m_selectArrow; + [SerializeField] + float ArrowOffset = 50; + [SerializeField] + float WidthFix = 50; + [SerializeField] + public ItemPresent itemGroup; + [SerializeField] + ScrollRect srollRect; + + public override int SelectIndex + { + get => m_selectIndex; + set + { + if (itemGroup.DataList == null) return; + + value = Mathf.Clamp(value, 0, itemGroup.DataList.Count - 1); + if (m_selectIndex == value) return; + bool useAnim = m_selectIndex != -1; + m_selectIndex = value; + + RollToIndex(m_selectIndex, useAnim); + OnSelectMenuChanged(); + } + } + + public void ResetToFirst() + { + m_selectIndex = -1; + SelectIndex = 0; + } + + protected override MenuItem GetItemUIByIndex(int index) + { + return itemGroup.GetItemUIByDataIndex(index)?.GetComponent(); + } + + protected override void Awake() + { + m_rect = transform as RectTransform; + m_parent = transform.parent as RectTransform; + + base.Awake(); + } + + public override void Init(List menuDataList) { } + + protected override bool OnCmdEnter() + { + var item = GetItemUIByIndex(SelectIndex); + if (item != null) + return item.OnEnterItem(); + else + return true; + } + + protected override void OnCmdBack() + { + var item = GetItemUIByIndex(SelectIndex); + item?.OnExitItem(); + } + + private void LateUpdate() + { + SyncRectToLaunchUI(); + } + + protected override void OnSelectMenuChanged() + { + itemGroup.UpdateDependencyProperty(this); + } + + void RollToIndex(int index, bool useAnim = false) + { + SyncRectToLaunchUI(); + Vector2 itemPos = itemGroup.GetItemAnchorePos(index); + + Vector2 targetPos = itemGroup.transform.InverseTransformPoint(m_selectArrow.position); + Vector3[] corners = new Vector3[4]; + itemGroup.RectTransform.GetLocalCorners(corners); + targetPos = targetPos - (Vector2)corners[1]; + + float gap = targetPos.y - itemPos.y; + + srollRect.velocity = Vector2.zero; + if (!useAnim) + srollRect.content.anchoredPosition += new Vector2(0, gap); + else + { + var srcPos = m_selectArrow.position; + var endValue = srollRect.content.anchoredPosition + new Vector2(0, gap); + var tween = DOTween.To( + () => srollRect.content.anchoredPosition, + (x) => srollRect.content.anchoredPosition = x, + endValue, 0.125f); + } + } + + Vector3[] corner = new Vector3[4]; + private void SyncRectToLaunchUI() + { + if (LaunchUI.Instance == null) return; + var launchUIRect = LaunchUI.Instance.transform as RectTransform; + + m_rect.pivot = new Vector2(1, 0.5f); + m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, launchUIRect.rect.width); + m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, launchUIRect.rect.height); + m_rect.position = launchUIRect.position; + var temp = m_rect.localPosition; + var offsetX = (m_rect.pivot.x - 0.5f) * m_rect.rect.size.x; + temp.x += offsetX; + var offsetY = (m_rect.pivot.y - 0.5f) * m_rect.rect.size.y; + temp.y += offsetY; + m_rect.localPosition = temp; + m_rect.localScale = launchUIRect.localScale; + + m_parent.GetWorldCorners(corner); + var parentPosition = corner[0]; + parentPosition = launchUIRect.InverseTransformPoint(parentPosition); + launchUIRect.GetWorldCorners(corner); + var rootPosition = corner[0]; + rootPosition = launchUIRect.InverseTransformPoint(rootPosition); + + var widthGap = parentPosition.x - rootPosition.x; + m_rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, launchUIRect.rect.width - widthGap - WidthFix); + + m_selectArrow.position = m_parent.transform.position; + temp = m_selectArrow.anchoredPosition; + temp.x += ArrowOffset; + m_selectArrow.anchoredPosition = temp; + } + + protected override void OnCmdSelectItemDown() + { + base.OnCmdSelectItemDown(); + } + + protected override void OnCmdSelectItemUp() + { + base.OnCmdSelectItemUp(); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ThirdMenuRoot.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/ThirdMenuRoot.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/UITool.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/UITool.cs index fbeae12..483cd02 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/UITool.cs @@ -1,37 +1,37 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public static class UITool - { - private static Dictionary _caches = new Dictionary(); - public static Material GetMaterial(this Graphic graphic) - { - if (_caches.TryGetValue(graphic, out var material)) - { - return material; - } - else - { - var cloneMat = Material.Instantiate(graphic.material); - _caches[graphic] = cloneMat; - graphic.material = cloneMat; - return cloneMat; - } - } - public static void SetMaterial(this Graphic graphic, Material material) - { - graphic.material = material; - _caches.Remove(graphic); - } - - public static void SetAlpha(this Graphic graphic, float alpha) - { - var temp = graphic.color; - temp.a = alpha; - graphic.color = temp; - } - } -} +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public static class UITool + { + private static Dictionary _caches = new Dictionary(); + public static Material GetMaterial(this Graphic graphic) + { + if (_caches.TryGetValue(graphic, out var material)) + { + return material; + } + else + { + var cloneMat = Material.Instantiate(graphic.material); + _caches[graphic] = cloneMat; + graphic.material = cloneMat; + return cloneMat; + } + } + public static void SetMaterial(this Graphic graphic, Material material) + { + graphic.material = material; + _caches.Remove(graphic); + } + + public static void SetAlpha(this Graphic graphic, float alpha) + { + var temp = graphic.color; + temp.a = alpha; + graphic.color = temp; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/UITool.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/UITool.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/UITool.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/VirtualSubMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/VirtualSubMenuItem.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/VirtualSubMenuItem.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/VirtualSubMenuItem.cs index 9721a82..32831a4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/VirtualSubMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/VirtualSubMenuItem.cs @@ -1,99 +1,99 @@ -using AxibugEmuOnline.Client.UI; -using DG.Tweening; -using DG.Tweening.Core; -using DG.Tweening.Plugins.Options; -using System; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public abstract class VirtualSubMenuItem : MenuItem - { - [SerializeField] - protected CanvasGroup RomGroupRoot; - - - private TweenerCore m_showTween; - - protected override void Awake() - { - base.Awake(); - - RomGroupRoot.gameObject.SetActive(false); - RomGroupRoot.alpha = 0; - } - - public override void SetSelectState(bool selected) - { - if (m_select == selected) return; - - m_select = selected; - - if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(selected); - - if (progressTween != null) { progressTween.Kill(); progressTween = null; } - - progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 5) - .SetSpeedBased().OnUpdate(() => - { - if (InfoNode != null) InfoNode.alpha = m_progress; - - Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); - }); - } - - public override bool OnEnterItem() - { - RomGroupRoot.gameObject.SetActive(true); - RomGroupRoot.alpha = 0; - - if (m_showTween != null) - { - m_showTween.Kill(); - m_showTween = null; - } - m_showTween = DOTween.To(() => RomGroupRoot.alpha, (x) => RomGroupRoot.alpha = x, 1, 0.2f); - - var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; - thirdMenuGroup.itemGroup.Clear(); - - RefreshUI(); - - if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(true); - - return true; - } - - protected void RefreshUI() - { - GetVirtualListDatas((datas) => - { - var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; - thirdMenuGroup.itemGroup.UpdateDependencyProperty(thirdMenuGroup); - thirdMenuGroup.itemGroup.SetData(datas); - thirdMenuGroup.itemGroup.UpdateProxyVisualState(); - thirdMenuGroup.ResetToFirst(); - }); - } - - protected abstract void GetVirtualListDatas(Action datas); - - public override bool OnExitItem() - { - if (m_showTween != null) - { - m_showTween.Kill(); - m_showTween = null; - } - m_showTween = DOTween.To(() => RomGroupRoot.alpha, (x) => RomGroupRoot.alpha = x, 0, 0.2f) - .OnComplete(() => - { - RomGroupRoot.gameObject.SetActive(false); - }); - - if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(false); - - return true; - } - } -} +using AxibugEmuOnline.Client.UI; +using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using System; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public abstract class VirtualSubMenuItem : MenuItem + { + [SerializeField] + protected CanvasGroup RomGroupRoot; + + + private TweenerCore m_showTween; + + protected override void Awake() + { + base.Awake(); + + RomGroupRoot.gameObject.SetActive(false); + RomGroupRoot.alpha = 0; + } + + public override void SetSelectState(bool selected) + { + if (m_select == selected) return; + + m_select = selected; + + if (ShadowIcon != null) ShadowIcon.gameObject.SetActiveEx(selected); + + if (progressTween != null) { progressTween.Kill(); progressTween = null; } + + progressTween = DOTween.To(() => m_progress, (x) => m_progress = x, m_select ? 1 : 0, 5) + .SetSpeedBased().OnUpdate(() => + { + if (InfoNode != null) InfoNode.alpha = m_progress; + + Root.localScale = Vector3.one * Mathf.Lerp(UnSelectScale, SelectScale, m_progress); + }); + } + + public override bool OnEnterItem() + { + RomGroupRoot.gameObject.SetActive(true); + RomGroupRoot.alpha = 0; + + if (m_showTween != null) + { + m_showTween.Kill(); + m_showTween = null; + } + m_showTween = DOTween.To(() => RomGroupRoot.alpha, (x) => RomGroupRoot.alpha = x, 1, 0.2f); + + var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; + thirdMenuGroup.itemGroup.Clear(); + + RefreshUI(); + + if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(true); + + return true; + } + + protected void RefreshUI() + { + GetVirtualListDatas((datas) => + { + var thirdMenuGroup = SubMenuItemGroup as ThirdMenuRoot; + thirdMenuGroup.itemGroup.UpdateDependencyProperty(thirdMenuGroup); + thirdMenuGroup.itemGroup.SetData(datas); + thirdMenuGroup.itemGroup.UpdateProxyVisualState(); + thirdMenuGroup.ResetToFirst(); + }); + } + + protected abstract void GetVirtualListDatas(Action datas); + + public override bool OnExitItem() + { + if (m_showTween != null) + { + m_showTween.Kill(); + m_showTween = null; + } + m_showTween = DOTween.To(() => RomGroupRoot.alpha, (x) => RomGroupRoot.alpha = x, 0, 0.2f) + .OnComplete(() => + { + RomGroupRoot.gameObject.SetActive(false); + }); + + if (SubMenuItemGroup != null) SubMenuItemGroup.SetSelect(false); + + return true; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/VirtualSubMenuItem.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/VirtualSubMenuItem.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/VirtualSubMenuItem.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/VirtualSubMenuItem.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGround.shader similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGround.shader index cf9a146..3c5de6f 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGround.shader @@ -1,207 +1,207 @@ -Shader "AxibugEmuOnline/XMBBackGround" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - - _StencilComp ("Stencil Comparison", Float) = 8 - _Stencil ("Stencil ID", Float) = 0 - _StencilOp ("Stencil Operation", Float) = 0 - _StencilWriteMask ("Stencil Write Mask", Float) = 255 - _StencilReadMask ("Stencil Read Mask", Float) = 255 - - _ColorMask ("Color Mask", Float) = 15 - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - [Space(10)] - _Color1("Color1",Color) = (0,0.4,1,1) - _Color2("Color2",Color) = (0,0.7,1,1) - - [Header(Wave1)] - _MidHeight1("MidHeight",Float) = 0.4 - _MaxHeight1("MaxHeigh",Float) = 0.5 - _Power1("Power",Float)=50.0 - _Frequency1("Frequency",Float)=2.0 - _Speed1("Speed",Float)=0.4 - - [Header(Wave2)] - _MidHeight2("MidHeight",Float) = 0.42 - _MaxHeight2("MaxHeigh",Float) = 0.54 - _Power2("Power",Float)=50.0 - _Frequency2("Frequency",Float)=2.1 - _Speed2("Speed",Float)=0.3 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Blend SrcAlpha OneMinusSrcAlpha - ColorMask [_ColorMask] - - Pass - { - Name "Default" - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #include "UnityCG.cginc" - #include "UnityUI.cginc" - - #pragma multi_compile_local _ UNITY_UI_CLIP_RECT - #pragma multi_compile_local _ UNITY_UI_ALPHACLIP - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - float4 worldPosition : TEXCOORD1; - float4 mask : TEXCOORD2; - UNITY_VERTEX_OUTPUT_STEREO - }; - - fixed4 _Color; - fixed4 _TextureSampleAdd; - float4 _ClipRect; - sampler2D _MainTex; - float4 _MainTex_ST; - float _UIMaskSoftnessX; - float _UIMaskSoftnessY; - - float wave(float x, float frequency, float speed, float midHeight, float maxHeight) - { - return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight; - } - float percentHigh(float currentY, float waveHeight, float maxHeight, float power) - { - float percentWave = max(waveHeight - currentY, 0.0) / maxHeight; - return pow(1.0 - percentWave, power); - } - float waveColor(float2 uv, float waveHeight, float maxHeight, float frequency, float power) - { - float percentWave = percentHigh(uv.y, waveHeight, maxHeight, power); - return clamp(percentWave + 0.8, 0.0, 1.0); - } - - v2f vert(appdata_t v) - { - v2f OUT; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); - float4 vPosition = UnityObjectToClipPos(v.vertex); - OUT.worldPosition = v.vertex; - OUT.vertex = vPosition; - - float2 pixelSize = vPosition.w; - pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); - - float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); - float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); - OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); - OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); - - OUT.color = v.color * _Color; - return OUT; - } - - float3 _Color1; - float3 _Color2; - - float _MidHeight1; - float _MaxHeight1; - float _Power1; - float _Frequency1; - float _Speed1; - - float _MidHeight2; - float _MaxHeight2; - float _Power2; - float _Frequency2; - float _Speed2; - - fixed4 frag(v2f IN) : SV_Target - { - float2 uv= IN.texcoord; - // Lerped background - - float amount = (uv.x + uv.y) / 2.0; - float3 bg = lerp(_Color2, _Color1, amount); - - // Overlayed sine waves - float maxHeight1 = _MaxHeight1 + wave(0, 4.0,0.02, 0.0, 0.02); - float power1 = _Power1; //Higher power means thinner line - float frequency1 = _Frequency1 + wave(0.0, 3.0, 0.03, 0.0, 0.02); - float speed1 = _Speed1 + wave(0.0, 2.2, 0.04, 0.0, 0.01); - float waveHeight1 = wave(uv.x, frequency1, speed1, _MidHeight1, maxHeight1); - float waveCol1 = waveColor(uv, waveHeight1, maxHeight1, frequency1, power1); - - float midHeight2 = _MidHeight2; - float maxHeight2 = _MaxHeight2 + wave(0.0, 3.0, 0.04, 0.0, 0.02); - float power2 = _Power2; //Higher power means thinner line - float frequency2 = _Frequency2 + wave(0.0, 4.0, 0.05, 0.0, 0.02); - float speed2 = _Speed2 + wave(0.0, 2.0, 0.02, 0.0, 0.01); - float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); - float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); - - float3 col = bg; - - float3 waveCol1_temp=col/waveCol1; - col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); - - float3 waveCol2_temp=col/waveCol2; - col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); - - // Output to screen - fixed4 fragColor = float4(col,1.0)*IN.color; - - #ifdef UNITY_UI_CLIP_RECT - half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); - fragColor.a *= m.x * m.y; - #endif - - #ifdef UNITY_UI_ALPHACLIP - clip (fragColor.a - 0.001); - #endif - - return fragColor; - } - - - - ENDCG - } - } +Shader "AxibugEmuOnline/XMBBackGround" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + + [Space(10)] + _Color1("Color1",Color) = (0,0.4,1,1) + _Color2("Color2",Color) = (0,0.7,1,1) + + [Header(Wave1)] + _MidHeight1("MidHeight",Float) = 0.4 + _MaxHeight1("MaxHeigh",Float) = 0.5 + _Power1("Power",Float)=50.0 + _Frequency1("Frequency",Float)=2.0 + _Speed1("Speed",Float)=0.4 + + [Header(Wave2)] + _MidHeight2("MidHeight",Float) = 0.42 + _MaxHeight2("MaxHeigh",Float) = 0.54 + _Power2("Power",Float)=50.0 + _Frequency2("Frequency",Float)=2.1 + _Speed2("Speed",Float)=0.3 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + sampler2D _MainTex; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + + float wave(float x, float frequency, float speed, float midHeight, float maxHeight) + { + return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight; + } + float percentHigh(float currentY, float waveHeight, float maxHeight, float power) + { + float percentWave = max(waveHeight - currentY, 0.0) / maxHeight; + return pow(1.0 - percentWave, power); + } + float waveColor(float2 uv, float waveHeight, float maxHeight, float frequency, float power) + { + float percentWave = percentHigh(uv.y, waveHeight, maxHeight, power); + return clamp(percentWave + 0.8, 0.0, 1.0); + } + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + OUT.color = v.color * _Color; + return OUT; + } + + float3 _Color1; + float3 _Color2; + + float _MidHeight1; + float _MaxHeight1; + float _Power1; + float _Frequency1; + float _Speed1; + + float _MidHeight2; + float _MaxHeight2; + float _Power2; + float _Frequency2; + float _Speed2; + + fixed4 frag(v2f IN) : SV_Target + { + float2 uv= IN.texcoord; + // Lerped background + + float amount = (uv.x + uv.y) / 2.0; + float3 bg = lerp(_Color2, _Color1, amount); + + // Overlayed sine waves + float maxHeight1 = _MaxHeight1 + wave(0, 4.0,0.02, 0.0, 0.02); + float power1 = _Power1; //Higher power means thinner line + float frequency1 = _Frequency1 + wave(0.0, 3.0, 0.03, 0.0, 0.02); + float speed1 = _Speed1 + wave(0.0, 2.2, 0.04, 0.0, 0.01); + float waveHeight1 = wave(uv.x, frequency1, speed1, _MidHeight1, maxHeight1); + float waveCol1 = waveColor(uv, waveHeight1, maxHeight1, frequency1, power1); + + float midHeight2 = _MidHeight2; + float maxHeight2 = _MaxHeight2 + wave(0.0, 3.0, 0.04, 0.0, 0.02); + float power2 = _Power2; //Higher power means thinner line + float frequency2 = _Frequency2 + wave(0.0, 4.0, 0.05, 0.0, 0.02); + float speed2 = _Speed2 + wave(0.0, 2.0, 0.02, 0.0, 0.01); + float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); + float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); + + float3 col = bg; + + float3 waveCol1_temp=col/waveCol1; + col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); + + float3 waveCol2_temp=col/waveCol2; + col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); + + // Output to screen + fixed4 fragColor = float4(col,1.0)*IN.color; + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + fragColor.a *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (fragColor.a - 0.001); + #endif + + return fragColor; + } + + + + ENDCG + } + } } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGround.shader.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGround.shader.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGround.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGroundPreview.shader similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGroundPreview.shader index 5bd7a18..b428b37 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGroundPreview.shader @@ -1,207 +1,207 @@ -Shader "AxibugEmuOnline/XMBBackGroundPreview" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - _Color ("Tint", Color) = (1,1,1,1) - - _StencilComp ("Stencil Comparison", Float) = 8 - _Stencil ("Stencil ID", Float) = 0 - _StencilOp ("Stencil Operation", Float) = 0 - _StencilWriteMask ("Stencil Write Mask", Float) = 255 - _StencilReadMask ("Stencil Read Mask", Float) = 255 - - _ColorMask ("Color Mask", Float) = 15 - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - [Space(10)] - _Color1("Color1",Color) = (0,0.4,1,1) - _Color2("Color2",Color) = (0,0.7,1,1) - - [Header(Wave1)] - _MidHeight1("MidHeight",Float) = 0.4 - _MaxHeight1("MaxHeigh",Float) = 0.5 - _Power1("Power",Float)=50.0 - _Frequency1("Frequency",Float)=2.0 - _Speed1("Speed",Float)=0.4 - - [Header(Wave2)] - _MidHeight2("MidHeight",Float) = 0.42 - _MaxHeight2("MaxHeigh",Float) = 0.54 - _Power2("Power",Float)=50.0 - _Frequency2("Frequency",Float)=2.1 - _Speed2("Speed",Float)=0.3 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Blend SrcAlpha OneMinusSrcAlpha - ColorMask [_ColorMask] - - Pass - { - Name "Default" - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #include "UnityCG.cginc" - #include "UnityUI.cginc" - - #pragma multi_compile_local _ UNITY_UI_CLIP_RECT - #pragma multi_compile_local _ UNITY_UI_ALPHACLIP - - struct appdata_t - { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - float2 texcoord : TEXCOORD0; - float4 worldPosition : TEXCOORD1; - float4 mask : TEXCOORD2; - UNITY_VERTEX_OUTPUT_STEREO - }; - - fixed4 _Color; - fixed4 _TextureSampleAdd; - float4 _ClipRect; - sampler2D _MainTex; - float4 _MainTex_ST; - float _UIMaskSoftnessX; - float _UIMaskSoftnessY; - - float wave(float x, float frequency, float speed, float midHeight, float maxHeight) - { - return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight; - } - float percentHigh(float currentY, float waveHeight, float maxHeight, float power) - { - float percentWave = max(waveHeight - currentY, 0.0) / maxHeight; - return pow(1.0 - percentWave, power); - } - float waveColor(float2 uv, float waveHeight, float maxHeight, float frequency, float power) - { - float percentWave = percentHigh(uv.y, waveHeight, maxHeight, power); - return clamp(percentWave + 0.8, 0.0, 1.0); - } - - v2f vert(appdata_t v) - { - v2f OUT; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); - float4 vPosition = UnityObjectToClipPos(v.vertex); - OUT.worldPosition = v.vertex; - OUT.vertex = vPosition; - - float2 pixelSize = vPosition.w; - pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); - - float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); - float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); - OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); - OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); - - OUT.color = v.color * _Color; - return OUT; - } - - float3 _Color1; - float3 _Color2; - - float _MidHeight1; - float _MaxHeight1; - float _Power1; - float _Frequency1; - float _Speed1; - - float _MidHeight2; - float _MaxHeight2; - float _Power2; - float _Frequency2; - float _Speed2; - - fixed4 frag(v2f IN) : SV_Target - { - float2 uv= IN.texcoord; - // Lerped background - - float amount = (uv.x + uv.y) / 2.0; - float3 bg = lerp(_Color2, _Color1, amount); - - // Overlayed sine waves - float maxHeight1 = _MaxHeight1 + wave(0, 4.0,0.02, 0.0, 0.02); - float power1 = _Power1; //Higher power means thinner line - float frequency1 = _Frequency1 + wave(0.0, 3.0, 0.03, 0.0, 0.02); - float speed1 = _Speed1 + wave(0.0, 2.2, 0.04, 0.0, 0.01); - float waveHeight1 = wave(uv.x, frequency1, speed1, _MidHeight1, maxHeight1); - float waveCol1 = waveColor(uv, waveHeight1, maxHeight1, frequency1, power1); - - float midHeight2 = _MidHeight2; - float maxHeight2 = _MaxHeight2 + wave(0.0, 3.0, 0.04, 0.0, 0.02); - float power2 = _Power2; //Higher power means thinner line - float frequency2 = _Frequency2 + wave(0.0, 4.0, 0.05, 0.0, 0.02); - float speed2 = _Speed2 + wave(0.0, 2.0, 0.02, 0.0, 0.01); - float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); - float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); - - float3 col = bg; - - float3 waveCol1_temp=col/waveCol1; - col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); - - float3 waveCol2_temp=col/waveCol2; - col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); - - // Output to screen - fixed4 fragColor = float4(col,1.0)*IN.color; - - #ifdef UNITY_UI_CLIP_RECT - half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); - fragColor.a *= m.x * m.y; - #endif - - #ifdef UNITY_UI_ALPHACLIP - clip (fragColor.a - 0.001); - #endif - - return fragColor; - } - - - - ENDCG - } - } +Shader "AxibugEmuOnline/XMBBackGroundPreview" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + + [Space(10)] + _Color1("Color1",Color) = (0,0.4,1,1) + _Color2("Color2",Color) = (0,0.7,1,1) + + [Header(Wave1)] + _MidHeight1("MidHeight",Float) = 0.4 + _MaxHeight1("MaxHeigh",Float) = 0.5 + _Power1("Power",Float)=50.0 + _Frequency1("Frequency",Float)=2.0 + _Speed1("Speed",Float)=0.4 + + [Header(Wave2)] + _MidHeight2("MidHeight",Float) = 0.42 + _MaxHeight2("MaxHeigh",Float) = 0.54 + _Power2("Power",Float)=50.0 + _Frequency2("Frequency",Float)=2.1 + _Speed2("Speed",Float)=0.3 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + sampler2D _MainTex; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + + float wave(float x, float frequency, float speed, float midHeight, float maxHeight) + { + return (sin(frequency * (x + speed * (((1. - (pow(cos(0.002 * (_Time.y + 400.)), 2.) + 1.) / 2.) + .1) * 2048.))) * (maxHeight - midHeight)) + midHeight; + } + float percentHigh(float currentY, float waveHeight, float maxHeight, float power) + { + float percentWave = max(waveHeight - currentY, 0.0) / maxHeight; + return pow(1.0 - percentWave, power); + } + float waveColor(float2 uv, float waveHeight, float maxHeight, float frequency, float power) + { + float percentWave = percentHigh(uv.y, waveHeight, maxHeight, power); + return clamp(percentWave + 0.8, 0.0, 1.0); + } + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + OUT.color = v.color * _Color; + return OUT; + } + + float3 _Color1; + float3 _Color2; + + float _MidHeight1; + float _MaxHeight1; + float _Power1; + float _Frequency1; + float _Speed1; + + float _MidHeight2; + float _MaxHeight2; + float _Power2; + float _Frequency2; + float _Speed2; + + fixed4 frag(v2f IN) : SV_Target + { + float2 uv= IN.texcoord; + // Lerped background + + float amount = (uv.x + uv.y) / 2.0; + float3 bg = lerp(_Color2, _Color1, amount); + + // Overlayed sine waves + float maxHeight1 = _MaxHeight1 + wave(0, 4.0,0.02, 0.0, 0.02); + float power1 = _Power1; //Higher power means thinner line + float frequency1 = _Frequency1 + wave(0.0, 3.0, 0.03, 0.0, 0.02); + float speed1 = _Speed1 + wave(0.0, 2.2, 0.04, 0.0, 0.01); + float waveHeight1 = wave(uv.x, frequency1, speed1, _MidHeight1, maxHeight1); + float waveCol1 = waveColor(uv, waveHeight1, maxHeight1, frequency1, power1); + + float midHeight2 = _MidHeight2; + float maxHeight2 = _MaxHeight2 + wave(0.0, 3.0, 0.04, 0.0, 0.02); + float power2 = _Power2; //Higher power means thinner line + float frequency2 = _Frequency2 + wave(0.0, 4.0, 0.05, 0.0, 0.02); + float speed2 = _Speed2 + wave(0.0, 2.0, 0.02, 0.0, 0.01); + float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2); + float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2); + + float3 col = bg; + + float3 waveCol1_temp=col/waveCol1; + col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1)); + + float3 waveCol2_temp=col/waveCol2; + col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2)); + + // Output to screen + fixed4 fragColor = float4(col,1.0)*IN.color; + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + fragColor.a *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (fragColor.a - 0.001); + #endif + + return fragColor; + } + + + + ENDCG + } + } } \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGroundPreview.shader.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBackGroundPreview.shader.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBackGroundPreview.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBgChanger.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBgChanger.cs index 0ba54bf..8f0e115 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBgChanger.cs @@ -1,30 +1,30 @@ -using AxibugEmuOnline.Client.ClientCore; -using UnityEngine; -using UnityEngine.UI; - -namespace AxibugEmuOnline.Client -{ - public class XMBBgChanger : MonoBehaviour - { - public Image imgUI; - - private void OnEnable() - { - App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; - - imgUI.GetMaterial().SetColor("_Color1", App.settings.BgColor.CurrentColor.color1); - imgUI.GetMaterial().SetColor("_Color2", App.settings.BgColor.CurrentColor.color2); - } - - private void OnDisable() - { - App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; - } - - private void BgColor_OnColorChanged(XMBColor color) - { - imgUI.GetMaterial().SetColor("_Color1", color.color1); - imgUI.GetMaterial().SetColor("_Color2", color.color2); - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using UnityEngine; +using UnityEngine.UI; + +namespace AxibugEmuOnline.Client +{ + public class XMBBgChanger : MonoBehaviour + { + public Image imgUI; + + private void OnEnable() + { + App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; + + imgUI.GetMaterial().SetColor("_Color1", App.settings.BgColor.CurrentColor.color1); + imgUI.GetMaterial().SetColor("_Color2", App.settings.BgColor.CurrentColor.color2); + } + + private void OnDisable() + { + App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; + } + + private void BgColor_OnColorChanged(XMBColor color) + { + imgUI.GetMaterial().SetColor("_Color1", color.color1); + imgUI.GetMaterial().SetColor("_Color2", color.color2); + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBgChanger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBBgChanger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBBgChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs similarity index 96% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs index 1557d85..baa1c41 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs @@ -1,31 +1,31 @@ -using AxibugEmuOnline.Client.ClientCore; -using Coffee.UIExtensions; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public class XMBOptionBgChanger : MonoBehaviour - { - public UIGradient gradient; - - private void OnEnable() - { - App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; - - var color = App.settings.BgColor.CurrentColor; - gradient.color1 = color.color1; - gradient.color2 = color.color2; - } - - private void OnDisable() - { - App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; - } - - private void BgColor_OnColorChanged(XMBColor color) - { - gradient.color1 = color.color1; - gradient.color2 = color.color2; - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using Coffee.UIExtensions; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public class XMBOptionBgChanger : MonoBehaviour + { + public UIGradient gradient; + + private void OnEnable() + { + App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged; + + var color = App.settings.BgColor.CurrentColor; + gradient.color1 = color.color1; + gradient.color2 = color.color2; + } + + private void OnDisable() + { + App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged; + } + + private void BgColor_OnColorChanged(XMBColor color) + { + gradient.color1 = color.color1; + gradient.color2 = color.color2; + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBOptionBgChanger.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI/XMBTopGroup.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI/XMBTopGroup.cs similarity index 98% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI/XMBTopGroup.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI/XMBTopGroup.cs index 909da4b..6e34c52 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI/XMBTopGroup.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI/XMBTopGroup.cs @@ -32,49 +32,49 @@ public class XMBTopGroup : MonoBehaviour RefreshPower(); RefreshDelay(); RefreshFps(); - } - - (uint lastFrame, float lastTime) m_lastFrameInfo; - private void RefreshFps() - { - if (App.emu.Core.IsNull()) - FPS.gameObject.SetActiveEx(false); - else - { - FPS.gameObject.SetActiveEx(true); - var gap = App.emu.Core.Frame - m_lastFrameInfo.lastFrame; - var time = Time.realtimeSinceStartup - m_lastFrameInfo.lastTime; - var fps = gap / time; - FPS.text = $"FPS:{fps:.#}"; - - m_lastFrameInfo.lastFrame = App.emu.Core.Frame; - m_lastFrameInfo.lastTime = Time.realtimeSinceStartup; - } - } - - private void RefreshDelay() - { - if (App.user == null) - { - DelayValue.text = $"-"; - OnlinePlayerCount.text = $"-"; - return; - } - else - { - if (App.user.IsLoggedIn) - { - DelayValue.text = $"{App.tickLoop.AveNetDelay * 1000:0}ms"; - OnlinePlayerCount.text = App.user.OnlinePlayerCount.ToString(); - } - else - { - DelayValue.text = "-"; - OnlinePlayerCount.text = $"-"; - } - } - } - + } + + (uint lastFrame, float lastTime) m_lastFrameInfo; + private void RefreshFps() + { + if (App.emu.Core.IsNull()) + FPS.gameObject.SetActiveEx(false); + else + { + FPS.gameObject.SetActiveEx(true); + var gap = App.emu.Core.Frame - m_lastFrameInfo.lastFrame; + var time = Time.realtimeSinceStartup - m_lastFrameInfo.lastTime; + var fps = gap / time; + FPS.text = $"FPS:{fps:.#}"; + + m_lastFrameInfo.lastFrame = App.emu.Core.Frame; + m_lastFrameInfo.lastTime = Time.realtimeSinceStartup; + } + } + + private void RefreshDelay() + { + if (App.user == null) + { + DelayValue.text = $"-"; + OnlinePlayerCount.text = $"-"; + return; + } + else + { + if (App.user.IsLoggedIn) + { + DelayValue.text = $"{App.tickLoop.AveNetDelay * 1000:0}ms"; + OnlinePlayerCount.text = App.user.OnlinePlayerCount.ToString(); + } + else + { + DelayValue.text = "-"; + OnlinePlayerCount.text = $"-"; + } + } + } + void RefreshTime() { txtDateTime.text = DateTime.Now.ToString("MM/dd HH:mm"); diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI/XMBTopGroup.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI/XMBTopGroup.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/UI/XMBTopGroupUI/XMBTopGroup.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBTopGroupUI/XMBTopGroup.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Utility.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Utility.cs similarity index 97% rename from AxibugEmuOnline.Client/Assets/Script/Utility.cs rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Utility.cs index 86d005e..fdf7c77 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Utility.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Utility.cs @@ -1,63 +1,63 @@ -using AxibugEmuOnline.Client.ClientCore; -using AxibugProtobuf; -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace AxibugEmuOnline.Client -{ - public static class Utility - { - public static void SetActiveEx(this GameObject go, bool active) - { - if (active && go.activeSelf) return; - if (!active && !go.activeSelf) return; - - go.SetActive(active); - } - - public static string GetHostNickName(this Protobuf_Room_MiniInfo roomInfo) - { - var hostUID = roomInfo.HostPlayerUID; - if (hostUID == roomInfo.Player1UID) return roomInfo.Player1NickName; - else if (hostUID == roomInfo.Player2UID) return roomInfo.Player2NickName; - else if (hostUID == roomInfo.Player3UID) return roomInfo.Player3NickName; - else if (hostUID == roomInfo.Player4UID) return roomInfo.Player4NickName; - else return string.Empty; - } - - public static void GetRoomPlayers(this Protobuf_Room_MiniInfo roomInfo, out int current, out int max) - { - current = 0; max = 4; - - if (roomInfo.Player1UID > 0) current++; - if (roomInfo.Player2UID > 0) current++; - if (roomInfo.Player3UID > 0) current++; - if (roomInfo.Player4UID > 0) current++; - } - - private static Dictionary s_RomFileCahcesInRoomInfo = new Dictionary(); - public static void FetchRomFileInRoomInfo(this Protobuf_Room_MiniInfo roomInfo, EnumPlatform platform, Action callback) - { - if (s_RomFileCahcesInRoomInfo.TryGetValue(roomInfo.GameRomID, out RomFile romFile)) - { - callback.Invoke(roomInfo, romFile); - return; - } - switch (platform) - { - case EnumPlatform.NES: - App.StartCoroutine(App.httpAPI.GetNesRomInfo(roomInfo.GameRomID, (romWebData) => - { - RomFile romFile = new RomFile(EnumPlatform.NES, 0, 0); - romFile.SetWebData(romWebData); - s_RomFileCahcesInRoomInfo[roomInfo.GameRomID] = romFile; - - callback.Invoke(roomInfo, romFile); - })); - break; - } - - } - } -} +using AxibugEmuOnline.Client.ClientCore; +using AxibugProtobuf; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AxibugEmuOnline.Client +{ + public static class Utility + { + public static void SetActiveEx(this GameObject go, bool active) + { + if (active && go.activeSelf) return; + if (!active && !go.activeSelf) return; + + go.SetActive(active); + } + + public static string GetHostNickName(this Protobuf_Room_MiniInfo roomInfo) + { + var hostUID = roomInfo.HostPlayerUID; + if (hostUID == roomInfo.Player1UID) return roomInfo.Player1NickName; + else if (hostUID == roomInfo.Player2UID) return roomInfo.Player2NickName; + else if (hostUID == roomInfo.Player3UID) return roomInfo.Player3NickName; + else if (hostUID == roomInfo.Player4UID) return roomInfo.Player4NickName; + else return string.Empty; + } + + public static void GetRoomPlayers(this Protobuf_Room_MiniInfo roomInfo, out int current, out int max) + { + current = 0; max = 4; + + if (roomInfo.Player1UID > 0) current++; + if (roomInfo.Player2UID > 0) current++; + if (roomInfo.Player3UID > 0) current++; + if (roomInfo.Player4UID > 0) current++; + } + + private static Dictionary s_RomFileCahcesInRoomInfo = new Dictionary(); + public static void FetchRomFileInRoomInfo(this Protobuf_Room_MiniInfo roomInfo, EnumPlatform platform, Action callback) + { + if (s_RomFileCahcesInRoomInfo.TryGetValue(roomInfo.GameRomID, out RomFile romFile)) + { + callback.Invoke(roomInfo, romFile); + return; + } + switch (platform) + { + case EnumPlatform.NES: + App.StartCoroutine(App.httpAPI.GetNesRomInfo(roomInfo.GameRomID, (romWebData) => + { + RomFile romFile = new RomFile(EnumPlatform.NES, 0, 0); + romFile.SetWebData(romWebData); + s_RomFileCahcesInRoomInfo[roomInfo.GameRomID] = romFile; + + callback.Invoke(roomInfo, romFile); + })); + break; + } + + } + } +} diff --git a/AxibugEmuOnline.Client/Assets/Script/Utility.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Utility.cs.meta similarity index 100% rename from AxibugEmuOnline.Client/Assets/Script/Utility.cs.meta rename to AxibugEmuOnline.Client/Assets/Script/AppMain/Utility.cs.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/Initer.cs.meta b/AxibugEmuOnline.Client/Assets/Script/Initer.cs.meta index 7b894b6..2a7ea7a 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Initer.cs.meta +++ b/AxibugEmuOnline.Client/Assets/Script/Initer.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 980f937ad27ad8540afeb8b7f100997e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: -1100 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: df60926444dcb584c80f9917e9ea798f \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager.meta b/AxibugEmuOnline.Client/Assets/Script/Manager.meta index 7cf740f..aa9a3cb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager.meta +++ b/AxibugEmuOnline.Client/Assets/Script/Manager.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 437646a1943eaf34dbe1a56eb38494bb +guid: cbed35db3530cb4418c467bc76d101bb folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs.meta b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs.meta index 09c0f66..ea66b58 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs.meta +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 32566452eb52f484d92619b539b1d70f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: eb89085725d97c949b82f372fe8173ef \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Settings.meta b/AxibugEmuOnline.Client/Assets/Settings.meta new file mode 100644 index 0000000..725e849 --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c3fabe6430be6943b1fc06a25a275a8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Settings/Build Profiles.meta b/AxibugEmuOnline.Client/Assets/Settings/Build Profiles.meta new file mode 100644 index 0000000..c98514c --- /dev/null +++ b/AxibugEmuOnline.Client/Assets/Settings/Build Profiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13795c31ef56b3648a06122c6b1864f3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AxibugEmuOnline.Client/ProjectSettings/MultiplayerManager.asset b/AxibugEmuOnline.Client/ProjectSettings/MultiplayerManager.asset new file mode 100644 index 0000000..2a93664 --- /dev/null +++ b/AxibugEmuOnline.Client/ProjectSettings/MultiplayerManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!655991488 &1 +MultiplayerManager: + m_ObjectHideFlags: 0 + m_EnableMultiplayerRoles: 0 + m_StrippingTypes: {}