Init Unity版本 6000.0.23f1c1

HDRP
Yogi 2024-12-31 07:57:41 +08:00
commit 7f58cd1c12
1822 changed files with 253708 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.idea
Build
Library
Logs
obj
*.csproj
*.sln
*.user

8
Assets/Arts.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5b5f9c109691279469df98e7f2e6ee8e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37d520bea0c9daa48a3a04ffc74f5865
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 36e6481b16331794cbd46b1f86cdb219
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,110 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8729050262684240331
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3817333353599203533}
- component: {fileID: 2721348464505316384}
- component: {fileID: 7153230257770310704}
- component: {fileID: 1898610091471607134}
m_Layer: 0
m_Name: "\u4FDD\u9669\u67601"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3817333353599203533
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8729050262684240331}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.034491, y: 0.028, z: -0.926}
m_LocalScale: {x: 1.6917, y: 0.46696, z: 0.06737}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2721348464505316384
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8729050262684240331}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7153230257770310704
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8729050262684240331}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &1898610091471607134
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8729050262684240331}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1d81c16b3133fec42a98832910ac721e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,110 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6538522356440653705
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8366681996491677770}
- component: {fileID: 5511656578493725797}
- component: {fileID: 5979834490944393580}
- component: {fileID: 6824825788240579138}
m_Layer: 0
m_Name: "\u4FDD\u9669\u67602"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8366681996491677770
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6538522356440653705}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.034491, y: 0.028, z: -0.926}
m_LocalScale: {x: 0.43926683, y: 1.4497708, z: 0.06737}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5511656578493725797
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6538522356440653705}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5979834490944393580
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6538522356440653705}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &6824825788240579138
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6538522356440653705}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9e0430102152bec42929fe0559beede8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,110 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7915625747940479661
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 953556627626518086}
- component: {fileID: 8936041801035788155}
- component: {fileID: 1159967168167609453}
- component: {fileID: 345876280325773105}
m_Layer: 0
m_Name: "\u4FDD\u9669\u67603"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &953556627626518086
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7915625747940479661}
serializedVersion: 2
m_LocalRotation: {x: 0.34784186, y: -0, z: -0, w: 0.9375533}
m_LocalPosition: {x: -0.034491, y: 0.062, z: -1.137}
m_LocalScale: {x: 1.0044645, y: 1.0294595, z: 0.047838375}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 40.711, y: 0, z: 0}
--- !u!33 &8936041801035788155
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7915625747940479661}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1159967168167609453
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7915625747940479661}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &345876280325773105
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7915625747940479661}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d1aeb4ddfb97b9842a233b236019323e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cb6e49d7ddd743e489ef2387292bc459
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,251 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2836643744858358441
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2622387246710251441}
m_Layer: 0
m_Name: "\u5927\u706F1"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2622387246710251441
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2836643744858358441}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5092590152847301872}
- {fileID: 47090732443438019}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3407114245336825118
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 47090732443438019}
- component: {fileID: 6926537021829943342}
- component: {fileID: 3440670087938534928}
- component: {fileID: 5523250416245451303}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &47090732443438019
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3407114245336825118}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.3, y: -0.1403, z: -1.47}
m_LocalScale: {x: 0.19671, y: 0.4359, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2622387246710251441}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &6926537021829943342
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3407114245336825118}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3440670087938534928
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3407114245336825118}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &5523250416245451303
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3407114245336825118}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5114603018258653860
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5092590152847301872}
- component: {fileID: 3762432253997759379}
- component: {fileID: 4977073708467478629}
- component: {fileID: 888993440606337640}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5092590152847301872
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5114603018258653860}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.3, y: -0.1403, z: -1.47}
m_LocalScale: {x: 0.19671, y: 0.4359, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2622387246710251441}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3762432253997759379
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5114603018258653860}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &4977073708467478629
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5114603018258653860}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &888993440606337640
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5114603018258653860}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f593447bff262f445bf79820c06c7ae3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,251 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2734058483737405636
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1945601191677369743}
- component: {fileID: 8016999804317505148}
- component: {fileID: 463074662768485204}
- component: {fileID: 3830298357347426209}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1945601191677369743
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2734058483737405636}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.3, y: -0.08, z: -2}
m_LocalScale: {x: 0.19671, y: 0.4359, z: 2.7241}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6160471487404913244}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8016999804317505148
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2734058483737405636}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &463074662768485204
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2734058483737405636}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &3830298357347426209
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2734058483737405636}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5361388424918231561
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6160471487404913244}
m_Layer: 0
m_Name: "\u5927\u706F2"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6160471487404913244
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5361388424918231561}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3531134775692950512}
- {fileID: 1945601191677369743}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7995303746868895120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3531134775692950512}
- component: {fileID: 7004231417369805366}
- component: {fileID: 986089420828756516}
- component: {fileID: 5515566210146706795}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3531134775692950512
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7995303746868895120}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.3, y: -0.08, z: -2}
m_LocalScale: {x: 0.19671, y: 0.4359, z: 2.7241}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6160471487404913244}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7004231417369805366
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7995303746868895120}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &986089420828756516
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7995303746868895120}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &5515566210146706795
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7995303746868895120}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 13191f8124a0482449e13beea2c97b7c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,687 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &743398850354305330
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1975701403500750431}
- component: {fileID: 8331174040670672174}
- component: {fileID: 812487891612308359}
- component: {fileID: 4787702628110640041}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1975701403500750431
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 743398850354305330}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 0.5705829, z: 1.6870351}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8331174040670672174
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 743398850354305330}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &812487891612308359
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 743398850354305330}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &4787702628110640041
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 743398850354305330}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &1562487491007683774
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 839273982319164524}
- component: {fileID: 7786303252107695198}
- component: {fileID: 8737942960087159947}
- component: {fileID: 217347730897908550}
m_Layer: 0
m_Name: Sphere (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &839273982319164524
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1562487491007683774}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.477, y: -0.062, z: 0.463}
m_LocalScale: {x: 0.63761, y: 0.63761, z: 0.63761}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7786303252107695198
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1562487491007683774}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8737942960087159947
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1562487491007683774}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &217347730897908550
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1562487491007683774}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4111724788997106916
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7989348578916046893}
- component: {fileID: 5073207578323358541}
- component: {fileID: 5293656176178131021}
- component: {fileID: 3675459354289399065}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7989348578916046893
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4111724788997106916}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.443, z: 0}
m_LocalScale: {x: 0.57574, y: 0.3285074, z: 0.8785216}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5073207578323358541
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4111724788997106916}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5293656176178131021
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4111724788997106916}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &3675459354289399065
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4111724788997106916}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &5874664059258362291
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1707754338300489927}
- component: {fileID: 3212858874841435903}
- component: {fileID: 4797294538925586218}
- component: {fileID: 6155434295770023877}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1707754338300489927
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5874664059258362291}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.477, y: -0.062, z: -0.352}
m_LocalScale: {x: 0.63761, y: 0.63761, z: 0.63761}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3212858874841435903
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5874664059258362291}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &4797294538925586218
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5874664059258362291}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &6155434295770023877
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5874664059258362291}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &6062983469773343518
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 921603864804753574}
- component: {fileID: 9032616016389195750}
- component: {fileID: 2627856456352855071}
- component: {fileID: 447761058457681304}
m_Layer: 0
m_Name: Sphere (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &921603864804753574
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6062983469773343518}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.504, y: -0.062, z: -0.352}
m_LocalScale: {x: 0.63761, y: 0.63761, z: 0.63761}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &9032616016389195750
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6062983469773343518}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2627856456352855071
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6062983469773343518}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &447761058457681304
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6062983469773343518}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &6072157252298873378
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4422242675293561485}
m_Layer: 0
m_Name: "\u6D4B\u8BD5\u8F661"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4422242675293561485
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6072157252298873378}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1975701403500750431}
- {fileID: 7989348578916046893}
- {fileID: 1707754338300489927}
- {fileID: 921603864804753574}
- {fileID: 839273982319164524}
- {fileID: 4114833231948133731}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8507234793163353150
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4114833231948133731}
- component: {fileID: 7250096214773607721}
- component: {fileID: 5985656949839389412}
- component: {fileID: 6535727909997083378}
m_Layer: 0
m_Name: Sphere (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4114833231948133731
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8507234793163353150}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.504, y: -0.062, z: 0.463}
m_LocalScale: {x: 0.63761, y: 0.63761, z: 0.63761}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4422242675293561485}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7250096214773607721
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8507234793163353150}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &5985656949839389412
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8507234793163353150}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &6535727909997083378
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8507234793163353150}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b2d238497c0d790429d005dc5496c276
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 052faaac586de48259a63d0c4782560b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
generateWrapperCode: 0
wrapperCodePath:
wrapperClassName:
wrapperCodeNamespace:

8
Assets/Plugin.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dfe0d98d9bc06864f8d4c0e28a72080e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4cc256d8fbe187b4b8ea77f8596bc708
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 07e8be1800dfbd748b7b867bf3bd8f99
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,13 @@
{
"name": "Aya.DataBinding",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3c6c38e12d753d041943e59345ac5aa9
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7256433a8f8d4ca4089ebb55f93e9c5f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4d5af5d7fb25b534a878401a6b38d4d8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: b07aafae171734f4b837582f4db8e75d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 86304c2d953774e44ab11b48c4cafd53
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
public class BaseBinderEditor : Editor
{
protected void DrawContextKey(SerializedProperty property)
{
if (property.stringValue == DataContext.Default)
{
using (new ColorScope(Color.gray))
{
EditorGUILayout.PropertyField(property);
}
}
else
{
using (new ColorScope(EditorStyle.ErrorColor, () => string.IsNullOrEmpty(property.stringValue)))
{
EditorGUILayout.PropertyField(property);
}
}
}
protected void DrawDataKey(SerializedProperty property)
{
using (new ColorScope(EditorStyle.ErrorColor, () => string.IsNullOrEmpty(property.stringValue)))
{
EditorGUILayout.PropertyField(property);
}
}
protected void DrawDirection(SerializedProperty property)
{
EditorGUILayout.PropertyField(property);
}
protected void DrawTarget<TComponent>(SerializedProperty property, Transform root) where TComponent : Component
{
EditorUtil.ComponentTreeMenu<TComponent>("Target", property, root);
}
public static void DrawTargetAndProperty<TComponent>(string targetPropertyName, SerializedProperty targetProperty, Transform parent, string propertyName, SerializedProperty property) where TComponent : Component
{
var originalTarget = targetProperty.objectReferenceValue;
EditorUtil.ComponentTreeMenu<TComponent>(targetPropertyName, targetProperty, parent, component =>
{
// Auto Bind
var change = originalTarget != targetProperty.objectReferenceValue && targetProperty.objectReferenceValue != null;
if (!change) return;
if (TypeCaches.AutoBindComponentTypeDic.TryGetValue(component.GetType(), out var autoBindPropertyName))
{
property.stringValue = autoBindPropertyName;
property.serializedObject.ApplyModifiedProperties();
}
});
if (targetProperty.objectReferenceValue == null && !string.IsNullOrEmpty(property.stringValue))
{
property.stringValue = "";
}
if (targetProperty.objectReferenceValue != null)
{
var type = targetProperty.objectReferenceValue.GetType();
EditorUtil.PropertyTreeMenu(propertyName, type, property);
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 05df554dd187dda4a9afaa7698bb03da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,57 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
[CustomEditor(typeof(ComponentBinder<,,>)), CanEditMultipleObjects]
public abstract class ComponentBinderEditor<TComponent, TValue, TDataBinder> : BaseBinderEditor
where TDataBinder : DataBinder<TComponent, TValue>, new()
where TComponent : Component
{
public ComponentBinder<TComponent, TValue, TDataBinder> ComponentBinder => target as ComponentBinder<TComponent, TValue, TDataBinder>;
protected SerializedProperty ContextKeyProperty;
protected SerializedProperty DataKeyProperty;
protected SerializedProperty DirectionProperty;
protected SerializedProperty UpdateTypeProperty;
protected SerializedProperty TargetProperty;
public virtual void OnEnable()
{
ContextKeyProperty = serializedObject.FindProperty(nameof(ComponentBinder.Context));
DataKeyProperty = serializedObject.FindProperty(nameof(ComponentBinder.Key));
DirectionProperty = serializedObject.FindProperty(nameof(ComponentBinder.Direction));
UpdateTypeProperty = serializedObject.FindProperty(nameof(ComponentBinder.UpdateType));
TargetProperty = serializedObject.FindProperty(nameof(ComponentBinder.Target));
}
public override void OnInspectorGUI()
{
serializedObject.Update();
DrawContextKey(ContextKeyProperty);
DrawDataKey(DataKeyProperty);
DrawDirection(DirectionProperty);
// Update
if (ComponentBinder.IsSource && ComponentBinder.NeedUpdate)
{
EditorGUILayout.PropertyField(UpdateTypeProperty);
}
DrawTarget<TComponent>(TargetProperty, ComponentBinder.transform);
DrawBody();
serializedObject.ApplyModifiedProperties();
}
public virtual void DrawBody()
{
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fccf6576e59e4124fb426c195911c0eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
[CustomEditor(typeof(PropertyBinder)), CanEditMultipleObjects]
public class PropertyBinderEditor : ComponentBinderEditor<Component, object, RuntimePropertyBinder<Component>>
{
public PropertyBinder PropertyBinder => target as PropertyBinder;
protected SerializedProperty PropertyNameProperty;
public override void OnEnable()
{
base.OnEnable();
PropertyNameProperty = serializedObject.FindProperty("Property");
}
public override void DrawBody()
{
if (PropertyBinder.Target == null)
{
PropertyNameProperty.stringValue = "";
return;
}
var type = PropertyBinder.Target.GetType();
EditorUtil.PropertyTreeMenu("Dst Property", type, PropertyNameProperty);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d4ed128e63c78b41aa63af5aba78828
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,80 @@
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
namespace Aya.DataBinding
{
public class SearchableDropdownItem : AdvancedDropdownItem
{
public object Value;
public SearchableDropdownItem(string name, object value = null) : base(name)
{
Value = value;
}
}
public class SearchableDropdown : AdvancedDropdown
{
public SearchableDropdownItem Root;
public Action<SearchableDropdownItem> OnSelected;
public SearchableDropdown(SearchableDropdownItem root, Action<SearchableDropdownItem> onSelected = null) : base(new AdvancedDropdownState())
{
Root = root;
OnSelected = onSelected;
}
protected override AdvancedDropdownItem BuildRoot()
{
return Root;
}
protected override void ItemSelected(AdvancedDropdownItem item)
{
OnSelected?.Invoke(item as SearchableDropdownItem);
}
}
public static class AdvancedDropdownExtensions
{
public static void Show(this AdvancedDropdown dropdown, Rect buttonRect, float maxHeight)
{
dropdown.Show(buttonRect);
SetMaxHeightForOpenedPopup(buttonRect, maxHeight);
}
private static void SetMaxHeightForOpenedPopup(Rect buttonRect, float maxHeight)
{
var window = EditorWindow.focusedWindow;
if (window == null)
{
Debug.LogWarning("EditorWindow.focusedWindow was null.");
return;
}
if (!string.Equals(window.GetType().Namespace, typeof(AdvancedDropdown).Namespace))
{
Debug.LogWarning("EditorWindow.focusedWindow " + EditorWindow.focusedWindow.GetType().FullName + " was not in expected namespace.");
return;
}
var position = window.position;
if (position.height <= maxHeight)
{
return;
}
position.height = maxHeight;
window.minSize = position.size;
window.maxSize = position.size;
window.position = position;
window.ShowAsDropDown(GUIUtility.GUIToScreenRect(buttonRect), position.size);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6504c86981f0adc4ebb36e7eda799fc0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,105 @@
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
[CustomEditor(typeof(TypeBinder)), CanEditMultipleObjects]
public class TypeBinderEditor : BaseBinderEditor
{
public TypeBinder TypeBinder => target as TypeBinder;
protected SerializedProperty ContextKeyProperty;
protected SerializedProperty DataKeyProperty;
protected SerializedProperty DirectionProperty;
protected SerializedProperty UpdateTypeProperty;
protected SerializedProperty AssemblyProperty;
protected SerializedProperty TypeProperty;
protected SerializedProperty MapProperty;
public virtual void OnEnable()
{
ContextKeyProperty = serializedObject.FindProperty("Context");
DataKeyProperty = serializedObject.FindProperty("Key");
DirectionProperty = serializedObject.FindProperty("Direction");
UpdateTypeProperty = serializedObject.FindProperty("UpdateType");
AssemblyProperty = serializedObject.FindProperty("Assembly");
TypeProperty = serializedObject.FindProperty("Type");
MapProperty = serializedObject.FindProperty("Map");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
DrawContextKey(ContextKeyProperty);
DrawDataKey(DataKeyProperty);
DrawDirection(DirectionProperty);
EditorUtil.AssemblyMenu("Assembly", AssemblyProperty);
EditorUtil.TypeMenu("Type", TypeProperty, AssemblyProperty.stringValue);
var currentType = TypeCaches.GetTypeByName(AssemblyProperty.stringValue, TypeProperty.stringValue);
if (currentType != null)
{
DrawTypeMapList(currentType);
}
else
{
if (TypeBinder.Map.Count > 0)
{
TypeBinder.Map.Clear();
}
}
serializedObject.ApplyModifiedProperties();
}
protected virtual void DrawTypeMapList(Type currentType)
{
var foldOutTitle = "Map [" + TypeBinder.Map.Count + "]";
using (GUIFoldOut.Create(this, foldOutTitle))
{
if (!GUIFoldOut.GetState(this, foldOutTitle)) return;
for (var i = 0; i < TypeBinder.Map.Count; i++)
{
var map = TypeBinder.Map[i];
using (GUIGroup.Create())
{
using (GUIHorizontal.Create())
{
using (GUIVertical.Create())
{
var itemProperty = MapProperty.GetArrayElementAtIndex(i);
var propertyProperty = itemProperty.FindPropertyRelative("Property");
var componentProperty = itemProperty.FindPropertyRelative("Target");
var targetPropertyProperty = itemProperty.FindPropertyRelative("TargetProperty");
EditorUtil.PropertyTreeMenu("Source Prop", currentType, propertyProperty);
DrawTargetAndProperty<Component>("Target", componentProperty, TypeBinder.transform, "Target Prop", targetPropertyProperty);
}
var btnDelete = GUILayout.Button("×", GUILayout.Width(EditorGUIUtility.singleLineHeight));
if (btnDelete)
{
TypeBinder.Map.Remove(map);
}
}
}
EditorUtil.ColorLine(EditorStyle.SplitLineColor, 2);
}
if (GUILayout.Button(""))
{
var map = new TypeBindMap();
TypeBinder.Map.Add(map);
}
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7f5d4507fbb6b4d4ebe9e73c6368755c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 996dea58e5e1c7a40aebe2f58c0ee62f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
public static class EditorStyle
{
public static string NoneStr = "<None>";
public static Color ErrorColor = new Color(1f, 0.5f, 0.5f);
public static Color SplitLineColor = new Color(0f, 0f, 0f, 0.5f);
public static GUIStyle RichLabel
{
get
{
if (_richLabel == null)
{
_richLabel = EditorStyles.label;
_richLabel.richText = true;
}
return _richLabel;
}
}
private static GUIStyle _richLabel;
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0565d5b19117d3e4ab59f58df70f5383
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,336 @@
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace Aya.DataBinding
{
public static class EditorUtil
{
#region Assembly & Type
public static SearchableDropdownItem CreateAssemblyMenu()
{
var root = new SearchableDropdownItem("Assembly");
root.AddChild(new SearchableDropdownItem(EditorStyle.NoneStr, null));
root.AddSeparator();
var assemblies = TypeCaches.Assemblies;
foreach (var assembly in assemblies)
{
var assemblyName = assembly.GetName().Name;
var child = new SearchableDropdownItem(assemblyName, assemblyName);
root.AddChild(child);
}
return root;
}
public static void AssemblyMenu(string propertyName, SerializedProperty property, Action<Assembly> onClick = null)
{
var root = CreateAssemblyMenu();
bool CheckNullFunc() => TypeCaches.GetAssemblyByName(property.stringValue) == null;
void ResetFunc() => property.stringValue = null;
string CurrentDisplayNameGetter()
{
var assembly = TypeCaches.GetAssemblyByName(property.stringValue);
return assembly == null ? EditorStyle.NoneStr : assembly.GetName().Name;
}
void OnClick(SearchableDropdownItem item)
{
var assemblyName = item.Value == null ? "" : item.Value.ToString();
var assembly = TypeCaches.GetAssemblyByName(assemblyName);
property.stringValue = assembly != null ? assembly.GetName().Name : "";
property.serializedObject.ApplyModifiedProperties();
onClick?.Invoke(assembly);
}
SearchableDropdownList(propertyName, root, CheckNullFunc, ResetFunc, CurrentDisplayNameGetter, OnClick);
}
public static SearchableDropdownItem CreateTypeMenu(string assemblyName)
{
var root = new SearchableDropdownItem(string.IsNullOrEmpty(assemblyName) ? "No Assembly" : assemblyName + " - Type");
root.AddChild(new SearchableDropdownItem(EditorStyle.NoneStr, null));
root.AddSeparator();
var assembly = TypeCaches.GetAssemblyByName(assemblyName);
if (assembly != null)
{
var types = assembly.GetTypes();
foreach (var type in types)
{
if (type.IsAbstract) continue;
if (type.IsInterface) continue;
if (type.IsGenericType) continue;
if (type.IsEnum) continue;
var child = new SearchableDropdownItem(type.Name, type.FullName);
root.AddChild(child);
}
}
return root;
}
public static void TypeMenu(string propertyName, SerializedProperty property, string assemblyName, Action<Type> onClick = null)
{
var root = CreateTypeMenu(assemblyName);
bool CheckNullFunc() => TypeCaches.GetTypeByName(assemblyName, property.stringValue) == null;
void ResetFunc() => property.stringValue = null;
string CurrentDisplayNameGetter()
{
var type = TypeCaches.GetTypeByName(assemblyName, property.stringValue);
return type == null ? EditorStyle.NoneStr : type.Name;
}
void OnClick(SearchableDropdownItem item)
{
var type = TypeCaches.GetTypeByName(assemblyName, item.Value == null ? "" : item.Value.ToString());
property.stringValue = type != null ? type.FullName : "";
property.serializedObject.ApplyModifiedProperties();
onClick?.Invoke(type);
}
SearchableDropdownList(propertyName, root, CheckNullFunc, ResetFunc, CurrentDisplayNameGetter, OnClick);
}
#endregion
#region Components Tree Menu
public static SearchableDropdownItem CreateComponentsTreeMenu<TComponent>(Transform parent) where TComponent : Component
{
var root = new SearchableDropdownItem(typeof(TComponent).Name);
root.AddChild(new SearchableDropdownItem(EditorStyle.NoneStr, null));
root.AddSeparator();
CreateComponentsTreeMenuRecursion<TComponent>(root, parent, "");
return root;
}
private static void CreateComponentsTreeMenuRecursion<TComponent>(SearchableDropdownItem root, Transform parent, string path) where TComponent : Component
{
var components = parent.GetComponents<TComponent>();
foreach (var component in components)
{
var componentName = component.GetType().Name;
var child = new SearchableDropdownItem(path + componentName, component)
{
icon = EditorGUIUtility.ObjectContent(component, component.GetType()).image as Texture2D
};
root.AddChild(child);
}
if (parent.childCount <= 0) return;
root.AddSeparator();
for (var i = 0; i < parent.childCount; i++)
{
var childTrans = parent.GetChild(i);
CreateComponentsTreeMenuRecursion<TComponent>(root, childTrans, path + childTrans.name + " \\ ");
}
}
public static void ComponentTreeMenu<TComponent>(string propertyName, SerializedProperty property, Transform parent, Action<TComponent> onClick = null) where TComponent : Component
{
var menu = CreateComponentsTreeMenu<TComponent>(parent);
void OnClick(SearchableDropdownItem item)
{
TComponent target = null;
if (item.Value == null)
{
property.objectReferenceValue = null;
}
else
{
target = item.Value as TComponent;
property.objectReferenceValue = target;
}
property.serializedObject.ApplyModifiedProperties();
onClick?.Invoke(target);
}
SearchableComponentDropdownList<TComponent>(propertyName, property, menu, OnClick);
}
public static void SearchableComponentDropdownList<TComponent>(string propertyName, SerializedProperty property, SearchableDropdownItem root, Action<SearchableDropdownItem> onClick = null) where TComponent : Component
{
using (new ColorScope(EditorStyle.ErrorColor, () => property.objectReferenceValue == null))
{
GUILayout.BeginHorizontal();
GUILayout.Label(propertyName, GUILayout.Width(EditorGUIUtility.labelWidth));
property.objectReferenceValue = EditorGUILayout.ObjectField(property.objectReferenceValue, typeof(TComponent), true);
var btnRect = GUILayoutUtility.GetLastRect();
var btnType = GUILayout.Button("▽", EditorStyles.popup, GUILayout.Width(EditorGUIUtility.singleLineHeight));
if (btnType)
{
btnRect.width = EditorGUIUtility.currentViewWidth;
var dropdown = new SearchableDropdown(root, onClick);
dropdown.Show(btnRect, 300f);
}
GUILayout.EndHorizontal();
}
}
#endregion
#region Type Property Menu
public static GenericMenu CreatePropertyMenu(Type type, SerializedProperty property, Action<PropertyInfo> onClickProperty = null, Action<FieldInfo> onClickField = null)
{
var menu = new GenericMenu();
menu.AddItem(new GUIContent(EditorStyle.NoneStr), string.IsNullOrEmpty(property.stringValue), () =>
{
property.stringValue = "";
property.serializedObject.ApplyModifiedProperties();
});
menu.AddSeparator("");
var propertyInfos = TypeCaches.GetTypeProperties(type);
var prefix = "Property/";
foreach (var propertyInfo in propertyInfos)
{
// if (!TypeCaches.BindableTypes.Contains(propertyInfo.PropertyType)) continue;
var displayName = propertyInfo.Name + "\t\t" + propertyInfo.PropertyType.Name;
menu.AddItem(new GUIContent(prefix + displayName), propertyInfo.Name == property.stringValue, () =>
{
property.stringValue = propertyInfo.Name;
property.serializedObject.ApplyModifiedProperties();
onClickProperty?.Invoke(propertyInfo);
});
}
var filedInfos = TypeCaches.GetTypeFields(type);
prefix = "Field/";
foreach (var fieldInfo in filedInfos)
{
// if (!TypeCaches.BindableTypes.Contains(fieldInfo.FieldType)) continue;
var displayName = fieldInfo.Name + "\t\t" + fieldInfo.FieldType.Name;
menu.AddItem(new GUIContent(prefix + displayName), fieldInfo.Name == property.stringValue, () =>
{
property.stringValue = fieldInfo.Name;
property.serializedObject.ApplyModifiedProperties();
onClickField?.Invoke(fieldInfo);
});
}
return menu;
}
public static void PropertyTreeMenu(string propertyName, Type type, SerializedProperty property, Action<PropertyInfo> onClickProperty = null, Action<FieldInfo> onClickField = null)
{
var menu = CreatePropertyMenu(type, property, onClickProperty, onClickField);
bool CheckNullFunc() => !TypeCaches.CheckTypeHasPropertyOrFieldByName(type, property.stringValue);
void ResetFunc() => property.stringValue = null;
(string currentPropertyName, string currentPropertyTypeName) GetCurrentPropertyInfo()
{
if (string.IsNullOrEmpty(property.stringValue)) return (EditorStyle.NoneStr, "");
var (propertyInfo, filedInfo) = TypeCaches.GetTypePropertyOrFieldByName(type, property.stringValue);
if (propertyInfo != null)
{
return (propertyInfo.Name, propertyInfo.PropertyType.Name);
}
if (filedInfo != null)
{
return (filedInfo.Name, filedInfo.FieldType.Name);
}
return (EditorStyle.NoneStr, "");
}
var (currentPropertyName, currentPropertyTypeName) = GetCurrentPropertyInfo();
string CurrentDisplayNameGetter()
{
return currentPropertyName;
}
if (!string.IsNullOrEmpty(currentPropertyTypeName))
{
currentPropertyTypeName = " <color=#888888>(" + currentPropertyTypeName + ")</color>";
}
var displayPropertyName = propertyName + currentPropertyTypeName;
DropdownList(displayPropertyName, menu, CheckNullFunc, ResetFunc, CurrentDisplayNameGetter);
}
#endregion
#region Dropdown
public static void DropdownList(string propertyName, GenericMenu menu, Func<bool> checkNullFunc, Action resetFunc, Func<string> currentDisplayNameGetter)
{
var isNull = checkNullFunc();
if (isNull)
{
resetFunc();
}
using (new ColorScope(EditorStyle.ErrorColor, () => isNull))
{
GUILayout.BeginHorizontal();
GUILayout.Label(propertyName, EditorStyle.RichLabel, GUILayout.Width(EditorGUIUtility.labelWidth));
var displayName = currentDisplayNameGetter();
var currentPropertyDisplayName = isNull ? EditorStyle.NoneStr : displayName;
var btnProperty = GUILayout.Button(currentPropertyDisplayName, EditorStyles.popup);
if (btnProperty)
{
menu.ShowAsContext();
}
GUILayout.EndHorizontal();
}
}
public static void SearchableDropdownList(string propertyName, SearchableDropdownItem root, Func<bool> checkNullFunc, Action resetFunc, Func<string> currentDisplayNameGetter, Action<SearchableDropdownItem> onClick = null)
{
var isNull = checkNullFunc();
if (isNull)
{
resetFunc();
}
using (new ColorScope(EditorStyle.ErrorColor, () => isNull))
{
GUILayout.BeginHorizontal();
GUILayout.Label(propertyName, GUILayout.Width(EditorGUIUtility.labelWidth));
var displayName = currentDisplayNameGetter();
var currentPropertyDisplayName = isNull ? EditorStyle.NoneStr : displayName;
var btnRect = GUILayoutUtility.GetRect(new GUIContent(currentPropertyDisplayName), EditorStyles.toolbarButton);
var btnType = GUI.Button(btnRect, displayName, EditorStyles.popup);
if (btnType)
{
btnRect.width = EditorGUIUtility.currentViewWidth;
var dropdown = new SearchableDropdown(root, onClick);
dropdown.Show(btnRect, 500f);
}
GUILayout.EndHorizontal();
}
}
#endregion
#region Color Line
public static void ColorLine(Color color, float height)
{
GUILayout.BeginVertical();
GUILayout.Space(height);
GUILayout.EndVertical();
var rect = GUILayoutUtility.GetLastRect();
EditorGUI.DrawRect(rect, color);
}
#endregion
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b100e9dd38f05a945a64d1e3d1ec121d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,173 @@
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Aya.DataBinding
{
internal struct GUIVertical : IDisposable
{
public static GUIVertical Create(params GUILayoutOption[] options)
{
return new GUIVertical(options);
}
public static GUIVertical Create(GUIStyle style, params GUILayoutOption[] options)
{
return new GUIVertical(style, options);
}
private GUIVertical(params GUILayoutOption[] options)
{
GUILayout.BeginVertical(options);
}
private GUIVertical(GUIStyle style, params GUILayoutOption[] options)
{
GUILayout.BeginVertical(style, options);
}
public void Dispose()
{
GUILayout.EndVertical();
}
}
internal struct GUIHorizontal : IDisposable
{
public static GUIHorizontal Create(params GUILayoutOption[] options)
{
return new GUIHorizontal(options);
}
public static GUIHorizontal Create(GUIStyle style, params GUILayoutOption[] options)
{
return new GUIHorizontal(style, options);
}
private GUIHorizontal(params GUILayoutOption[] options)
{
GUILayout.BeginHorizontal(options);
}
private GUIHorizontal(GUIStyle style, params GUILayoutOption[] options)
{
GUILayout.BeginHorizontal(style, options);
}
public void Dispose()
{
GUILayout.EndHorizontal();
}
}
internal struct ColorScope : IDisposable
{
public Color OriginalColor;
public ColorScope(Color color, Func<bool> predicate = null)
{
OriginalColor = GUI.color;
if (predicate == null || predicate())
{
GUI.color = color;
}
}
public void Dispose()
{
GUI.color = OriginalColor;
}
}
internal struct GUIGroup : IDisposable
{
public static GUIGroup Create(params GUILayoutOption[] options)
{
return new GUIGroup(options);
}
private GUIGroup(params GUILayoutOption[] options)
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
}
public void Dispose()
{
EditorGUILayout.EndVertical();
}
}
internal struct GUIFoldOut : IDisposable
{
public static Dictionary<Object, Dictionary<string, bool>> StateCacheDic = new Dictionary<Object, Dictionary<string, bool>>();
public static GUIFoldOut Create(Object target, string title, bool defaultState = true, params GUILayoutOption[] options)
{
return new GUIFoldOut(target, title, defaultState, options);
}
public static GUIFoldOut Create(Object target, string title, params GUILayoutOption[] options)
{
return new GUIFoldOut(target, title, true, options);
}
private GUIFoldOut(Object target, string title, bool defaultState = true, params GUILayoutOption[] options)
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox, options);
var rect = EditorGUILayout.GetControlRect();
var state = GetState(target, title, defaultState);
var currentState = GUI.Toggle(rect, state, GUIContent.none, EditorStyles.foldout);
if (currentState != state)
{
SetState(target, title, currentState);
}
rect.xMin += rect.height;
EditorGUI.LabelField(rect, title, EditorStyles.boldLabel);
}
public void Dispose()
{
EditorGUILayout.EndVertical();
}
public static bool GetState(Object target, string title, bool defaultState = true)
{
var stateDic = GetStateDic(target);
if (!stateDic.TryGetValue(title, out var result))
{
stateDic.Add(title, defaultState);
}
return result;
}
public static void SetState(Object target, string title, bool value)
{
var stateDic = GetStateDic(target);
if (!stateDic.TryGetValue(title, out var result))
{
stateDic.Add(title, value);
}
else
{
stateDic[title] = value;
}
}
public static Dictionary<string, bool> GetStateDic(Object target)
{
if (!StateCacheDic.TryGetValue(target, out var stateDic))
{
stateDic = new Dictionary<string, bool>();
StateCacheDic.Add(target, stateDic);
}
return stateDic;
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e60f5ad2dfa590c448e983c2e8827faf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 ls9512
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 56311595321f91b47afbf045d74edc0f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 09464b2cf4eddf24b8bbffe242e8bc65
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e95a71f1b45597340935bd178ac11fe5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e28c038b0e4cd884dbd3b7f7b71c8f78
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public abstract class BindAttribute : Attribute
{
public string Context = DataContext.Default;
public string Key;
public DataDirection Direction;
protected BindAttribute(string dataKey, DataDirection direction)
{
Key = dataKey;
Direction = direction;
}
protected BindAttribute(string contextKey, string dataKey, DataDirection direction)
{
Context = contextKey;
Key = dataKey;
Direction = direction;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 592e06711eb78c84a9c8a1bd8e39d88e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindTypeAttribute : BindAttribute
{
public BindTypeAttribute(string dataKey, DataDirection direction) : base(dataKey, direction)
{
}
public BindTypeAttribute(string contextKey, string dataKey, DataDirection direction) : base(contextKey, dataKey, direction)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 58b72ba2db794ba48a4ace39c5ff5ebb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindTypeSourceAttribute : BindTypeAttribute
{
public BindTypeSourceAttribute(string dataKey) : base(dataKey, DataDirection.Source)
{
}
public BindTypeSourceAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Source)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c76d80191b14fea4ab6b2555a2269971
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindTypeBothAttribute : BindTypeAttribute
{
public BindTypeBothAttribute(string dataKey) : base(dataKey, DataDirection.Both)
{
}
public BindTypeBothAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Both)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2890306dd31255e4b8719ca0b1aa2c60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindTypeTargetAttribute : BindTypeAttribute
{
public BindTypeTargetAttribute(string dataKey) : base(dataKey, DataDirection.Target)
{
}
public BindTypeTargetAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Target)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c37c02e55f4dae34e90bd32ef5209aa3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindValueAttribute : BindAttribute
{
public BindValueAttribute(string dataKey, DataDirection direction) : base(dataKey, direction)
{
}
public BindValueAttribute(string contextKey, string dataKey, DataDirection direction) : base(contextKey, dataKey, direction)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 44dddfaacf4313b47b782655054efcf2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindValueSourceAttribute : BindValueAttribute
{
public BindValueSourceAttribute(string dataKey) : base(dataKey, DataDirection.Source)
{
}
public BindValueSourceAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Source)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 66e48aaf449a722419463d7abb9cb11b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindValueBothAttribute : BindValueAttribute
{
public BindValueBothAttribute(string dataKey) : base(dataKey, DataDirection.Both)
{
}
public BindValueBothAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Both)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 61b43b3ebfad2224ca387793aafe89c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System;
namespace Aya.DataBinding
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class BindValueTargetAttribute : BindValueAttribute
{
public BindValueTargetAttribute(string dataKey) : base(dataKey, DataDirection.Target)
{
}
public BindValueTargetAttribute(string contextKey, string dataKey) : base(contextKey, dataKey, DataDirection.Target)
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a73e2637e9d0e704e8a56d2e9cf3e457
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 971ce92b353b9cd47b8094dfa8092114
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
using UnityEngine;
namespace Aya.DataBinding
{
public abstract class BindableMonoBehaviour : MonoBehaviour
{
public BindMap BindMap
{
get
{
if (_bindMap != null) return _bindMap;
_bindMap = BindMap.GetBindMap(this);
return _bindMap;
}
}
private BindMap _bindMap;
public virtual void OnEnable()
{
BindMap.Bind(this);
}
public virtual void OnDisable()
{
BindMap.UnBind(this);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 12864963eeb848b478d3d64d6c810eb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@

namespace Aya.DataBinding
{
public abstract class BindableObject
{
public BindMap BindMap
{
get
{
if (_bindMap != null) return _bindMap;
_bindMap = BindMap.GetBindMap(this);
return _bindMap;
}
}
private BindMap _bindMap;
protected BindableObject()
{
BindMap.Bind(this);
}
~BindableObject()
{
BindMap.UnBind(this);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bfc7f42f8ece0a74d90b2a340ab3d529
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 12f9b8025ef0c234a931684e612c29c5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using System;
using System.Reflection;
namespace Aya.DataBinding
{
public class RuntimePropertyBinder : RuntimePropertyBinder<object>
{
public override bool NeedUpdate => true;
public override Type TargetType => Target.GetType();
public RuntimePropertyBinder(string context, string key, DataDirection direction, object target, PropertyInfo propertyInfo, FieldInfo fieldInfo)
{
Context = context;
Key = key;
Direction = direction;
Target = target;
PropertyInfo = propertyInfo;
FiledInfo = fieldInfo;
if (propertyInfo != null)
{
Property = propertyInfo.Name;
}
if (fieldInfo != null)
{
Property = fieldInfo.Name;
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 110273105f39b8445b1494b9088464c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
namespace Aya.DataBinding
{
public class RuntimeTypeBinder : DataBinder<object, object>
{
public override Type TargetType => Target.GetType();
private List<DataBinder> _binderCaches;
public RuntimeTypeBinder(string context, string key, DataDirection direction, object target)
{
Context = context;
Key = key;
Direction = direction;
Target = target;
}
public override void Bind()
{
if (_binderCaches == null)
{
_binderCaches = new List<DataBinder>();
var type = TargetType;
var (properties, fields) = TypeCaches.GetTypePropertiesAndFields(type);
foreach (var propertyInfo in properties)
{
var key = type.Name + "." + propertyInfo.Name + "." + Key;
var binder = new RuntimePropertyBinder(Context, key, Direction, Target, propertyInfo, null);
_binderCaches.Add(binder);
}
foreach (var fieldInfo in fields)
{
var key = type.Name + "." + fieldInfo.Name + "." + Key;
var binder = new RuntimePropertyBinder(Context, key, Direction, Target, null, fieldInfo);
_binderCaches.Add(binder);
}
}
foreach (var binder in _binderCaches)
{
binder.Bind();
binder.UpdateTarget();
}
}
public override void UnBind()
{
foreach (var binder in _binderCaches)
{
binder.UnBind();
}
}
public override object Value { get; set; }
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1cfa80d2930c14d469158702a4130a3f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
using System;
namespace Aya.DataBinding
{
public class RuntimeValueBinder<T> : DataBinder<T>
{
public override bool NeedUpdate => true;
public Func<T> Getter;
public Action<T> Setter;
public RuntimeValueBinder(string context, string key, Func<T> getter) : this(context, key, DataDirection.Source, getter, null)
{
}
public RuntimeValueBinder(string context, string key, Action<T> setter) : this(context, key, DataDirection.Target, null, setter)
{
}
public RuntimeValueBinder(string context, string key, DataDirection direction, Func<T> getter, Action<T> setter)
{
Context = context;
Key = key;
Direction = direction;
Getter = getter;
Setter = setter;
}
public override T Value
{
get => Getter();
set => Setter(value);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 31e4f4ab37415c14abce139d9e7ebb23
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b40af903d9ed6944a9b5d87f904fd02e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dd52cfa20294993478513d985926318e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,86 @@
using UnityEngine;
namespace Aya.DataBinding
{
public abstract class ComponentBinder<TComponent, TValue, TDataBinder> : MonoBehaviour
where TDataBinder : DataBinder<TComponent, TValue>, new()
where TComponent : Component
{
public string Context = DataContext.Default;
public string Key;
public DataDirection Direction = DataDirection.Target;
public UpdateType UpdateType = UpdateType.Update;
public TComponent Target;
public TDataBinder DataBinder { get; internal set; }
public DataContext DataContext => DataBinder?.DataContext;
public bool IsDestination => Direction == DataDirection.Target || Direction == DataDirection.Both;
public bool IsSource => Direction == DataDirection.Source || Direction == DataDirection.Both;
public virtual bool NeedUpdate { get; set; } = false;
public virtual void Awake()
{
}
public virtual void Start()
{
}
public virtual void OnEnable()
{
if (DataBinder == null)
{
DataBinder = CreateDataBinder();
}
DataBinder.Bind();
DataBinder.UpdateSource();
DataBinder.UpdateTarget();
}
public virtual TDataBinder CreateDataBinder()
{
var dataBinder = new TDataBinder
{
Target = Target,
TargetType = typeof(TComponent),
Context = Context,
Direction = Direction,
UpdateType = UpdateType,
Key = Key
};
return dataBinder;
}
public virtual void Update()
{
}
public virtual void LateUpdate()
{
}
public virtual void FixedUpdate()
{
}
public virtual void OnDisable()
{
DataBinder.UnBind();
}
public virtual void OnValidate()
{
}
public virtual void Reset()
{
Target = GetComponentInChildren<TComponent>();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 72f0ba0405b379442bb700f8599392c3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,128 @@
using System;
using System.Globalization;
using System.Reflection;
using UnityEngine;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/Property Binder")]
public class PropertyBinder : ComponentBinder<Component, object, RuntimePropertyBinder<Component>>
{
public override bool NeedUpdate => true;
public string Property;
public override RuntimePropertyBinder<Component> CreateDataBinder()
{
var dataBinder = new RuntimePropertyBinder<Component>
{
Target = Target,
TargetType = Target.GetType(),
Property = Property,
Context = Context,
Direction = Direction,
Key = Key
};
return dataBinder;
}
public override void Reset()
{
Target = null;
}
}
public class RuntimePropertyBinder<TTarget> : DataBinder<TTarget, object>
{
public string Property;
public override bool NeedUpdate => true;
public override object Value
{
get
{
if (FiledInfo != null)
{
var data = FiledInfo.GetValue(Target);
return data;
}
if (PropertyInfo != null)
{
var data = PropertyInfo.GetValue(Target, null);
return data;
}
return default;
}
set
{
var data = value;
var dataType = data != null ? data.GetType() : typeof(object);
if (FiledInfo != null)
{
if (data != null && dataType != FiledInfo.FieldType)
{
var convertData = Convert.ChangeType(data, FiledInfo.FieldType, CultureInfo.InvariantCulture);
FiledInfo.SetValue(Target, convertData);
}
else
{
FiledInfo.SetValue(Target, data);
}
}
if (PropertyInfo != null)
{
if (data != null && dataType != PropertyInfo.PropertyType)
{
var convertData = Convert.ChangeType(data, PropertyInfo.PropertyType, CultureInfo.InvariantCulture);
PropertyInfo.SetValue(Target, convertData, null);
}
else
{
PropertyInfo.SetValue(Target, data, null);
}
}
}
}
public FieldInfo FiledInfo
{
get
{
if (_filedInfo == null || _filedInfo.Name != Property)
{
_filedInfo = TargetType.GetField(Property, TypeCaches.DefaultBindingFlags);
DataType = _filedInfo?.FieldType;
}
return _filedInfo;
}
internal set => _filedInfo = value;
}
private FieldInfo _filedInfo;
public PropertyInfo PropertyInfo
{
get
{
if (_propertyInfo == null || _propertyInfo.Name != Property)
{
_propertyInfo = TargetType.GetProperty(Property, TypeCaches.DefaultBindingFlags);
DataType = _propertyInfo?.PropertyType;
}
return _propertyInfo;
}
internal set => _propertyInfo = value;
}
private PropertyInfo _propertyInfo;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 93fb937556de5054f9aaa39c10d560a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Aya.DataBinding
{
[Serializable]
public class TypeBindMap
{
public string Property;
public Component Target;
public string TargetProperty;
}
[AddComponentMenu("Data Binding/Type Binder")]
public class TypeBinder : MonoBehaviour
{
public string Context = DataContext.Default;
public string Key;
public DataDirection Direction = DataDirection.Target;
public string Assembly;
public string Type;
public List<TypeBindMap> Map = new List<TypeBindMap>();
private List<DataBinder> _binderCaches;
public virtual void OnEnable()
{
if (_binderCaches == null)
{
_binderCaches = new List<DataBinder>();
var type = TypeCaches.GetTypeByName(Assembly, Type);
foreach (var map in Map)
{
var key = type.Name + "." + map.Property + "." + Key;
var (property, field) = TypeCaches.GetTypePropertyOrFieldByName(map.Target.GetType(), map.TargetProperty);
var binder = new RuntimePropertyBinder(Context, key, Direction, map.Target, property, field);
_binderCaches.Add(binder);
}
}
foreach (var binder in _binderCaches)
{
binder.Bind();
binder.UpdateTarget();
}
}
public virtual void OnDisable()
{
foreach (var binder in _binderCaches)
{
binder.UnBind();
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 51de3718b79a0744ca6cf58442638eb9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7bbcfecafd582864eaefc540b0e3352f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
using UnityEngine;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/CanvasGroup Binder")]
public class CanvasGroupBinder : ComponentBinder<CanvasGroup, float, RuntimeCanvasGroupBinder>
{
public override bool NeedUpdate => true;
}
public class RuntimeCanvasGroupBinder : DataBinder<CanvasGroup, float>
{
public override bool NeedUpdate => true;
public override float Value
{
get => Target.alpha;
set => Target.alpha = value;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(CanvasGroupBinder)), UnityEditor.CanEditMultipleObjects]
public class CanvasGroupBinderEditor : ComponentBinderEditor<CanvasGroup, float, RuntimeCanvasGroupBinder>
{
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 98f0077db28a2d84080f305e0cc17a7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
using UnityEngine;
using UnityEngine.UI;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/Color Binder")]
public class ColorBinder : ComponentBinder<Graphic, Color, RuntimeColorBinder>
{
public override bool NeedUpdate => true;
}
public class RuntimeColorBinder : DataBinder<Graphic, Color>
{
public override bool NeedUpdate => true;
public override Color Value
{
get => Target.color;
set => Target.color = value;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(ColorBinder)), UnityEditor.CanEditMultipleObjects]
public class ColorBinderEditor : ComponentBinderEditor<Graphic, Color, RuntimeColorBinder>
{
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cbef07fdc5cc1cb4d92bd38b1a40052f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using UnityEngine;
using UnityEngine.UI;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/Dropdown Binder")]
public class DropdownBinder : ComponentBinder<Dropdown, int, RuntimeDropdownBinder>
{
}
public class RuntimeDropdownBinder : DataBinder<Dropdown, int>
{
public override void AddListener() => Target.onValueChanged.AddListener(OnValueChangedCallback);
public override void RemoveListener() => Target.onValueChanged.RemoveListener(OnValueChangedCallback);
public override int Value
{
get => Target.value;
set => Target.value = value;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(DropdownBinder)), UnityEditor.CanEditMultipleObjects]
public class DropdownBinderEditor : ComponentBinderEditor<Dropdown, int, RuntimeDropdownBinder>
{
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c11067b224c17534fbe6c2b46263616c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/Dropdown List Binder")]
public class DropdownListBinder : ComponentBinder<Dropdown, List<Dropdown.OptionData>, RuntimeDropdownListBinder>
{
public override bool NeedUpdate => true;
}
public class RuntimeDropdownListBinder : DataBinderList<Dropdown, List<Dropdown.OptionData>>
{
public override bool NeedUpdate => true;
public override List<Dropdown.OptionData> Value
{
get => Target.options;
set => Target.options = value;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(DropdownListBinder)), UnityEditor.CanEditMultipleObjects]
public class DropdownListBinderEditor : ComponentBinderEditor<Dropdown, List<Dropdown.OptionData>, RuntimeDropdownListBinder>
{
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9f236ade29b62a34eae1c6154d5bdb44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
using UnityEngine;
using UnityEngine.UI;
namespace Aya.DataBinding
{
[AddComponentMenu("Data Binding/Image Binder")]
public class ImageBinder : ComponentBinder<Image, Sprite, RuntimeImageBinder>
{
public override bool NeedUpdate => true;
}
public class RuntimeImageBinder : DataBinder<Image, Sprite>
{
public override bool NeedUpdate => true;
public override Sprite Value
{
get => Target.sprite;
set => Target.sprite = value;
}
}
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(ImageBinder)), UnityEditor.CanEditMultipleObjects]
public class ImageBinderEditor : ComponentBinderEditor<Image, Sprite, RuntimeImageBinder>
{
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: faab953627dbed34789933803f0c1b65
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b07aafae171734f4b837582f4db8e75d, type: 3}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More