From 7576a5bc5f378424f3c7f26c10d23469c5c43350 Mon Sep 17 00:00:00 2001 From: "star\\zhenghan" Date: Mon, 22 Aug 2022 13:53:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dseason=E5=92=8C=E4=BA=A7?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/InitialResourceConfigCategory.bytes | 2 +- Config/Resource/InitResource.json | 2 +- Excel/InitialResourceConfig.xlsx | Bin 12727 -> 12742 bytes Excel/Json/c/InitialResourceConfig.txt | 2 +- Excel/Json/s/InitialResourceConfig.txt | 2 +- Unity/Animancer.FSM.csproj | 11 +- Unity/Animancer.csproj | 11 +- .../Assets/Bundles/Building/Build_Base.prefab | 8 +- .../InitialResourceConfigCategory.bytes | 2 +- .../Assets/Bundles/People/People_1001.prefab | 18 +- .../Bundles/Resource/Resource_Base.prefab | 2 +- Unity/Assets/Res/Mat/2DLight.mat | 46 ++ Unity/Assets/Res/Mat/2DLight.mat.meta | 8 + Unity/Assets/Res/Mat/GameObject.mat | 56 +++ Unity/Assets/Res/Mat/GameObject.mat.meta | 8 + Unity/Assets/Res/Mat/GameObjectLit.mat | 56 +++ Unity/Assets/Res/Mat/GameObjectLit.mat.meta | 8 + Unity/Assets/Res/Shader/GameObject.shader | 141 ++++++ .../Assets/Res/Shader/GameObject.shader.meta | 10 + Unity/Assets/Res/Shader/GameObjectLit.shader | 334 +++++++++++++++ .../Res/Shader/GameObjectLit.shader.meta | 10 + Unity/Assets/Scenes/Game.unity | 115 ++++- Unity/Assets/Scenes/Test1.unity | 405 +++++++++++++++++- Unity/Assets/Scripts/Test/TestBounds.cs | 41 +- .../Resource/ResourcePointComponentSystem.cs | 4 + Unity/Codes/Hotfix/Demo/Unit/UnitHelper.cs | 2 +- .../Building/BuildingViewComponentSystem.cs | 33 +- ...ildingSelectWorkerWindowComponentSystem.cs | 2 +- .../FUIFarmlandWindowComponentSystem.cs | 15 +- .../FUI/Logic/Main/FUIMainComponentSystem.cs | 30 +- .../People/FUILineupWindowComponentSystem.cs | 3 +- .../FUIPartnerListWindowComponentSystem.cs | 3 +- .../FUIPeopleListWindowComponentSystem.cs | 3 +- .../FUIResourceWindowComponentSystem.cs | 16 +- .../FUISelectWorkerWindowComponentSystem.cs | 4 +- .../Demo/Building/BuildingViewComponent.cs | 5 +- .../FUI/Logic/Building/FUIFarmlandWindow.cs | 21 + .../ModelView/Demo/Util/MaterialHelper.cs | 21 + .../ModelView/Demo/Util/SingletonBase.cs | 44 ++ Unity/UserSettings/EditorUserSettings.asset | 5 +- 40 files changed, 1415 insertions(+), 94 deletions(-) create mode 100644 Unity/Assets/Res/Mat/2DLight.mat create mode 100644 Unity/Assets/Res/Mat/2DLight.mat.meta create mode 100644 Unity/Assets/Res/Mat/GameObject.mat create mode 100644 Unity/Assets/Res/Mat/GameObject.mat.meta create mode 100644 Unity/Assets/Res/Mat/GameObjectLit.mat create mode 100644 Unity/Assets/Res/Mat/GameObjectLit.mat.meta create mode 100644 Unity/Assets/Res/Shader/GameObject.shader create mode 100644 Unity/Assets/Res/Shader/GameObject.shader.meta create mode 100644 Unity/Assets/Res/Shader/GameObjectLit.shader create mode 100644 Unity/Assets/Res/Shader/GameObjectLit.shader.meta create mode 100644 Unity/Codes/ModelView/Demo/FUI/Logic/Building/FUIFarmlandWindow.cs create mode 100644 Unity/Codes/ModelView/Demo/Util/MaterialHelper.cs create mode 100644 Unity/Codes/ModelView/Demo/Util/SingletonBase.cs diff --git a/Config/InitialResourceConfigCategory.bytes b/Config/InitialResourceConfigCategory.bytes index 2b521a4..717d467 100644 --- a/Config/InitialResourceConfigCategory.bytes +++ b/Config/InitialResourceConfigCategory.bytes @@ -1,2 +1,2 @@ -dd d(d0d8d@@HP \ No newline at end of file +!dd d(d0d8d@@@@@@@HP \ No newline at end of file diff --git a/Config/Resource/InitResource.json b/Config/Resource/InitResource.json index 49f5e45..1beafa5 100644 --- a/Config/Resource/InitResource.json +++ b/Config/Resource/InitResource.json @@ -1 +1 @@ -{"_t":"MainSceneInitResource","InitResourceItems":[{"_t":"InitResourceItem","ConfigId":1001,"PosX":-13,"PosY":4.5,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":1002,"PosX":-17,"PosY":1.5,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":18,"PosY":3,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2003,"PosX":6,"PosY":3,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2002,"PosX":-6,"PosY":0,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2004,"PosX":-1.5,"PosY":7.75,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2005,"PosX":6,"PosY":7.5,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2002,"PosX":-9,"PosY":-4.5,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":10.5,"PosY":5.75,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":6.5,"PosY":10.25,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2006,"PosX":12.5,"PosY":1.25,"MonsterGroupConfigId":1,"RefreshType":0,"RefreshParameter":0}]} \ No newline at end of file +{"_t":"MainSceneInitResource","InitResourceItems":[{"_t":"InitResourceItem","ConfigId":1001,"PosX":-13,"PosY":4.5,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":1002,"PosX":-17,"PosY":1.5,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":18,"PosY":3,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2002,"PosX":-6,"PosY":0,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2002,"PosX":-9,"PosY":-4.5,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":10.5,"PosY":5.75,"MonsterGroupConfigId":0,"RefreshType":1,"RefreshParameter":0},{"_t":"InitResourceItem","ConfigId":2001,"PosX":6.5,"PosY":10.25,"MonsterGroupConfigId":1,"RefreshType":1,"RefreshParameter":0}]} \ No newline at end of file diff --git a/Excel/InitialResourceConfig.xlsx b/Excel/InitialResourceConfig.xlsx index 536d395b158a6da378fe91319052160c4220c23e..6413a9468e9de7c62706b2a9c0361479eb95ae89 100644 GIT binary patch delta 7285 zcmeHMRZv{pwryM*cWI!}P9QW8T!IDn;K71RaEBl}Sb|$a2*HB|cY?bH2=49}a z=iI7y>fU-k@9X`%^|5x%wbra!HO8KM&pGCIvmUeZbR=LNoU0^`1Oka7gFu8J5Xjuo zOwGm7$(6&*(ZvGpWp5V}H>%LdN%G+sZ8>YBMR{%)k~Ji5p@WCY7Vb$eI3KP|6>t4r zxE=OuikxJ*qj-N$s(s+s!?y6lH9~c|Fgm@xp>PyUfjE$17;Bd`` zdv=yMHQ;3ZBRa;#GhVym+|NUS%TvnYfskh=|uAVQ%LJ*-Eav_BdmtfeqynGLjaCWfBhS%}l_AE&A z?gj`$2n;AZ|C%41w~n$#+t#ok2Bi8SsVSnMk~~6-3HqqACT^{r>&fy6INl@R#2^G7 z3OQh?_%DDTUiSNaiJ4=kvHxgGPQXEu+Q?zkK>8(zY1b|EVKGv$8|-*~>SRQlewFHb zUHD-KTCyJn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OYNN8uH;1vX!`QHzt@w=#3hf9{yYe*yIofv89ydx$%|$a*dg(e-FT z!A+R8etz|{Uz2=@StSGv2az+2;oVo3O(?ILN6=}aM}~6SbLCGy08par(>qr+4~tBH zZ{PG9K+Gi&w+V#|g_b7-|Gpxr{0WuJdeY^Y%Or%8l^3cAAJXRD)byV5CwsB_6bmoT*! z6VR?x|4B9LZ=p>LO&=m+?OiZ7;PBrJU%`D``F)g~w4JCu`SSU-Af3g-+M|E|Op$-w zmgHe$Y;=Idzm%4kN+W6`Ha9_MzmJeNn!TK@ZwP;IILv42 ziArl0ZpW}I@>Dn%s(Xa*Npm2UJbz1%_YIx02*8Lntz#MW%-WusjHo?%u$eDQ6_Z)K zE$saY{;6;pi&EmXD4eZN#cft%LF9#Q(S$LQv&X-^X0wOrO>s9jznQkyiIZ!6`$oSN zUf_t~FiYjTQK#Y3LelP?UH;yG3VSIGO1zXt@iI7~!Ul!rJEtn+CS2eUH~5X}o;hW< zTmI{X0CLL5w=*bY&Kcs?onn05G(@_tXp#G=j$s!5fG0MNcDyX2LFP;h`iuy6bnFdaS`uoTRN4~Fw!f)@;f zUmWspX-1Bp0(=HD-G86YO44222N&5|RdY!UBa9z(=rFA#u9@W|cu8 ys(*N>2021.3.7f1c1 - + @@ -310,6 +310,9 @@ C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\Managed\UnityEditor.Graphs.dll + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\UnityEditor.Android.Extensions.dll + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll @@ -346,6 +349,12 @@ Assets\ThirdParty\NCalc\NCalc.dll + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Types.dll + + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Gradle.dll + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll diff --git a/Unity/Animancer.csproj b/Unity/Animancer.csproj index d329335..779372b 100644 --- a/Unity/Animancer.csproj +++ b/Unity/Animancer.csproj @@ -53,7 +53,7 @@ 2021.3.7f1c1 - + @@ -447,6 +447,9 @@ C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\Managed\UnityEditor.Graphs.dll + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\UnityEditor.Android.Extensions.dll + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll @@ -483,6 +486,12 @@ Assets\ThirdParty\NCalc\NCalc.dll + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Types.dll + + + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Gradle.dll + C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll diff --git a/Unity/Assets/Bundles/Building/Build_Base.prefab b/Unity/Assets/Bundles/Building/Build_Base.prefab index 1ba011d..e2ca363 100644 --- a/Unity/Assets/Bundles/Building/Build_Base.prefab +++ b/Unity/Assets/Bundles/Building/Build_Base.prefab @@ -229,7 +229,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -250,15 +250,15 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 308a7bc7ea72ca849ae481ffd63b145d, type: 3} + m_Sprite: {fileID: 21300000, guid: 79c0c426ddec15a4ca0d0ced268e977c, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 - m_Size: {x: 1, y: 1} + m_Size: {x: 10.24, y: 10.24} m_AdaptiveModeThreshold: 0.5 m_SpriteTileMode: 0 - m_WasSpriteAssigned: 0 + m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 1 --- !u!114 &4180406061585001571 diff --git a/Unity/Assets/Bundles/Config/InitialResourceConfigCategory.bytes b/Unity/Assets/Bundles/Config/InitialResourceConfigCategory.bytes index 2b521a4..717d467 100644 --- a/Unity/Assets/Bundles/Config/InitialResourceConfigCategory.bytes +++ b/Unity/Assets/Bundles/Config/InitialResourceConfigCategory.bytes @@ -1,2 +1,2 @@ -dd d(d0d8d@@HP \ No newline at end of file +!dd d(d0d8d@@@@@@@HP \ No newline at end of file diff --git a/Unity/Assets/Bundles/People/People_1001.prefab b/Unity/Assets/Bundles/People/People_1001.prefab index 182a71b..70c0dd9 100644 --- a/Unity/Assets/Bundles/People/People_1001.prefab +++ b/Unity/Assets/Bundles/People/People_1001.prefab @@ -1016,32 +1016,32 @@ PrefabInstance: type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535984, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535986, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535988, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535990, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535992, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535994, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_FlipX @@ -1051,17 +1051,17 @@ PrefabInstance: type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535996, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2241700298441535998, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} - target: {fileID: 2399695433351747915, guid: 413bb15c31e26f947b838996fe528d53, type: 3} propertyPath: m_Bounds.m_Center.x diff --git a/Unity/Assets/Bundles/Resource/Resource_Base.prefab b/Unity/Assets/Bundles/Resource/Resource_Base.prefab index a8eabf0..8e73620 100644 --- a/Unity/Assets/Bundles/Resource/Resource_Base.prefab +++ b/Unity/Assets/Bundles/Resource/Resource_Base.prefab @@ -144,7 +144,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Unity/Assets/Res/Mat/2DLight.mat b/Unity/Assets/Res/Mat/2DLight.mat new file mode 100644 index 0000000..52bebd6 --- /dev/null +++ b/Unity/Assets/Res/Mat/2DLight.mat @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 2DLight + m_Shader: {fileID: 4800000, guid: e260cfa7296ee7642b167f1eb5be5023, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/Unity/Assets/Res/Mat/2DLight.mat.meta b/Unity/Assets/Res/Mat/2DLight.mat.meta new file mode 100644 index 0000000..40893ea --- /dev/null +++ b/Unity/Assets/Res/Mat/2DLight.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 374868c26a9f55b4397a7e73227f54f3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Res/Mat/GameObject.mat b/Unity/Assets/Res/Mat/GameObject.mat new file mode 100644 index 0000000..a803828 --- /dev/null +++ b/Unity/Assets/Res/Mat/GameObject.mat @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: GameObject + m_Shader: {fileID: 4800000, guid: ead99fbd6ac1a744a84dc3d90b426628, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _DetectAlpha: 0.1 + - _EFFECT_EDGE: 0 + - _EFFECT_HIGHLIGHT: 0 + - _EFFECT_HiGHLIGHT: 0 + - _EnableExternalAlpha: 0 + - _HaveEdgeEffect: 1 + - _ImageCullAlpha: 0.2 + - _PixelSize: 5.46 + - _Smooth: 5.92 + - _SmoothAlphaBase: 0.678 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _OutLineColor: {r: 1, g: 0.21058662, b: 0, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/Unity/Assets/Res/Mat/GameObject.mat.meta b/Unity/Assets/Res/Mat/GameObject.mat.meta new file mode 100644 index 0000000..7f19399 --- /dev/null +++ b/Unity/Assets/Res/Mat/GameObject.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 802e1eafac60ee044aed8fc50fe0e7b1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Res/Mat/GameObjectLit.mat b/Unity/Assets/Res/Mat/GameObjectLit.mat new file mode 100644 index 0000000..23c3c31 --- /dev/null +++ b/Unity/Assets/Res/Mat/GameObjectLit.mat @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: GameObjectLit + m_Shader: {fileID: 4800000, guid: 844b1f34770e3fe4aa7afbe4c622a6d0, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _DetectAlpha: 0.2 + - _EFFECT_EDGE: 0 + - _EFFECT_HIGHLIGHT: 0 + - _EFFECT_HiGHLIGHT: 0 + - _EnableExternalAlpha: 0 + - _HaveEdgeEffect: 1 + - _ImageCullAlpha: 0.718 + - _PixelSize: 6 + - _Smooth: 5.92 + - _SmoothAlphaBase: 0.678 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _OutLineColor: {r: 1, g: 0.21058662, b: 0, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/Unity/Assets/Res/Mat/GameObjectLit.mat.meta b/Unity/Assets/Res/Mat/GameObjectLit.mat.meta new file mode 100644 index 0000000..0048e7b --- /dev/null +++ b/Unity/Assets/Res/Mat/GameObjectLit.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 760052f9f92321d44839e8d3342dac3c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Res/Shader/GameObject.shader b/Unity/Assets/Res/Shader/GameObject.shader new file mode 100644 index 0000000..40eb5ff --- /dev/null +++ b/Unity/Assets/Res/Shader/GameObject.shader @@ -0,0 +1,141 @@ +Shader "PeachValley/GameObject" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + _Color ("Tint", Color) = (1,1,1,1) + [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} + [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 + + [Space] + [Header(Edge)] + [Toggle] _EFFECT_EDGE ("Enable Edge", Float) = 0 + _OutLineColor ("Outline color", Color) = (0.804, 0.2, 0, 1)//描边颜色 + _PixelSize ("Pixel Size", Range(0, 10)) = 6 + _DetectAlpha ("DetectAlpha", Range(0, 0.2)) = 0.1 //四周的点算alpha平均,若大于则显示描边 + _ImageCullAlpha ("ImageCullAlpha", Range(0, 1)) = 0.2 //当前所在的点若大于改值,则无条件原图 + // _Smooth ("Smooth", Range(1, 10)) = 10 + // _SmoothAlphaBase ("SmoothAlphaBase", Range(0, 1)) = 0.8 + _HaveEdgeEffect ("HaveEdgeEffect", Range(0, 1)) = 1 + + [Space] + [Header(Highlight)] + [Toggle] _EFFECT_HIGHLIGHT("Enable Highlight", Float) = 0 + } + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Cull Off + Lighting Off + ZWrite Off + Blend One OneMinusSrcAlpha + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + #pragma multi_compile _ ETC1_EXTERNAL_ALPHA + #pragma multi_compile _EFFECT_EDGE _EFFECT_EDGE_ON + #pragma multi_compile _EFFECT_HIGHLIGHT _EFFECT_HIGHLIGHT_ON + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + }; + + fixed4 _Color; + + v2f vert(appdata_t IN) + { + v2f OUT; + OUT.vertex = UnityObjectToClipPos(IN.vertex); + OUT.texcoord = IN.texcoord; + OUT.color = IN.color * _Color; + #ifdef PIXELSNAP_ON + OUT.vertex = UnityPixelSnap (OUT.vertex); + #endif + + return OUT; + } + + sampler2D _MainTex; + sampler2D _AlphaTex; + + // for edge + fixed4 _OutLineColor; + float _PixelSize; + float2 _MainTex_TexelSize; + float _DetectAlpha; + float _ImageCullAlpha; + // float _Smooth; + // float _SmoothAlphaBase; + half _HaveEdgeEffect; + + void Edge(inout fixed4 outColor, half2 changedUV) + { + _PixelSize = _PixelSize * _MainTex_TexelSize; + // fixed4 color = tex2D(_MainTex, fixed2(changedUV.x, changedUV.y)); + fixed color1 = tex2D(_MainTex, fixed2(changedUV.x + _PixelSize, changedUV.y + _PixelSize)).a; + fixed color2 = tex2D(_MainTex, fixed2(changedUV.x - _PixelSize, changedUV.y - _PixelSize)).a; + fixed color3 = tex2D(_MainTex, fixed2(changedUV.x + _PixelSize, changedUV.y - _PixelSize)).a; + fixed color4 = tex2D(_MainTex, fixed2(changedUV.x - _PixelSize, changedUV.y + _PixelSize)).a; + fixed a = (color1 + color2 + color3 + color4) / 4; + int if1 = step(outColor.a, _ImageCullAlpha); + int if2 = step(a, _DetectAlpha); + // outColor = outColor* (1 - _HaveEdgeEffect) + _HaveEdgeEffect *(if1 * (((1 - if2) * fixed4(_OutLineColor.rgb, pow(a + _SmoothAlphaBase, _Smooth) * _OutLineColor.a))) + color * (1 - if1)); + outColor = outColor* (1 - _HaveEdgeEffect) + _HaveEdgeEffect *(if1 * (((1 - if2) * _OutLineColor)) + outColor * (1 - if1)); + } + + fixed4 SampleSpriteTexture (float2 uv) + { + fixed4 color = tex2D (_MainTex, uv); + + #if ETC1_EXTERNAL_ALPHA + fixed4 alpha = tex2D (_AlphaTex, uv); + color.a = lerp (color.a, alpha.r, _EnableExternalAlpha); + #endif + + return color; + } + + fixed4 frag(v2f IN) : SV_Target + { + fixed4 c = SampleSpriteTexture (IN.texcoord) * IN.color; + + #if _EFFECT_HIGHLIGHT_ON + c.rgb *= fixed3(1.3, 1.3, 1.3); + #endif + + #if _EFFECT_EDGE_ON + Edge(c, IN.texcoord); + #endif + c.rgb *= c.a; + + return c; + } + + ENDCG + } + } + FallBack "Diffuse" +} diff --git a/Unity/Assets/Res/Shader/GameObject.shader.meta b/Unity/Assets/Res/Shader/GameObject.shader.meta new file mode 100644 index 0000000..d57bd1a --- /dev/null +++ b/Unity/Assets/Res/Shader/GameObject.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ead99fbd6ac1a744a84dc3d90b426628 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Res/Shader/GameObjectLit.shader b/Unity/Assets/Res/Shader/GameObjectLit.shader new file mode 100644 index 0000000..2b6df70 --- /dev/null +++ b/Unity/Assets/Res/Shader/GameObjectLit.shader @@ -0,0 +1,334 @@ +Shader "PeachValley/GameObjectLit" +{ + Properties + { + _MainTex("Diffuse", 2D) = "white" {} + _MaskTex("Mask", 2D) = "white" {} + _NormalMap("Normal Map", 2D) = "bump" {} + + // Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader. + [HideInInspector] _Color("Tint", Color) = (1,1,1,1) + [HideInInspector] _RendererColor("RendererColor", Color) = (1,1,1,1) + [HideInInspector] _Flip("Flip", Vector) = (1,1,1,1) + [HideInInspector] _AlphaTex("External Alpha", 2D) = "white" {} + [HideInInspector] _EnableExternalAlpha("Enable External Alpha", Float) = 0 + + [Space] + [Header(Edge)] + [Toggle] _EFFECT_EDGE ("Enable Edge", Float) = 0 + _OutLineColor ("Outline color", Color) = (0.804, 0.2, 0, 1)//描边颜色 + _PixelSize ("Pixel Size", Range(0, 10)) = 6 + _DetectAlpha ("DetectAlpha", Range(0, 0.2)) = 0.1 //四周的点算alpha平均,若大于则显示描边 + _ImageCullAlpha ("ImageCullAlpha", Range(0, 1)) = 0.2 //当前所在的点若大于改值,则无条件原图 + // _Smooth ("Smooth", Range(1, 10)) = 10 + // _SmoothAlphaBase ("SmoothAlphaBase", Range(0, 1)) = 0.8 + _HaveEdgeEffect ("HaveEdgeEffect", Range(0, 1)) = 1 + + [Space] + [Header(Highlight)] + [Toggle] _EFFECT_HIGHLIGHT("Enable Highlight", Float) = 0 + } + + SubShader + { + Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" } + + Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha + Cull Off + ZWrite Off + + Pass + { + Tags { "LightMode" = "Universal2D" } + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #pragma vertex CombinedShapeLightVertex + #pragma fragment CombinedShapeLightFragment + + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_0 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_1 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_2 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_3 __ + #pragma multi_compile _ DEBUG_DISPLAY + + #pragma multi_compile _EFFECT_EDGE _EFFECT_EDGE_ON + #pragma multi_compile _EFFECT_HIGHLIGHT _EFFECT_HIGHLIGHT_ON + + struct Attributes + { + float3 positionOS : POSITION; + float4 color : COLOR; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + half4 color : COLOR; + float2 uv : TEXCOORD0; + half2 lightingUV : TEXCOORD1; + #if defined(DEBUG_DISPLAY) + float3 positionWS : TEXCOORD2; + #endif + UNITY_VERTEX_OUTPUT_STEREO + }; + + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl" + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + TEXTURE2D(_MaskTex); + SAMPLER(sampler_MaskTex); + half4 _MainTex_ST; + float4 _Color; + half4 _RendererColor; + + #if USE_SHAPE_LIGHT_TYPE_0 + SHAPE_LIGHT(0) + #endif + + #if USE_SHAPE_LIGHT_TYPE_1 + SHAPE_LIGHT(1) + #endif + + #if USE_SHAPE_LIGHT_TYPE_2 + SHAPE_LIGHT(2) + #endif + + #if USE_SHAPE_LIGHT_TYPE_3 + SHAPE_LIGHT(3) + #endif + + Varyings CombinedShapeLightVertex(Attributes v) + { + Varyings o = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionCS = TransformObjectToHClip(v.positionOS); + #if defined(DEBUG_DISPLAY) + o.positionWS = TransformObjectToWorld(v.positionOS); + #endif + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.lightingUV = half2(ComputeScreenPos(o.positionCS / o.positionCS.w).xy); + + o.color = v.color * _Color * _RendererColor; + return o; + } + + // for edge + half4 _OutLineColor; + float _PixelSize; + float2 _MainTex_TexelSize; + float _DetectAlpha; + float _ImageCullAlpha; + // float _Smooth; + // float _SmoothAlphaBase; + half _HaveEdgeEffect; + + void Edge(inout half4 outColor, half2 changedUV) + { + _PixelSize = _PixelSize * _MainTex_TexelSize; + // fixed4 color = tex2D(_MainTex, fixed2(changedUV.x, changedUV.y)); + half color1 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, half2(changedUV.x + _PixelSize, changedUV.y + _PixelSize)).a; + half color2 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, half2(changedUV.x - _PixelSize, changedUV.y - _PixelSize)).a; + half color3 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, half2(changedUV.x + _PixelSize, changedUV.y - _PixelSize)).a; + half color4 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, half2(changedUV.x - _PixelSize, changedUV.y + _PixelSize)).a; + half a = (color1 + color2 + color3 + color4) / 4; + int if1 = step(outColor.a, _ImageCullAlpha); + int if2 = step(a, _DetectAlpha); + // outColor = outColor* (1 - _HaveEdgeEffect) + _HaveEdgeEffect *(if1 * (((1 - if2) * fixed4(_OutLineColor.rgb, pow(a + _SmoothAlphaBase, _Smooth) * _OutLineColor.a))) + color * (1 - if1)); + outColor = outColor* (1 - _HaveEdgeEffect) + _HaveEdgeEffect *(if1 * (((1 - if2) * _OutLineColor)) + outColor * (1 - if1)); + } + + void Outline(inout half4 outColor, half2 uv) + { + float totalAlpha = 1.0; + + [unroll(16)] + for (int i = 1; i < _PixelSize + 1; i++) { + half4 pixelUp = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv + half2(0, i * _MainTex_TexelSize.y)); + half4 pixelDown = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv - half2(0,i * _MainTex_TexelSize.y)); + half4 pixelRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv + half2(i * _MainTex_TexelSize.x, 0)); + half4 pixelLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv - half2(i * _MainTex_TexelSize.x, 0)); + + totalAlpha = totalAlpha * pixelUp.a * pixelDown.a * pixelRight.a * pixelLeft.a; + } + + if (totalAlpha == 0) { + outColor.rgba = half4(1, 1, 1, 1) * _OutLineColor; + } + } + + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/CombinedShapeLightShared.hlsl" + + half4 CombinedShapeLightFragment(Varyings i) : SV_Target + { + const half4 main = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv); + const half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv); + SurfaceData2D surfaceData; + InputData2D inputData; + + InitializeSurfaceData(main.rgb, main.a, mask, surfaceData); + InitializeInputData(i.uv, i.lightingUV, inputData); + + half4 outColor = CombinedShapeLightShared(surfaceData, inputData); + + #if _EFFECT_HIGHLIGHT_ON + outColor.rgb *= half3(1.3, 1.3, 1.3); + #endif + + #if _EFFECT_EDGE_ON + // Edge(outColor, i.uv); + Outline(outColor, i.uv); + #endif + + return outColor; + } + ENDHLSL + } + + Pass + { + Tags { "LightMode" = "NormalsRendering"} + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #pragma vertex NormalsRenderingVertex + #pragma fragment NormalsRenderingFragment + + struct Attributes + { + float3 positionOS : POSITION; + float4 color : COLOR; + float2 uv : TEXCOORD0; + float4 tangent : TANGENT; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + half4 color : COLOR; + float2 uv : TEXCOORD0; + half3 normalWS : TEXCOORD1; + half3 tangentWS : TEXCOORD2; + half3 bitangentWS : TEXCOORD3; + UNITY_VERTEX_OUTPUT_STEREO + }; + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + half4 _NormalMap_ST; // Is this the right way to do this? + + Varyings NormalsRenderingVertex(Attributes attributes) + { + Varyings o = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(attributes); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionCS = TransformObjectToHClip(attributes.positionOS); + o.uv = TRANSFORM_TEX(attributes.uv, _NormalMap); + o.color = attributes.color; + o.normalWS = -GetViewForwardDir(); + o.tangentWS = TransformObjectToWorldDir(attributes.tangent.xyz); + o.bitangentWS = cross(o.normalWS, o.tangentWS) * attributes.tangent.w; + return o; + } + + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/NormalsRenderingShared.hlsl" + + half4 NormalsRenderingFragment(Varyings i) : SV_Target + { + const half4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv); + const half3 normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, i.uv)); + + return NormalsRenderingShared(mainTex, normalTS, i.tangentWS.xyz, i.bitangentWS.xyz, i.normalWS.xyz); + } + ENDHLSL + } + + Pass + { + Tags { "LightMode" = "UniversalForward" "Queue"="Transparent" "RenderType"="Transparent"} + + HLSLPROGRAM + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + + #pragma vertex UnlitVertex + #pragma fragment UnlitFragment + + struct Attributes + { + float3 positionOS : POSITION; + float4 color : COLOR; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float4 color : COLOR; + float2 uv : TEXCOORD0; + #if defined(DEBUG_DISPLAY) + float3 positionWS : TEXCOORD2; + #endif + UNITY_VERTEX_OUTPUT_STEREO + }; + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + float4 _MainTex_ST; + float4 _Color; + half4 _RendererColor; + + Varyings UnlitVertex(Attributes attributes) + { + Varyings o = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(attributes); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionCS = TransformObjectToHClip(attributes.positionOS); + #if defined(DEBUG_DISPLAY) + o.positionWS = TransformObjectToWorld(v.positionOS); + #endif + o.uv = TRANSFORM_TEX(attributes.uv, _MainTex); + o.color = attributes.color * _Color * _RendererColor; + return o; + } + + float4 UnlitFragment(Varyings i) : SV_Target + { + float4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv); + + #if defined(DEBUG_DISPLAY) + SurfaceData2D surfaceData; + InputData2D inputData; + half4 debugColor = 0; + + InitializeSurfaceData(mainTex.rgb, mainTex.a, surfaceData); + InitializeInputData(i.uv, inputData); + SETUP_DEBUG_DATA_2D(inputData, i.positionWS); + + if(CanDebugOverrideOutputColor(surfaceData, inputData, debugColor)) + { + return debugColor; + } + #endif + + return mainTex; + } + ENDHLSL + } + } + + Fallback "Sprites/Default" + +} diff --git a/Unity/Assets/Res/Shader/GameObjectLit.shader.meta b/Unity/Assets/Res/Shader/GameObjectLit.shader.meta new file mode 100644 index 0000000..6fdbeef --- /dev/null +++ b/Unity/Assets/Res/Shader/GameObjectLit.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 844b1f34770e3fe4aa7afbe4c622a6d0 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Scenes/Game.unity b/Unity/Assets/Scenes/Game.unity index 0f17e32..8ec6be8 100644 --- a/Unity/Assets/Scenes/Game.unity +++ b/Unity/Assets/Scenes/Game.unity @@ -193,7 +193,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1061,7 +1061,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1270,6 +1270,117 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 68, y: 36} m_EdgeRadius: 0 +--- !u!1 &1716733311 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1716733313} + - component: {fileID: 1716733312} + m_Layer: 0 + m_Name: GlobalLight + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1716733312 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1716733311} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ComponentVersion: 1 + m_LightType: 4 + m_BlendStyleIndex: 0 + m_FalloffIntensity: 0.5 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_LightVolumeIntensity: 1 + m_LightVolumeIntensityEnabled: 0 + m_ApplyToSortingLayers: 00000000 + m_LightCookieSprite: {fileID: 0} + m_DeprecatedPointLightCookieSprite: {fileID: 0} + m_LightOrder: 0 + m_AlphaBlendOnOverlap: 0 + m_OverlapOperation: 0 + m_NormalMapDistance: 3 + m_NormalMapQuality: 2 + m_UseNormalMap: 0 + m_ShadowIntensityEnabled: 0 + m_ShadowIntensity: 0.75 + m_ShadowVolumeIntensityEnabled: 0 + m_ShadowVolumeIntensity: 0.75 + m_Vertices: + - position: {x: 0.9985302, y: 0.9985302, z: 0} + color: {r: 0.70710677, g: 0.70710677, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: 0.9985302, y: 0.9985302, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: -0.9985302, y: 0.9985302, z: 0} + color: {r: -0.70710677, g: 0.70710677, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: -0.9985302, y: 0.9985302, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: -0.99853003, y: -0.9985304, z: 0} + color: {r: -0.70710665, g: -0.7071069, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: -0.99853003, y: -0.9985304, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: 0.99853003, y: -0.9985304, z: 0} + color: {r: 0.70710665, g: -0.7071069, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: 0.99853003, y: -0.9985304, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: 0, y: 0, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + m_Triangles: 030001000800020000000100030002000100050003000800040002000300050004000300070005000800060004000500070006000500010007000800000006000700010000000700 + m_LocalBounds: + m_Center: {x: 0, y: -0.00000011920929, z: 0} + m_Extent: {x: 0.9985302, y: 0.99853027, z: 0} + m_PointLightInnerAngle: 360 + m_PointLightOuterAngle: 360 + m_PointLightInnerRadius: 0 + m_PointLightOuterRadius: 1 + m_ShapeLightParametricSides: 5 + m_ShapeLightParametricAngleOffset: 0 + m_ShapeLightParametricRadius: 1 + m_ShapeLightFalloffSize: 0.5 + m_ShapeLightFalloffOffset: {x: 0, y: 0} + m_ShapePath: + - {x: -0.5, y: -0.5, z: 0} + - {x: 0.5, y: -0.5, z: 0} + - {x: 0.5, y: 0.5, z: 0} + - {x: -0.5, y: 0.5, z: 0} +--- !u!4 &1716733313 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1716733311} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 14.737242, y: -6.2604756, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1745017813 GameObject: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Scenes/Test1.unity b/Unity/Assets/Scenes/Test1.unity index b7bdc84..6be598d 100644 --- a/Unity/Assets/Scenes/Test1.unity +++ b/Unity/Assets/Scenes/Test1.unity @@ -129,20 +129,6 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 495239127} m_PrefabAsset: {fileID: 0} ---- !u!114 &163496198 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 163496197} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9d852fd958405824f8fe3160d0675dc7, type: 3} - m_Name: - m_EditorClassIdentifier: - Button: {fileID: 2100162353} - UICamera: {fileID: 1657489124} --- !u!1 &182378385 GameObject: m_ObjectHideFlags: 0 @@ -329,7 +315,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 374868c26a9f55b4397a7e73227f54f3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -855,6 +841,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -922,7 +909,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: badf0bc51a380c3459c4ed2208ace14c, type: 3} m_Name: m_EditorClassIdentifier: - agent: {fileID: 0} + agent: {fileID: 804818790} showPath: 1 showAhead: 1 startPos: {x: -13, y: 13, z: 0} @@ -969,6 +956,90 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &820877422 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 820877424} + - component: {fileID: 820877423} + m_Layer: 0 + m_Name: Square + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &820877423 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820877422} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 802e1eafac60ee044aed8fc50fe0e7b1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 567e4e010f776a84992e60db2cefb3a5, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &820877424 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820877422} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.051148, y: 2.9641755, z: 0.13021202} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &881259395 GameObject: m_ObjectHideFlags: 0 @@ -1160,6 +1231,117 @@ Transform: type: 3} m_PrefabInstance: {fileID: 916373098} m_PrefabAsset: {fileID: 0} +--- !u!1 &956136492 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 956136494} + - component: {fileID: 956136493} + m_Layer: 0 + m_Name: Light 2D + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &956136493 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 956136492} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ComponentVersion: 1 + m_LightType: 4 + m_BlendStyleIndex: 0 + m_FalloffIntensity: 0.5 + m_Color: {r: 0.5660378, g: 0.5326079, b: 0.018155891, a: 1} + m_Intensity: 1 + m_LightVolumeIntensity: 1 + m_LightVolumeIntensityEnabled: 0 + m_ApplyToSortingLayers: 00000000 + m_LightCookieSprite: {fileID: 0} + m_DeprecatedPointLightCookieSprite: {fileID: 0} + m_LightOrder: 0 + m_AlphaBlendOnOverlap: 0 + m_OverlapOperation: 0 + m_NormalMapDistance: 3 + m_NormalMapQuality: 2 + m_UseNormalMap: 0 + m_ShadowIntensityEnabled: 0 + m_ShadowIntensity: 0.75 + m_ShadowVolumeIntensityEnabled: 0 + m_ShadowVolumeIntensity: 0.75 + m_Vertices: + - position: {x: 0.9985302, y: 0.9985302, z: 0} + color: {r: 0.70710677, g: 0.70710677, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: 0.9985302, y: 0.9985302, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: -0.9985302, y: 0.9985302, z: 0} + color: {r: -0.70710677, g: 0.70710677, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: -0.9985302, y: 0.9985302, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: -0.99853003, y: -0.9985304, z: 0} + color: {r: -0.70710665, g: -0.7071069, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: -0.99853003, y: -0.9985304, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: 0.99853003, y: -0.9985304, z: 0} + color: {r: 0.70710665, g: -0.7071069, b: 0, a: 0} + uv: {x: 0, y: 0} + - position: {x: 0.99853003, y: -0.9985304, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + - position: {x: 0, y: 0, z: 0} + color: {r: 0, g: 0, b: 0, a: 1} + uv: {x: 0, y: 0} + m_Triangles: 030001000800020000000100030002000100050003000800040002000300050004000300070005000800060004000500070006000500010007000800000006000700010000000700 + m_LocalBounds: + m_Center: {x: 0, y: -0.00000011920929, z: 0} + m_Extent: {x: 0.9985302, y: 0.99853027, z: 0} + m_PointLightInnerAngle: 360 + m_PointLightOuterAngle: 360 + m_PointLightInnerRadius: 0 + m_PointLightOuterRadius: 1 + m_ShapeLightParametricSides: 5 + m_ShapeLightParametricAngleOffset: 0 + m_ShapeLightParametricRadius: 1 + m_ShapeLightFalloffSize: 0.5 + m_ShapeLightFalloffOffset: {x: 0, y: 0} + m_ShapePath: + - {x: -0.5, y: -0.5, z: 0} + - {x: 0.5, y: -0.5, z: 0} + - {x: 0.5, y: 0.5, z: 0} + - {x: -0.5, y: 0.5, z: 0} +--- !u!4 &956136494 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 956136492} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -3.2926667, y: 9.756262, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &975978556 GameObject: m_ObjectHideFlags: 0 @@ -1320,6 +1502,80 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1001 &1056434959 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1245791165} + m_Modifications: + - target: {fileID: 2499420514611908718, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 760052f9f92321d44839e8d3342dac3c, type: 2} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalPosition.x + value: 13.87 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalPosition.y + value: -10.4 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5770049575758657351, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + propertyPath: m_Name + value: Build_1004 (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7a8980f9cdf96e342b4535db35a06a19, type: 3} --- !u!1 &1109141519 GameObject: m_ObjectHideFlags: 0 @@ -1465,6 +1721,7 @@ Transform: - {fileID: 1223508469} - {fileID: 306966974} - {fileID: 1109141520} + - {fileID: 1671077667} m_Father: {fileID: 2124408459} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} @@ -1538,7 +1795,7 @@ SpriteRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 374868c26a9f55b4397a7e73227f54f3, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1773,7 +2030,7 @@ Camera: m_Depth: 0 m_CullingMask: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 32 m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 @@ -1954,6 +2211,32 @@ PlayableDirector: value: {fileID: 1658377967} m_ExposedReferences: m_References: [] +--- !u!1 &1671077666 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5770049575758657351, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + m_PrefabInstance: {fileID: 1056434959} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1671077667 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 5770049575758657344, guid: 7a8980f9cdf96e342b4535db35a06a19, + type: 3} + m_PrefabInstance: {fileID: 1056434959} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1671077668 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1671077666} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9d852fd958405824f8fe3160d0675dc7, type: 3} + m_Name: + m_EditorClassIdentifier: + Button: {fileID: 432564911} + UICamera: {fileID: 1657489124} --- !u!1001 &1762734888 PrefabInstance: m_ObjectHideFlags: 0 @@ -2023,6 +2306,90 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 7a8980f9cdf96e342b4535db35a06a19, type: 3} +--- !u!1 &1817334171 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1817334173} + - component: {fileID: 1817334172} + m_Layer: 0 + m_Name: Square (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1817334172 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1817334171} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 802e1eafac60ee044aed8fc50fe0e7b1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: cc09b59e5824fd5488c4f73b29ada014, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &1817334173 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1817334171} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.051148, y: -0.54, z: 0.13021202} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1966983756 stripped Transform: m_CorrespondingSourceObject: {fileID: 5770049575758657344, guid: 146d2405be29b1e4497fb454ac830dc9, @@ -2299,7 +2666,7 @@ MonoBehaviour: m_OverrideTileSize: 0 m_TileSize: 256 m_OverrideVoxelSize: 0 - m_VoxelSize: 0.033333335 + m_VoxelSize: 0.16666667 m_BuildHeightMesh: 0 m_HideEditorLogs: 0 m_NavMeshData: {fileID: 23800000, guid: d5619753999409f4b86af078c3f3050a, type: 2} diff --git a/Unity/Assets/Scripts/Test/TestBounds.cs b/Unity/Assets/Scripts/Test/TestBounds.cs index 86fb9ed..f0ddf73 100644 --- a/Unity/Assets/Scripts/Test/TestBounds.cs +++ b/Unity/Assets/Scripts/Test/TestBounds.cs @@ -8,10 +8,22 @@ public class TestBounds : MonoBehaviour private SpriteRenderer sprRender; public GameObject Button; public Camera UICamera; + + private Material selectMat; + private Material sharedMat; // Start is called before the first frame update void Start() { sprRender = this.GetComponentInChildren(); + sharedMat = sprRender.sharedMaterial; + selectMat = new Material(Shader.Find("PeachValley/GameObject")); + Debug.LogError($"mat same with ori shared:{selectMat == sharedMat }"); + Debug.LogError($"shared same with mat:{selectMat == sprRender.sharedMaterial }"); + + // sprRender.material = sharedMat; + //Debug.LogError($"after sharedMat: {sprRender.material == sprRender.sharedMaterial }"); + Debug.LogError("============"); + //Debug.LogError(sprRender.sprite.border); //Debug.LogError(sprRender.sprite.bounds); //Debug.LogError(sprRender.bounds); @@ -21,13 +33,13 @@ public class TestBounds : MonoBehaviour Vector2 minPos = sprRender.transform.TransformPoint(bounds.center - new Vector3(bounds.extents.x - border.x / sprRender.sprite.pixelsPerUnit, bounds.extents.y - border.y / sprRender.sprite.pixelsPerUnit)); Vector2 maxPos = sprRender.transform.TransformPoint(bounds.center + new Vector3(bounds.extents.x - border.z / sprRender.sprite.pixelsPerUnit, bounds.extents.y - border.w / sprRender.sprite.pixelsPerUnit)); Vector2 midPos = (minPos + maxPos) / 2; - Debug.LogError("worldPos:" + minPos + "|" + maxPos); + //Debug.LogError("worldPos:" + minPos + "|" + maxPos); Vector2 midLeft = new Vector2(minPos.x, midPos.y); //minPos = RectTransformUtility.WorldToScreenPoint(UICamera, minPos); - Debug.LogError("screenPos:" + minPos + "|" + maxPos); + //Debug.LogError("screenPos:" + minPos + "|" + maxPos); // minPos = Canvas.transform.TransformPoint(minPos); - Debug.LogError("uiPos:" + minPos + "|" + maxPos); + //Debug.LogError("uiPos:" + minPos + "|" + maxPos); var trans = Button.GetComponent(); //trans.anchoredPosition = trans.InverseTransformPoint(minPos); trans.position = midLeft; @@ -36,12 +48,31 @@ public class TestBounds : MonoBehaviour // Update is called once per frame void Update() { - + if (Input.GetKeyUp(KeyCode.K)) + { + if (sprRender != null) + { + selectMat.EnableKeyword("_EFFECT_EDGE_ON"); + sprRender.material = selectMat; + if (sprRender.material == selectMat) + { + Debug.LogError("Same mat"); + } + // sprRender.material.EnableKeyword("_EFFECT_EDGE_ON"); + } + + } + + if (Input.GetKeyUp(KeyCode.L)) + { + // sprRender.material.DisableKeyword("_EFFECT_EDGE_ON"); + sprRender.sharedMaterial = sharedMat; + } } void OnDrawGizmos() { - sprRender = this.GetComponent(); + // sprRender = this.GetComponent(); if (sprRender != null) { Bounds bounds = sprRender.sprite.bounds; diff --git a/Unity/Codes/Hotfix/Demo/Resource/ResourcePointComponentSystem.cs b/Unity/Codes/Hotfix/Demo/Resource/ResourcePointComponentSystem.cs index 2ab3370..338c8d3 100644 --- a/Unity/Codes/Hotfix/Demo/Resource/ResourcePointComponentSystem.cs +++ b/Unity/Codes/Hotfix/Demo/Resource/ResourcePointComponentSystem.cs @@ -72,6 +72,10 @@ namespace ET List extraOuts = new List(); foreach (var v in resConfig.ExtraOut) { + if (v == 0) + { + continue; + } var extraoutConfig = ExtraOutputConfigCategory.Instance.Get(v); if (extraoutConfig != null) { diff --git a/Unity/Codes/Hotfix/Demo/Unit/UnitHelper.cs b/Unity/Codes/Hotfix/Demo/Unit/UnitHelper.cs index cca0a98..dd17fca 100644 --- a/Unity/Codes/Hotfix/Demo/Unit/UnitHelper.cs +++ b/Unity/Codes/Hotfix/Demo/Unit/UnitHelper.cs @@ -73,7 +73,7 @@ namespace ET List nightEvents = null; if (unit.EventSeed > 0) { - SeasonConfig lastSeasonConfig = UnitOperate.GetSeasonConfigByDay(unit.Day-1); + SeasonConfig lastSeasonConfig = UnitOperate.GetSeasonConfigByDay(unit.Day-1, unit.Season); int nightTime = UnitOperate.CheckMoonNightTime(unit.Day-1, lastSeasonConfig.DayTime[1]); nightEvents = UnitOperate.NightEvent(unit, nightTime, unit.SeasonConfig.DayTime[0]); diff --git a/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs b/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs index 21de7aa..77ec39a 100644 --- a/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs @@ -1,4 +1,5 @@ -using FairyGUI; +using ET.Util; +using FairyGUI; using UnityEngine; using UnityEngine.EventSystems; @@ -41,7 +42,7 @@ namespace ET public static void CreateBuilding(this BuildingViewComponent self, Building buildingInfo) { - self.buildingInfo = buildingInfo; + self.BuildingInfo = buildingInfo; var buildingConfig = StructureConfigCategory.Instance.Get(buildingInfo.ConfigId); // 在地图中创建建筑实例 @@ -52,6 +53,8 @@ namespace ET self.BuildingRoot = building; var sprRender = self.BuildingRoot.transform.Find("Build_Base").GetComponent(); + self.SharedMat = sprRender.sharedMaterial; + self.BuildingSprRenderer = sprRender; Vector2Int size = mapComp.GetSizeBySpriteCollider(sprRender); #if CLIENTTEST var indicator = BuildingViewHelper.CreateOcupyPlaceInicator("OccupyPlaceInidcator", new Color(1, 0, 0, 0.3f)); @@ -82,7 +85,7 @@ namespace ET { self.RemoveBuilding(); - self.CreateBuilding(self.buildingInfo); + self.CreateBuilding(self.BuildingInfo); } public static void OnSpriteClicked(this BuildingViewComponent self, BuildingViewComponent buildingViewComponent) @@ -99,7 +102,7 @@ namespace ET return; } - var buildingInfo = buildingViewComponent.buildingInfo; + var buildingInfo = buildingViewComponent.BuildingInfo; //根据不同的建筑类型打开不同的界面 StructureConfig structureConfig = StructureConfigCategory.Instance.Get(buildingInfo.ConfigId); @@ -148,6 +151,24 @@ namespace ET { return self.BuildingRoot.transform.position; } + + public static void HighlightBuilding(this BuildingViewComponent self, bool withEdge) + { + if (withEdge) + { + self.BuildingSprRenderer.material = MaterialHelper.Instance.EdgeHighlightMat; + } + else + { + self.BuildingSprRenderer.material = MaterialHelper.Instance.HighlightMat; + } + + } + + public static void NormalBuilding(this BuildingViewComponent self) + { + self.BuildingSprRenderer.sharedMaterial = self.SharedMat; + } public static void Destroy(this BuildingViewComponent self) { @@ -191,11 +212,11 @@ namespace ET public static async ETTask CreateName(this BuildingViewComponent self) { FUI_BuildingName nameEntity = - await FUIHelper.CreateInstanceAsync(self.buildingInfo, FUI_BuildingName.UIPackageName, FUI_BuildingName.UIResName); + await FUIHelper.CreateInstanceAsync(self.BuildingInfo, FUI_BuildingName.UIPackageName, FUI_BuildingName.UIResName); FUIUnitNamePanelComponent unitNamePanelComponent = FUIComponent.Instance.GetUI(FUI_UnitNamePanel.UIResName) as FUIUnitNamePanelComponent; unitNamePanelComponent.FUIUnitNamePanel.FGComp.AddChild(nameEntity.FGComp); - var buildingConfig = StructureConfigCategory.Instance.Get(self.buildingInfo.ConfigId); + var buildingConfig = StructureConfigCategory.Instance.Get(self.BuildingInfo.ConfigId); nameEntity.m_Name.text = buildingConfig.Name; self.UnitName = nameEntity; diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingSelectWorkerWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingSelectWorkerWindowComponentSystem.cs index b2eb2d4..82ad73e 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingSelectWorkerWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingSelectWorkerWindowComponentSystem.cs @@ -55,7 +55,7 @@ namespace ET BuildingWorkerItem item = (BuildingWorkerItem) list.AddItemFromPool(); item.SetName(people.Name); var gender = people.GetGender(); - var strength = people.GetStrength(); + var strength = people.GetLabor(); item.SetIcon(PeopleViewHelper.GetHeadIconUrlByGender(gender)); item.SetStrength(strength); diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIFarmlandWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIFarmlandWindowComponentSystem.cs index 0854043..3c0038f 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIFarmlandWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIFarmlandWindowComponentSystem.cs @@ -25,7 +25,9 @@ namespace ET public static void Awake(this FUIFarmlandWindowComponent self) { self.FUIFarmlandWindow = self.Parent.GetComponent(); - self.Window = new Window(); + var win = new FUIFarmlandWindow(); + win.OnWindowHide = self.OnHide; + self.Window = win; self.Window.contentPane = self.FUIFarmlandWindow.FGComp; UIObjectFactory.SetPackageItemExtension(FUIPackage.Building_PlantSeedItem, typeof(PlantSeedItem)); @@ -51,6 +53,11 @@ namespace ET Log.Error($"Building [{self.Building.Id}] doesn't have a Farmland"); return; } + + // highlight + var buildingView = self.Building.GetComponent(); + buildingView?.HighlightBuilding(true); + self.FUIFarmlandWindow.m_farmlandState.selectedIndex = self.Farmland.FarmlandState; @@ -333,6 +340,12 @@ namespace ET self.Window.Hide(); } + public static void OnHide(this FUIFarmlandWindowComponent self) + { + var buildingView = self.Building.GetComponent(); + buildingView?.NormalBuilding(); + } + public static void OnCloseButtonClick(this FUIFarmlandWindowComponent self) { self.Window.Hide(); diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Main/FUIMainComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Main/FUIMainComponentSystem.cs index 30d9785..1d8ea81 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Main/FUIMainComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Main/FUIMainComponentSystem.cs @@ -139,9 +139,7 @@ namespace ET var seasonBtn = self.FUIMain.m_SeasonBtn; int season = unit.Season; SeasonConfig seasonConfig = SeasonConfigCategory.Instance.Get(season); - int DaysCountOfYear = SeasonConfigCategory.Instance.Get(1).Duration + - SeasonConfigCategory.Instance.Get(2).Duration + SeasonConfigCategory.Instance.Get(3).Duration + - SeasonConfigCategory.Instance.Get(4).Duration; + int seasonDay = WorldParametersConfigCategory.Instance.Get(WorldParam.SeasonDay).Value[0]; string seasonName = seasonConfig.Name; ; string fColor = string.Empty; @@ -174,13 +172,9 @@ namespace ET ColorUtility.TryParseHtmlString(bColor, out Color backColor); seasonBtn.m_Back.color = backColor; seasonBtn.m_Name.text = seasonName; - int seasonDayRemain = (unit.Day - 1) % DaysCountOfYear; - int seasonPassDays = 0; - for(int i = 1; i < season; i++) - { - seasonPassDays += SeasonConfigCategory.Instance.Get(i).Duration; - } - float fillAmount = (float)(seasonDayRemain - seasonPassDays) / (float)seasonConfig.Duration; + int seasonDayRemain = seasonDay - (unit.Day - 1) % seasonDay; + + float fillAmount = (float)(seasonDayRemain) / seasonDay; seasonBtn.m_Front.fillAmount = 1 - fillAmount; } @@ -224,9 +218,7 @@ namespace ET var seasonBtn = com.m_SeasonBtn; int season = unit.Season; SeasonConfig seasonConfig = SeasonConfigCategory.Instance.Get(season); - int DaysCountOfYear = SeasonConfigCategory.Instance.Get(1).Duration + - SeasonConfigCategory.Instance.Get(2).Duration + SeasonConfigCategory.Instance.Get(3).Duration + - SeasonConfigCategory.Instance.Get(4).Duration; + int seasonDay = WorldParametersConfigCategory.Instance.Get(WorldParam.SeasonDay).Value[0]; string seasonName = seasonConfig.Name; ; @@ -261,17 +253,13 @@ namespace ET seasonBtn.m_Back.color = backColor; seasonBtn.m_Name.text = seasonName; - int seasonDayRemain = (unit.Day - 1) % DaysCountOfYear; - int seasonPassDays = 0; - for (int i = 1; i < season; i++) - { - seasonPassDays += SeasonConfigCategory.Instance.Get(i).Duration; - } - float fillAmount = (float)(seasonDayRemain - seasonPassDays) / (float)seasonConfig.Duration; + int seasonDayRemain = seasonDay - (unit.Day - 1) % seasonDay; + + float fillAmount = seasonDayRemain / (float)seasonDay; seasonBtn.m_Front.fillAmount = 1 - fillAmount; com.m_closeBtn.FGComp.onClick.Set(() => { com.Visible = false; }); - com.m_SeasonChangeRemainTxt.SetVar("value", (seasonConfig.Duration - (seasonDayRemain - seasonPassDays)).ToString()).FlushVars(); + com.m_SeasonChangeRemainTxt.SetVar("value", (seasonDayRemain).ToString()).FlushVars(); var crops = CropConfigCategory.Instance.GetAllSeasonCrop(season); com.m_ItemList.RemoveChildrenToPool(); foreach(var c in crops) diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUILineupWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUILineupWindowComponentSystem.cs index 251cf38..fe82b84 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUILineupWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUILineupWindowComponentSystem.cs @@ -122,8 +122,7 @@ namespace ET item.SetName(people.Name); item.SetIcon(PeopleViewHelper.GetHeadIconUrlByGender(people.GetGender())); var numeric = people.GetComponent(); - int strengh = numeric.GetAsInt(NumericType.Strength); - item.SetFightPoint(strengh); + item.SetFightPoint(people.Labor); if (fightSeatMap.ContainsKey(people.Id)) { diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPartnerListWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPartnerListWindowComponentSystem.cs index 3807b18..e94f278 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPartnerListWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPartnerListWindowComponentSystem.cs @@ -77,8 +77,7 @@ namespace ET var numeric = people.GetComponent(); int age = numeric.GetAsInt(NumericType.Age); item.SetAge(age); - int strengh = numeric.GetAsInt(NumericType.Strength); - item.SetStrength(strengh); + item.SetStrength(people.Labor); } self.FUIPartnerListWindow.m_PeopleNum.text = peopleComp.Children.Count.ToString(); diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPeopleListWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPeopleListWindowComponentSystem.cs index 887b6c5..21eecac 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPeopleListWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/People/FUIPeopleListWindowComponentSystem.cs @@ -74,8 +74,7 @@ namespace ET var numeric = people.GetComponent(); int age = numeric.GetAsInt(NumericType.Age); item.SetAge(age); - int strengh = numeric.GetAsInt(NumericType.Strength); - item.SetStrength(strengh); + item.SetStrength(people.Labor); } self.FUIPeopleListWindow.m_PeopleNum.text = peopleComp.Children.Count.ToString(); diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUIResourceWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUIResourceWindowComponentSystem.cs index 4bf6a29..72cebf0 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUIResourceWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUIResourceWindowComponentSystem.cs @@ -171,18 +171,20 @@ namespace ET } // 額外產出 - if (resourceConfig.ExtraOut > 0) + if (resourceConfig.ExtraOut.Length > 0) { - var dropConfig = DropGroupConfigCategory.Instance.Get(resourceConfig.ExtraOut); - - for (int i = 0; i < dropConfig.ItemId.Length; i++) + for (int i = 0; i < resourceConfig.ExtraOut.Length; i++) { - var itemId = dropConfig.ItemId[i]; + var extraOutputConfig = ExtraOutputConfigCategory.Instance.Get(resourceConfig.ExtraOut[i]); + // var dropConfig = DropGroupConfigCategory.Instance.Get(extraOutputConfig.ItemId); + + var itemId = extraOutputConfig.ItemId; var itemData = AllItemConfigCategory.Instance.Get(itemId); - + var item = (ProduceItem) list.AddItemFromPool(); item.SetIcon($"ui://AllItem/{itemData.Icon}"); - item.SetDropRate(dropConfig.DropDescription[i]); + item.SetDropRate(extraOutputConfig.DropDescription); + } } diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUISelectWorkerWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUISelectWorkerWindowComponentSystem.cs index 0b4a8fc..4e22408 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUISelectWorkerWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Resource/FUISelectWorkerWindowComponentSystem.cs @@ -83,7 +83,7 @@ namespace ET FUIResource.PeopleItem item = (FUIResource.PeopleItem) list.AddItemFromPool(); item.SetName(people.Name); item.SetIcon(PeopleViewHelper.GetHeadIconUrlByGender(people.GetGender())); - item.SetStrength(people.GetStrength()); + item.SetStrength(people.Labor); item.WorkingCheckBox.data = people.Id; item.WorkingCheckBox.onClick.Remove(self.OnPeopleItemCheckBoxClick); @@ -120,7 +120,7 @@ namespace ET return -1; } - if (x.GetStrength() > y.GetStrength()) + if (x.Labor > y.Labor) { return -1; } diff --git a/Unity/Codes/ModelView/Demo/Building/BuildingViewComponent.cs b/Unity/Codes/ModelView/Demo/Building/BuildingViewComponent.cs index 3c52228..dcda47e 100644 --- a/Unity/Codes/ModelView/Demo/Building/BuildingViewComponent.cs +++ b/Unity/Codes/ModelView/Demo/Building/BuildingViewComponent.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.UI; namespace ET @@ -8,7 +9,9 @@ namespace ET public class BuildingViewComponent : Entity, IAwake, IDestroy { public GameObject BuildingRoot; - public Building buildingInfo; + public Building BuildingInfo; public FUI_BuildingName UnitName; + public Material SharedMat; + public SpriteRenderer BuildingSprRenderer; } } \ No newline at end of file diff --git a/Unity/Codes/ModelView/Demo/FUI/Logic/Building/FUIFarmlandWindow.cs b/Unity/Codes/ModelView/Demo/FUI/Logic/Building/FUIFarmlandWindow.cs new file mode 100644 index 0000000..82cb9d2 --- /dev/null +++ b/Unity/Codes/ModelView/Demo/FUI/Logic/Building/FUIFarmlandWindow.cs @@ -0,0 +1,21 @@ +using System; +using FairyGUI; + +namespace ET +{ + public class FUIFarmlandWindow: Window + { + public Action OnWindowShow; + public Action OnWindowHide; + + protected override void OnShown() + { + this.OnWindowShow?.Invoke(); + } + + protected override void OnHide() + { + this.OnWindowHide?.Invoke(); + } + } +} \ No newline at end of file diff --git a/Unity/Codes/ModelView/Demo/Util/MaterialHelper.cs b/Unity/Codes/ModelView/Demo/Util/MaterialHelper.cs new file mode 100644 index 0000000..fab7e9e --- /dev/null +++ b/Unity/Codes/ModelView/Demo/Util/MaterialHelper.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace ET.Util +{ + public class MaterialHelper : SingletonBase + { + public Material EdgeHighlightMat { get; } + public Material HighlightMat { get; } + public MaterialHelper() + { + this.EdgeHighlightMat = new Material(Shader.Find("PeachValley/GameObject")); + this.EdgeHighlightMat.EnableKeyword("_EFFECT_EDGE_ON"); + this.EdgeHighlightMat.EnableKeyword("_EFFECT_HIGHLIGHT_ON"); + + this.HighlightMat = new Material(Shader.Find("PeachValley/GameObject")); + this.HighlightMat.EnableKeyword("_EFFECT_HIGHLIGHT_ON"); + } + + + } +} \ No newline at end of file diff --git a/Unity/Codes/ModelView/Demo/Util/SingletonBase.cs b/Unity/Codes/ModelView/Demo/Util/SingletonBase.cs new file mode 100644 index 0000000..f8ca8c0 --- /dev/null +++ b/Unity/Codes/ModelView/Demo/Util/SingletonBase.cs @@ -0,0 +1,44 @@ +namespace ET.Util +{ + using System; + /// + /// A base class for the singleton design pattern. + /// https://www.codeproject.com/Articles/572263/A-Reusable-Base-Class-for-the-Singleton-Pattern-in + /// + /// Class type of the singleton + public abstract class SingletonBase where T : class + { + #region Members + + /// + /// Static instance. Needs to use lambda expression + /// to construct an instance (since constructor is private). + /// + private static readonly Lazy sInstance = new Lazy(() => CreateInstanceOfT()); + + #endregion + + #region Properties + + /// + /// Gets the instance of this singleton. + /// + public static T Instance { get { return sInstance.Value; } } + + #endregion + + #region Methods + + /// + /// Creates an instance of T via reflection since T's constructor is expected to be private. + /// + /// + private static T CreateInstanceOfT() + { + return Activator.CreateInstance(typeof(T)) as T; + //return new T(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Unity/UserSettings/EditorUserSettings.asset b/Unity/UserSettings/EditorUserSettings.asset index 5d0b501..84cb5e9 100644 --- a/Unity/UserSettings/EditorUserSettings.asset +++ b/Unity/UserSettings/EditorUserSettings.asset @@ -6,9 +6,12 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: RecentlyUsedSceneGuid-0: - value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661 + value: 5300035f500d0a5e095e5f7743710744104e4179782d7536787c4a62e4b76660 flags: 0 RecentlyUsedSceneGuid-1: + value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661 + flags: 0 + RecentlyUsedSceneGuid-2: value: 060150505c040858550d5d2640770a441416487d7c707f352c714f63e7b16c39 flags: 0 RecentlyUsedScenePath-0: