5 Commits

40 changed files with 2168 additions and 727 deletions

View File

@ -0,0 +1,328 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &564740215097623485
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1697214530303839877}
- component: {fileID: 3992139212329961548}
- component: {fileID: 2782869455480213302}
- component: {fileID: 478384147413774568}
m_Layer: 0
m_Name: Outline
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1697214530303839877
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564740215097623485}
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: 5.3333335}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 697189026367054479}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3992139212329961548
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564740215097623485}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 811d3d3bfa653494784ee8ed56956471, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 1
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &2782869455480213302
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564740215097623485}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: acf99b9aa18d4ab9b4ce796d513d476b, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 2838206730318674270}
outlineRenderer: {fileID: 3992139212329961548}
outlineCollider: {fileID: 478384147413774568}
entity: {fileID: 7300440714681954677}
--- !u!70 &478384147413774568
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564740215097623485}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_Size: {x: 1, y: 1}
m_Direction: 0
--- !u!1 &887327274103887133
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 697189026367054479}
- component: {fileID: 3332598847335032684}
- component: {fileID: 7300440714681954677}
m_Layer: 0
m_Name: EntityPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &697189026367054479
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 887327274103887133}
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: 1697214530303839877}
- {fileID: 5549544358816209289}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3332598847335032684
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 887327274103887133}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b20b1846b9ef47db83c2ac8c4c4e82cb, type: 3}
m_Name:
m_EditorClassIdentifier:
entity: {fileID: 7300440714681954677}
outline: {fileID: 2782869455480213302}
--- !u!114 &7300440714681954677
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 887327274103887133}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fbde354e0bcc4409b3378ee9b698ddc0, type: 3}
m_Name:
m_EditorClassIdentifier:
direction: {x: 0, y: 0, z: 0}
body: {fileID: 2838206730318674270}
affiliation:
canSelect: 1
--- !u!1 &2838206730318674270
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5549544358816209289}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5549544358816209289
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2838206730318674270}
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: 1715998378632490765}
m_Father: {fileID: 697189026367054479}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3562938223049611414
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1715998378632490765}
- component: {fileID: 2346928675516876702}
m_Layer: 0
m_Name: Square
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1715998378632490765
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3562938223049611414}
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: []
m_Father: {fileID: 5549544358816209289}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2346928675516876702
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3562938223049611414}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
m_Color: {r: 0.17278391, g: 0.7283019, b: 0.108558126, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0

View File

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

View File

@ -0,0 +1,460 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4821822984522114009
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8974533068185241455}
- component: {fileID: 6098472552964198111}
- component: {fileID: 7844228932229707948}
- component: {fileID: 504677424079507256}
- component: {fileID: 8276716053524560457}
- component: {fileID: 1536012154932022711}
m_Layer: 5
m_Name: RightMenu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8974533068185241455
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
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: 965650796640655482}
- {fileID: 3066961863796270965}
- {fileID: 524436111069263832}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 342, y: -198}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.1, y: 0.9}
--- !u!222 &6098472552964198111
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
m_CullTransparentMesh: 1
--- !u!114 &7844228932229707948
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &504677424079507256
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &8276716053524560457
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 1
m_VerticalFit: 1
--- !u!114 &1536012154932022711
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4821822984522114009}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e45cfe2f36eb4f589b6d8f331567974d, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
menu: {fileID: 4821822984522114009}
buttonPrefab: {fileID: 3166707847097429176, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!1001 &1166868423299745271
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 8974533068185241455}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: Test
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.x
value: 160
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5723833987058492246, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_text
value: "\u53D8\u6210\u7B28\u86CB"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &524436111069263832 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 1166868423299745271}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1878011162534849109
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 8974533068185241455}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: Control
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.x
value: 160
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5723833987058492246, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_text
value: "\u64CD\u63A7"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &965650796640655482 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 1878011162534849109}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &4460444807628739930
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 8974533068185241455}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: Delete
objectReference: {fileID: 0}
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.x
value: 160
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_SizeDelta.y
value: 30
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5723833987058492246, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_text
value: "\u5220\u9664"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &3066961863796270965 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 4460444807628739930}
m_PrefabAsset: {fileID: 0}

View File

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

View File

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

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -6,7 +6,7 @@ TextureImporter:
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
@ -37,24 +37,24 @@ TextureImporter:
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
@ -100,7 +100,7 @@ TextureImporter:
customData:
physicsShape: []
bones: []
spriteID:
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:

View File

@ -257,6 +257,53 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 39049902}
m_PrefabAsset: {fileID: 0}
--- !u!1 &164739120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 164739122}
- component: {fileID: 164739121}
m_Layer: 0
m_Name: EntityManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &164739121
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 164739120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa378b7511b04429b8b6b0efbcce825a, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
entityLevel: {fileID: 1891846098}
entityPrefab: {fileID: 3332598847335032684, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
--- !u!4 &164739122
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 164739120}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.54611, y: -0.12631, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &323725406
GameObject:
m_ObjectHideFlags: 0
@ -336,38 +383,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &382708044
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 382708045}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &382708045
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 382708044}
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: 788852947}
m_Father: {fileID: 1109852279}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &603423466
GameObject:
m_ObjectHideFlags: 0
@ -440,234 +455,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
--- !u!1 &661053190
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 661053191}
- component: {fileID: 661053192}
- component: {fileID: 661053193}
- component: {fileID: 661053194}
m_Layer: 0
m_Name: Outline
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &661053191
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 661053190}
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: 5.3333335}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 1109852279}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &661053192
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 661053190}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 811d3d3bfa653494784ee8ed56956471, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 1
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &661053193
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 661053190}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: acf99b9aa18d4ab9b4ce796d513d476b, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 382708044}
outlineRenderer: {fileID: 661053192}
outlineCollider: {fileID: 0}
--- !u!70 &661053194
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 661053190}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_Size: {x: 1, y: 1}
m_Direction: 0
--- !u!1 &788852946
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 788852947}
- component: {fileID: 788852948}
m_Layer: 0
m_Name: Square
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &788852947
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 788852946}
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: []
m_Father: {fileID: 382708045}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &788852948
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 788852946}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1001 &1002040475
PrefabInstance:
m_ObjectHideFlags: 0
@ -802,70 +589,6 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 1002040475}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1109852278
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1109852279}
- component: {fileID: 1109852280}
- component: {fileID: 1109852281}
m_Layer: 0
m_Name: CharacterPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1109852279
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109852278}
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: 661053191}
- {fileID: 382708045}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1109852280
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109852278}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 757576bb4354ac54da09868e1be02eec, type: 3}
m_Name:
m_EditorClassIdentifier:
direction: {x: 0, y: 0, z: 0}
canSelect: 1
body: {fileID: 382708044}
--- !u!114 &1109852281
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109852278}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b20b1846b9ef47db83c2ac8c4c4e82cb, type: 3}
m_Name:
m_EditorClassIdentifier:
entity: {fileID: 1109852280}
outline: {fileID: 661053193}
--- !u!1001 &1147017152
PrefabInstance:
m_ObjectHideFlags: 0
@ -1097,6 +820,7 @@ RectTransform:
- {fileID: 1892335252}
- {fileID: 2068504032}
- {fileID: 1401161120}
- {fileID: 2120445621}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@ -1118,7 +842,7 @@ GameObject:
- component: {fileID: 1239746124}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -1456,6 +1180,37 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
actionButton: 27
--- !u!1 &1891846098
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1891846100}
m_Layer: 0
m_Name: EntityLevel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1891846100
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1891846098}
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: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!224 &1892335252 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4227482396833377269, guid: 72cde32427f7d914692a7b0d22fb791d, type: 3}
@ -1511,6 +1266,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
actionButton: 112
--- !u!224 &2120445621 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
m_PrefabInstance: {fileID: 2673299386314699482}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &481559811017721991
PrefabInstance:
m_ObjectHideFlags: 0
@ -1696,6 +1456,151 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 72cde32427f7d914692a7b0d22fb791d, type: 3}
--- !u!1001 &2673299386314699482
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1236970686}
m_Modifications:
- target: {fileID: 524436111069263832, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 524436111069263832, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 524436111069263832, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 524436111069263832, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 965650796640655482, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 965650796640655482, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 965650796640655482, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 965650796640655482, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3066961863796270965, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3066961863796270965, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3066961863796270965, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3066961863796270965, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4821822984522114009, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_Name
value: RightMenu
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_Pivot.x
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_Pivot.y
value: 0.9
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 342
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_AnchoredPosition.y
value: -198
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8974533068185241455, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6a6b87c10209f534b926ee730079390c, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
@ -1704,4 +1609,5 @@ SceneRoots:
- {fileID: 323725409}
- {fileID: 1236970686}
- {fileID: 603423468}
- {fileID: 1109852279}
- {fileID: 1891846100}
- {fileID: 164739122}

View File

@ -242,6 +242,37 @@ Transform:
m_Children: []
m_Father: {fileID: 613797070}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &309861628
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 309861630}
m_Layer: 0
m_Name: "\u5B9E\u4F53\u5C42"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &309861630
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 309861628}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.17242, y: 0.05575, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &613797067
GameObject:
m_ObjectHideFlags: 0
@ -272,7 +303,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5e7ec2149bca47f42965dd01c01116cd, type: 3}
m_Name:
m_EditorClassIdentifier:
dataLevel: {fileID: 1236360967}
textureLevel: {fileID: 9462741}
--- !u!156049354 &613797069
Grid:
@ -317,7 +347,7 @@ GameObject:
- component: {fileID: 1057087087}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -607,7 +637,66 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 147e91e6929d90a4fb877c0b0a6b608c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1485465860
entityManager: {fileID: 2036983433}
--- !u!1001 &1730922965
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalPosition.x
value: -7.6344624
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalPosition.y
value: -0.584403
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 697189026367054479, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 887327274103887133, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
propertyPath: m_Name
value: EntityPrefab
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 3562938223049611414, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
--- !u!1 &2036983430
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -615,42 +704,59 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1485465861}
- component: {fileID: 1485465862}
- component: {fileID: 2036983432}
- component: {fileID: 2036983433}
- component: {fileID: 2036983434}
m_Layer: 0
m_Name: Character
m_Name: "\u5168\u5C40"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1485465861
--- !u!4 &2036983432
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485465860}
m_GameObject: {fileID: 2036983430}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0.17242, y: 0.05575, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1485465862
--- !u!114 &2036983433
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485465860}
m_GameObject: {fileID: 2036983430}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 757576bb4354ac54da09868e1be02eec, type: 3}
m_Script: {fileID: 11500000, guid: aa378b7511b04429b8b6b0efbcce825a, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
entityLevel: {fileID: 309861628}
entityPrefab: {fileID: 3332598847335032684, guid: 6cd8b01a0f57372438dc30c864ae1530, type: 3}
--- !u!114 &2036983434
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2036983430}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd0367766d04d8c4db80bcfe0202e619, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
--- !u!1 &2104915506
GameObject:
m_ObjectHideFlags: 0
@ -699,8 +805,10 @@ Transform:
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1371068282}
- {fileID: 1057087090}
- {fileID: 613797070}
- {fileID: 1485465861}
- {fileID: 2104915508}
- {fileID: 309861630}
- {fileID: 2036983432}
- {fileID: 1371068282}
- {fileID: 1730922965}

View File

@ -8,7 +8,12 @@ namespace AI
{
public List<AIBase> children = new();
public virtual JobBase GetJob(Entity.Entity target)
public abstract JobBase GetJob(Entity.Entity target);
}
public class Selector : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
foreach (var aiBase in children)
{
@ -19,28 +24,7 @@ namespace AI
return null;
}
}
public class ContinuousMove : AIBase
{
override public JobBase GetJob(Entity.Entity target)
{
return null;
}
}
public class TrackPlayer : AIBase
{
}
public class RandomWander : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
return new WanderJob();
}
}
public class ConditionalAI : AIBase
public class ConditionalAI : Selector
{
// 条件函数,返回 true 表示满足条件
private Func<Entity.Entity, bool> condition;
@ -64,4 +48,56 @@ namespace AI
return null;
}
}
public class SequentialAI : Selector
{
private int currentIndex = 0; // 当前正在尝试的子节点索引
public override JobBase GetJob(Entity.Entity target)
{
// 如果当前索引超出了子节点范围,重置索引并返回 null
if (currentIndex >= children.Count)
{
ResetIndex();
return null;
}
// 获取当前子节点的任务
var currentChild = children[currentIndex];
var job = currentChild.GetJob(target);
// 移动到下一个子节点
currentIndex++;
return job;
}
// 重置当前索引(用于重新开始遍历)
private void ResetIndex()
{
currentIndex = 0;
}
}
public class ContinuousMove : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
return new MoveJob();
}
}
public class TrackPlayer : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
throw new NotImplementedException();
}
}
public class RandomWander : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
return new WanderJob();
}
}
}

View File

@ -7,7 +7,7 @@ namespace AI
public abstract class JobBase
{
public Entity.Entity entity;
private int timeoutTicks = 100;
protected int timeoutTicks = 300;
public bool Running=>timeoutTicks > 0;
public virtual void StartJob(Entity.Entity target)
@ -57,5 +57,22 @@ namespace AI
}
}
public class IdleJob:JobBase
{
override public void StartJob(Entity.Entity target)
{
base.StartJob(target);
timeoutTicks = 500;
}
protected override void UpdateJob()
{
}
}
public class MoveJob : JobBase
{
protected override void UpdateJob()
{
entity.TryMove();
}
}
}

View File

@ -105,5 +105,40 @@ namespace Base
if (obj is ITickUI uiObj) tickUIs.Add(uiObj);
}
}
public static void AddTick(ITick tick)
{
if (Instance != null && !Instance.ticks.Contains(tick))
Instance.ticks.Add(tick);
}
public static void RemoveTick(ITick tick)
{
if (Instance != null)
Instance.ticks.Remove(tick);
}
public static void AddTickPhysics(ITickPhysics physics)
{
if (Instance != null && !Instance.tickPhysics.Contains(physics))
Instance.tickPhysics.Add(physics);
}
public static void RemoveTickPhysics(ITickPhysics physics)
{
if (Instance != null)
Instance.tickPhysics.Remove(physics);
}
public static void AddTickUI(ITickUI ui)
{
if (Instance != null && !Instance.tickUIs.Contains(ui))
Instance.tickUIs.Add(ui);
}
public static void RemoveTickUI(ITickUI ui)
{
if (Instance != null)
Instance.tickUIs.Remove(ui);
}
}
}

View File

@ -28,54 +28,43 @@ namespace Data
public class DrawingOrderDef : Define
{
public List<DrawNodeDef> drawNodes = new();
public override bool Init(XElement xmlDef)
public DrawNodeDef drawingOrder_down;
public DrawNodeDef drawingOrder_up;
public DrawNodeDef drawingOrder_left;
public DrawNodeDef drawingOrder_right;
public string texturePath;
public DrawNodeDef GetDrawingOrder(Orientation orientation)
{
base.Init(xmlDef);
// 定义一个临时变量用于存储结果
DrawNodeDef result = null;
var nodes = xmlDef.Elements("DrawNodeDef");
var xElements = nodes as XElement[] ?? nodes.ToArray();
if (!xElements.Any())
return false;
foreach (var node in xElements)
// 根据传入的 Orientation 获取对应的 DrawingOrderDef
switch (orientation)
{
var drawNode = new DrawNodeDef();
drawNode.Init(node);
drawNodes.Add(drawNode);
case Orientation.Down:
result = drawingOrder_down;
break;
case Orientation.Up:
result = drawingOrder_up;
break;
case Orientation.Left:
result = drawingOrder_left;
break;
case Orientation.Right:
result = drawingOrder_right;
break;
default:
throw new ArgumentException("Invalid orientation value.");
}
return true;;
}
// 重载 == 运算符
public static bool operator ==(DrawingOrderDef a, DrawingOrderDef b)
{
if (ReferenceEquals(a, b)) return true; // 如果是同一个对象,直接返回 true
if (ReferenceEquals(a, null) || ReferenceEquals(b, null)) return false; // 如果其中一个为 null返回 false
// 如果当前方向的结果为空,则尝试用 drawingOrder_down 填充
if (result == null) result = drawingOrder_down;
return AreEqual(a, b);
}
// 如果 drawingOrder_down 仍然为空,则尝试用其他非空方向填充
if (result == null) result = drawingOrder_up ?? drawingOrder_left ?? drawingOrder_right;
// 重载 != 运算符
public static bool operator !=(DrawingOrderDef a, DrawingOrderDef b)
{
return !(a == b);
}
// 判断两个 DrawingOrderDef 是否相等
private static bool AreEqual(DrawingOrderDef a, DrawingOrderDef b)
{
// 比较 drawNodes 的数量
if (a.drawNodes.Count != b.drawNodes.Count)
return false;
// 递归比较每个 DrawNodeDef
for (int i = 0; i < a.drawNodes.Count; i++)
{
if (!DrawNodeDef.AreEqual(a.drawNodes[i], b.drawNodes[i]))
return false;
}
return true;
return result;
}
}
@ -91,7 +80,7 @@ namespace Data
{
base.Init(xmlDef);
nodeName = xmlDef.Attribute("name")?.Value;
nodeName = xmlDef.Attribute("name")?.Value??"noName";
drawNodeType = Enum.TryParse(xmlDef.Attribute("type")?.Value, true, out DrawNodeType typeResult)
? typeResult
: DrawNodeType.Image;

View File

@ -15,7 +15,7 @@ namespace Data
public string label;
public string packID;
public bool isReferene=false;
public bool isReferene = false;
/// <summary>
/// 初始化方法,根据传入的 XML 元素 (<paramref name="xmlDef" />) 进行处理。
@ -50,69 +50,93 @@ namespace Data
{
var sb = new StringBuilder();
// 使用反射获取当前类的所有字段和属性
var fieldsAndProperties = GetAllFieldsAndProperties(this);
// 显示基类中的基本信息
sb.AppendLine($"Define {{");
sb.AppendLine($"\tdefName: {defName}");
sb.AppendLine($"\tdescription: {description}");
sb.AppendLine($"\tlabel: {label}");
foreach (var member in fieldsAndProperties)
// 获取当前对象的所有字段
var fields = GetType().GetFields(BindingFlags.Public | BindingFlags.Instance);
foreach (var field in fields)
{
var name = member.Name;
var value = GetValue(member, this);
if (field.Name == "defName" || field.Name == "description" || field.Name == "label")
continue; // 已经显示过的基本信息跳过
if (value is IList list && list.Count > 0) // 如果是列表类型
{
sb.AppendLine($"{name}:");
foreach (var item in list) sb.AppendLine($" - {FormatValue(item)}");
}
else if (value is Define defineObject) // 如果是继承自 Define 的子类
{
if (!string.IsNullOrEmpty(defineObject.defName))
{
sb.AppendLine($"{name}: {defineObject.defName}");
}
else
{
sb.AppendLine($"{name}:");
sb.AppendLine(Indent(defineObject.ToString(), " "));
}
}
else
{
sb.AppendLine($"{name}: {FormatValue(value)}");
}
sb.Append("\t");
sb.Append(field.Name);
sb.Append(": ");
AppendFieldInfo(sb, field.GetValue(this), "\t\t");
sb.AppendLine();
}
sb.Append("}");
return sb.ToString();
}
private static IEnumerable<MemberInfo> GetAllFieldsAndProperties(object obj)
private void AppendFieldInfo(StringBuilder sb, object value, string indent)
{
var type = obj.GetType();
return type.GetFields(BindingFlags.Public | BindingFlags.Instance)
.Concat(type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Cast<MemberInfo>());
}
private static object GetValue(MemberInfo member, object obj)
{
switch (member)
if (value == null)
{
case FieldInfo field:
return field.GetValue(obj);
case PropertyInfo property:
return property.GetValue(obj);
default:
throw new ArgumentException("Unsupported member type.");
sb.Append("null");
return;
}
var type = value.GetType();
// 如果是简单类型(如 int, string, bool 等)
if (type.IsPrimitive || type == typeof(string) || type == typeof(decimal))
{
sb.Append(value);
}
// 如果是集合类型(如 List<T>, Dictionary<K,V> 等)
else if (typeof(IEnumerable).IsAssignableFrom(type) && !(value is string))
{
sb.AppendLine(" [");
var isFirst = true;
foreach (var item in (IEnumerable)value)
{
if (!isFirst)
sb.AppendLine(",");
isFirst = false;
sb.Append(indent);
AppendFieldInfo(sb, item, indent + "\t");
}
if (!isFirst) // 如果集合不为空,则添加逗号后的换行
sb.AppendLine();
sb.Append(indent.TrimEnd('\t')); // 回退一级缩进
sb.Append("]");
}
// 如果是自定义对象类型
else
{
sb.AppendLine(" {");
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
var isFirst = true;
foreach (var field in fields)
{
if (!isFirst)
sb.AppendLine(",");
isFirst = false;
sb.Append(indent);
sb.Append(field.Name);
sb.Append(": ");
AppendFieldInfo(sb, field.GetValue(value), indent + "\t");
}
if (!isFirst) // 如果对象有字段,则添加逗号后的换行
sb.AppendLine();
sb.Append(indent.TrimEnd('\t')); // 回退一级缩进
sb.Append("}");
}
}
private static string FormatValue(object value)
{
return value?.ToString() ?? "null";
}
private static string Indent(string text, string prefix)
{
return string.Join(Environment.NewLine, text.Split('\n').Select(line => prefix + line));
}
}
}

View File

@ -1,8 +1,13 @@
namespace Data
{
public class ItemDefine:Define
public class ItemDef:Define
{
public ImageDef texture;
public AttributesDef attributes;
}
public class WeaponDef : ItemDef
{
}
}

View File

@ -8,49 +8,12 @@ namespace Data
public class PawnDef : Define
{
public AttributesDef attributes;
public string aiController;
public string texturePath = null;
public DrawingOrderDef
drawingOrder_down,
drawingOrder_up,
drawingOrder_left,
drawingOrder_right;
public DrawingOrderDef drawingOrder;
public BehaviorTreeDef behaviorTree;
public string affiliation;
public DrawingOrderDef GetDrawingOrder(Orientation orientation)
{
// 定义一个临时变量用于存储结果
DrawingOrderDef result = null;
// 根据传入的 Orientation 获取对应的 DrawingOrderDef
switch (orientation)
{
case Orientation.Down:
result = drawingOrder_down;
break;
case Orientation.Up:
result = drawingOrder_up;
break;
case Orientation.Left:
result = drawingOrder_left;
break;
case Orientation.Right:
result = drawingOrder_right;
break;
default:
throw new ArgumentException("Invalid orientation value.");
}
// 如果当前方向的结果为空,则尝试用 drawingOrder_down 填充
if (result == null) result = drawingOrder_down;
// 如果 drawingOrder_down 仍然为空,则尝试用其他非空方向填充
if (result == null) result = drawingOrder_up ?? drawingOrder_left ?? drawingOrder_right;
return result;
}
}
public class MonsterDef:PawnDef
{
@ -60,29 +23,38 @@ namespace Data
public class BehaviorTreeDef : Define
{
public BehaviorTreeDef[] childTree;
public string className;
public string className="Selector";
public string condition;
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
// 从当前节点获取className和condition属性
className = xmlDef.Attribute("className")?.Value ?? className;
condition = xmlDef.Attribute("condition")?.Value;
var nodes = xmlDef.Elements("Node");
var xElements = nodes as XElement[] ?? nodes.ToArray();
if (!xElements.Any())
return false;
if (!nodes.Any())
return true; // 没有子节点也是有效的
className = xmlDef.Attribute("className")?.Value;
List<BehaviorTreeDef> children = new();
foreach (var node in xElements)
foreach (var node in nodes)
{
var childNode = new BehaviorTreeDef();
childNode.Init(node);
if (!childNode.Init(node))
return false;
children.Add(childNode);
}
childTree = children.ToArray();
return true;
}
}
public class AffiliationDef : Define
{
}
}

View File

@ -0,0 +1,10 @@
namespace Entity
{
public class BuildingBase:Entity
{
public override void TryMove()
{
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eb881a08fe004eb4ab0a6fa9d5d86d33
timeCreated: 1753100586

View File

@ -10,12 +10,11 @@ namespace Entity
public class Character : Entity
{
public CharacterDef characterDef;
public GameObject body;
private void Start()
{
aiTree = new RandomWander();
runtimeAttributes = new AttributesDef();
attributes = new AttributesDef();
}
public void Init()

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using AI;
using Base;
@ -7,12 +8,14 @@ using UnityEngine.Serialization;
namespace Entity
{
public abstract class Entity:MonoBehaviour,ITick
public class Entity:MonoBehaviour,ITick
{
public AIBase aiTree;
public JobBase currentJob;
public AttributesDef runtimeAttributes;
public AttributesDef attributes;
public Vector3 direction;
public GameObject body;
public string affiliation;
public bool canSelect = true;
public bool IsChase { set; get; } = true;
@ -20,23 +23,86 @@ namespace Entity
{
set
{
if (!value)
if (value)
{
IsChase = true;
currentJob = null;
}
_isPlayerControlled = value;
}
get => _isPlayerControlled;
}
public bool IsDead => attributes.health <= 0;
private bool _isPlayerControlled = false;
private const int WarningInterval = 5000;
private int _warningTicks = 0;
private bool _warning = false;
public virtual void Init(PawnDef pawnDef)
{
attributes = pawnDef.attributes.Clone();
aiTree = ConvertToAIBase(pawnDef.behaviorTree);
affiliation=pawnDef.affiliation;
InitBody(pawnDef.drawingOrder);
}
public virtual void InitBody(DrawingOrderDef drawingOrder)
{
// 定义方向枚举和对应的 GetDrawingOrder 调用
Orientation[] orientations = { Orientation.Down, Orientation.Up, Orientation.Left, Orientation.Right };
foreach (var orientation in orientations)
{
// 获取当前方向的绘图节点
var drawNode = drawingOrder.GetDrawingOrder(orientation);
if (drawNode == null) continue;
var directionRoot = new GameObject(orientation.ToString());
directionRoot.transform.SetParent(body.transform, false);
InitBodyPart(drawNode, directionRoot);
}
}
// 递归初始化单个绘图节点及其子节点
public virtual void InitBodyPart(DrawNodeDef drawNode, GameObject parent)
{
if(drawNode==null) return;
// 创建新的 GameObject 表示当前节点
var nodeObject = new GameObject(drawNode.nodeName);
// 设置节点的父对象
nodeObject.transform.SetParent(parent.transform, false);
// 设置节点的位置
nodeObject.transform.localPosition = new Vector3(drawNode.position.x, drawNode.position.y, 0);
// 根据节点类型设置其他特性(例如动画或图片)
switch (drawNode.drawNodeType)
{
case DrawNodeType.Image:
var spriteRenderer = nodeObject.AddComponent<SpriteRenderer>();
spriteRenderer.color = Color.white; // 默认颜色
break;
case DrawNodeType.Animation:
var animator = nodeObject.AddComponent<Animator>();
animator.runtimeAnimatorController = null; // 需要手动设置动画控制器
break;
default:
throw new ArgumentOutOfRangeException();
}
// 递归初始化子节点
foreach (var child in drawNode.children)
{
InitBodyPart(child, nodeObject);
}
}
public void Tick()
{
if (PlayerControlled)
if (_isPlayerControlled)
{
UpdatePlayerControls();
}
@ -55,15 +121,15 @@ namespace Entity
/// </summary>
public virtual void TryMove()
{
transform.position+=direction * (runtimeAttributes.moveSpeed * Time.deltaTime * (IsChase ? 1 : 0.5f));
transform.position+=direction * (attributes.moveSpeed * Time.deltaTime * (IsChase ? 1 : 0.5f));
}
public virtual void OnHit(Entity from)
{
var hit = from.runtimeAttributes.attack - runtimeAttributes.defense;
var hit = from.attributes.attack - attributes.defense;
if (hit < 0)
hit = from.runtimeAttributes.attack / 100;
runtimeAttributes.health -= hit;
hit = from.attributes.attack / 100;
attributes.health -= hit;
currentJob.StopJob();
}
@ -73,9 +139,9 @@ namespace Entity
direction = (pos - transform.position).normalized;
}
public virtual void Kill(float delay = 0)
public virtual void Kill()
{
Destroy(gameObject,delay);
attributes.health = 0;
}
private void AutoBehave()
@ -85,13 +151,11 @@ namespace Entity
currentJob = aiTree.GetJob(this);
if (currentJob == null)
{
if (_warningTicks<=0)
if (!_warning)
{
Debug.LogWarning($"{GetType().Name}类型的{name}没有分配到任何工作,给行为树末尾添加等待行为,避免由于没有工作导致无意义的反复查找工作导致性能问题");
_warningTicks += WarningInterval;
_warning = true;
}
_warningTicks--;
return;
}
currentJob.StartJob(this);
@ -102,42 +166,97 @@ namespace Entity
private void UpdatePlayerControls()
{
// 获取当前键盘输入状态
var inputDirection = new Vector3();
// 检测 Shift 键状态
var isHoldingShift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
IsChase = !isHoldingShift; // 按住 Shift 时 IsChase = false否则 true
// 获取当前键盘输入状态2D 移动,只使用 X 和 Y 轴)
var inputDirection = Vector2.zero;
// 检测 WASD 输入
// 检测 WASD 或方向键输入
if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
{
inputDirection += Vector3.forward; // 向移动
inputDirection += Vector2.up; // 向移动Y 轴正方向)
}
if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
{
inputDirection += Vector3.back; // 向移动
inputDirection += Vector2.down; // 向移动Y 轴负方向)
}
if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
{
inputDirection += Vector3.left; // 向左移动
inputDirection += Vector2.left; // 向左移动X 轴负方向)
}
if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
{
inputDirection += Vector3.right; // 向右移动
inputDirection += Vector2.right; // 向右移动X 轴正方向)
}
// 如果有输入方向,则设置目标位置并尝试移动
if (inputDirection != Vector3.zero)
if (inputDirection == Vector2.zero) return;
// 归一化方向向量,确保对角线移动速度一致
inputDirection = inputDirection.normalized;
// 设置目标位置2D 移动Z 轴保持不变)
var targetPosition = transform.position + new Vector3(inputDirection.x, inputDirection.y, 0);
// 调用 SetTarget 方法设置目标位置
SetTarget(targetPosition);
// 调用 TryMove 方法处理实际移动逻辑
TryMove();
}
public static AIBase ConvertToAIBase(BehaviorTreeDef behaviorTreeDef)
{
if (behaviorTreeDef == null)
return null;
var aiBase = CreateAIBaseInstance(behaviorTreeDef.className);
if (behaviorTreeDef.childTree != null)
{
// 归一化方向向量,确保对角线移动速度一致
inputDirection = inputDirection.normalized;
// 设置目标位置(假设当前位置为 transform.position
Vector3 targetPosition = transform.position + inputDirection;
// 调用 SetTarget 方法设置目标位置
SetTarget(targetPosition);
// 调用 TryMove 方法处理实际移动逻辑
TryMove();
foreach (var child in behaviorTreeDef.childTree)
{
if (child != null)
{
aiBase.children.Add(ConvertToAIBase(child));
}
}
}
return aiBase;
}
// 使用反射根据 className 创建具体的 AIBase 子类实例
private static AIBase CreateAIBaseInstance(string className)
{
if (string.IsNullOrEmpty(className))
throw new ArgumentException("className 不能为空");
if (className.Equals("AIBase", StringComparison.OrdinalIgnoreCase))
{
return (AIBase)Activator.CreateInstance(typeof(AIBase));
}
// 定义可能的命名空间列表
var possibleNamespaces = new[] { "AI"};
foreach (var ns in possibleNamespaces)
{
try
{
// 获取当前程序集
var assembly = typeof(AIBase).Assembly;
// 尝试查找类型
var type = assembly.GetType($"{ns}.{className}");
if (type != null && typeof(AIBase).IsAssignableFrom(type))
{
// 如果找到合适的类型,则创建实例并返回
return (AIBase)Activator.CreateInstance(type);
}
}
catch
{
// 忽略单个命名空间的错误,继续尝试下一个命名空间
}
}
// 如果所有命名空间都未找到对应的类型,抛出异常
throw new InvalidOperationException($"无法找到类型 {className} 或该类型不是 AIBase 的子类");
}
}
}

View File

@ -1,13 +1,20 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace Entity
{
public class Outline:MonoBehaviour
public class Outline : MonoBehaviour
{
public GameObject body;
public SpriteRenderer outlineRenderer;
public CapsuleCollider2D outlineCollider;
public Entity entity;
private bool _select = false;
public void Init()
{
var size = GetSize();
@ -15,15 +22,17 @@ namespace Entity
outlineCollider.direction = size.x > size.y ? CapsuleDirection2D.Horizontal : CapsuleDirection2D.Vertical;
outlineCollider.size = size;
}
public void Show()
{
outlineRenderer.gameObject.SetActive(true);
outlineRenderer.enabled = true;
}
public void Hide()
{
outlineRenderer.gameObject.SetActive(false);
outlineRenderer.enabled = false;
}
/// <summary>
/// 获取指定对象及其所有子对象组成的图像的大小。
/// </summary>
@ -37,15 +46,52 @@ namespace Entity
if (renderers.Length == 0)
{
return new(-1,-1);
return new(-1, -1);
}
var totalBounds = renderers[0].bounds;
for (var i = 1; i < renderers.Length; i++)
{
totalBounds.Encapsulate(renderers[i].bounds);
}
var size = totalBounds.size;
return size;
}
private void OnMouseEnter()
{
Show();
_select = true;
}
private void OnMouseExit()
{
Hide();
_select = false;
}
private void OnMouseOver()
{
// 检测是否按下的是鼠标右键
if (Input.GetMouseButtonDown(1)) // 鼠标右键对应的是按钮索引 1
{
var rightMenu = Prefab.RightMenuPrefab.Instance;
rightMenu.Init(GetMenu());
rightMenu.transform.position=Input.mousePosition;
rightMenu.Show();
}
}
private List<(string name, UnityAction callback)> GetMenu()
{
var result = new List<(string name, UnityAction callback)>();
if(entity.PlayerControlled)
result.Add(("结束操控",()=>entity.PlayerControlled=false));
else
result.Add(("手动操控",()=>entity.PlayerControlled=true));
result.Add(("杀死",()=>entity.Kill()));
return result;
}
}
}

View File

@ -0,0 +1,151 @@
using UnityEngine;
namespace Entity
{
public class SpriteAnimator : MonoBehaviour
{
// 引用 SpriteRenderer 组件
[SerializeField] private SpriteRenderer spriteRenderer;
// 精灵列表
[SerializeField] private Sprite[] sprites;
// 动画帧率 (Frames Per Second)
[SerializeField] private float fps = 10f;
// 是否暂停动画
[SerializeField] private bool isPaused = false;
// 暂停时显示的静态精灵索引 (-1 表示不显示静态精灵)
[SerializeField] private int staticSpriteIndex = -1;
// 当前帧索引
private int currentFrameIndex = 0;
// 帧间隔时间
private float frameInterval;
// 计时器
private float timer;
private void Start()
{
// 初始化帧间隔时间
frameInterval = 1f / fps;
// 如果指定了静态精灵索引,则直接显示静态精灵
if (staticSpriteIndex >= 0 && staticSpriteIndex < sprites.Length)
{
ShowStaticSprite(staticSpriteIndex);
}
else
{
// 否则从第一个精灵开始
UpdateSprite();
}
}
private void Update()
{
// 如果暂停并且没有设置静态精灵,则不更新
if (isPaused && staticSpriteIndex == -1) return;
// 如果暂停并设置了静态精灵,则直接显示静态精灵
if (isPaused && staticSpriteIndex >= 0)
{
ShowStaticSprite(staticSpriteIndex);
return;
}
// 更新计时器
timer += Time.deltaTime;
// 如果达到下一帧的时间间隔
if (timer >= frameInterval)
{
timer -= frameInterval; // 重置计时器
UpdateSprite(); // 更新精灵
}
}
/// <summary>
/// 更新当前显示的精灵
/// </summary>
private void UpdateSprite()
{
if (sprites.Length == 0) return; // 如果没有精灵,则退出
// 设置当前帧的精灵
spriteRenderer.sprite = sprites[currentFrameIndex];
// 循环播放:更新到下一帧
currentFrameIndex = (currentFrameIndex + 1) % sprites.Length;
}
/// <summary>
/// 显示静态精灵
/// </summary>
/// <param name="index">静态精灵的索引</param>
private void ShowStaticSprite(int index)
{
if (index < 0 || index >= sprites.Length)
{
Debug.LogWarning("静态精灵索引超出范围!");
return;
}
// 显示指定的静态精灵
spriteRenderer.sprite = sprites[index];
}
/// <summary>
/// 开始播放动画
/// </summary>
public void PlayAnimation()
{
isPaused = false; // 取消暂停
staticSpriteIndex = -1; // 清除静态精灵索引
}
/// <summary>
/// 暂停动画并显示静态精灵
/// </summary>
/// <param name="index">静态精灵的索引</param>
public void PauseAnimationWithStaticSprite(int index)
{
if (index < 0 || index >= sprites.Length)
{
Debug.LogWarning("静态精灵索引超出范围!");
return;
}
isPaused = true; // 暂停动画
staticSpriteIndex = index; // 设置静态精灵索引
}
/// <summary>
/// 暂停动画但不显示静态精灵
/// </summary>
public void PauseAnimation()
{
isPaused = true; // 暂停动画
staticSpriteIndex = -1; // 不显示静态精灵
}
/// <summary>
/// 设置帧率
/// </summary>
/// <param name="newFps">新的帧率</param>
public void SetFPS(float newFps)
{
if (newFps <= 0)
{
Debug.LogWarning("帧率必须大于 0");
return;
}
fps = newFps;
frameInterval = 1f / fps; // 更新帧间隔时间
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 713a1742950a45d8b4be258a82321e45
timeCreated: 1753282330

View File

@ -44,16 +44,14 @@ namespace Managers
Dictionary<Type, FieldInfo[]> fieldCache = new();
// 需要链接的定义、需要链接的字段、链接信息
List<Tuple<Define, FieldInfo, Define>> defineCache = new();
HashSet<Define> processedDefines = new(); // 用于跟踪已处理的 Define 对象
void ProcessDefine(Define def, Define parentDef, FieldInfo parentField)
void ProcessDefine(Define def)
{
if (def == null || def.isReferene || processedDefines.Contains(def))
if (def == null || def.isReferene)
return;
processedDefines.Add(def);
// 如果字段信息已经缓存,则直接使用缓存
if (!fieldCache.TryGetValue(def.GetType(), out var defineFields))
{
@ -73,7 +71,7 @@ namespace Managers
continue;
if (defRef.isReferene)
{
defineCache.Add(new Tuple<Define, FieldInfo, Define>(parentDef, parentField, defRef));
defineCache.Add(new Tuple<Define, FieldInfo, Define>(def, defineField, defRef));
}
else
{
@ -84,33 +82,54 @@ namespace Managers
anonymousDefines.Add(typeName, new List<Define>());
anonymousDefines[typeName].Add(defRef);
}
ProcessDefine(defRef, def, defineField);
ProcessDefine(defRef);
}
}
}
foreach (var pack in packs)
{
foreach (var define in pack.Value.defines)
foreach (var (typeName, defList) in pack.Value.defines)
{
var typeName = define.Key;
var defList = define.Value;
if (!defines.ContainsKey(typeName))
defines[typeName] = new Dictionary<string, Define>();
foreach (var def in defList)
{
defines[typeName][def.defName] = def;
// 处理顶层 Define
ProcessDefine(def, null, null);
ProcessDefine(def);
}
}
}
foreach (var defRef in defineCache)
{
defRef.Item2.SetValue(defRef.Item1, FindDefine(defRef.Item3.description, defRef.Item3.defName));
if (defRef.Item1 == null)
{
Debug.LogError("defRef.Item1 为 null");
continue;
}
if (defRef.Item2 == null)
{
Debug.LogError("defRef.Item2 为 null");
continue;
}
var value = FindDefine(defRef.Item3.description, defRef.Item3.defName);
if (value == null)
{
Debug.LogError($"FindDefine 返回 null: description={defRef.Item3.description}, defName={defRef.Item3.defName}");
continue;
}
try
{
defRef.Item2.SetValue(defRef.Item1, value);
}
catch (Exception ex)
{
Debug.LogError($"SetValue 出错: {ex.Message}");
}
}
}
@ -138,7 +157,23 @@ namespace Managers
}
return null;
}
/// <summary>
/// 使用模板查找并返回指定类型的 Define 对象。
/// </summary>
/// <typeparam name="T">目标类型</typeparam>
/// <param name="defineName">定义名</param>
/// <returns>如果找到,返回转换为目标类型的 Define 对象;否则返回 null。</returns>
public T FindDefine<T>(string defineName) where T : Define
{
foreach (var typeDict in defines.Values)
{
if (typeDict.TryGetValue(defineName, out var define) && define is T result)
{
return result;
}
}
return null;
}
public DefinePack GetDefinePackage(Define define)
{
if (define == null || define.packID == null)

View File

@ -0,0 +1,107 @@
using System.Collections.Generic;
using System.Linq;
using Base;
using Prefab;
using UnityEngine;
namespace Managers
{
public class EntityManage:Utils.MonoSingleton<EntityManage>,ITick
{
public Dictionary<string, List<EntityPrefab>> factionEntities = new();
public GameObject entityLevel;
public EntityPrefab entityPrefab;
public void Tick()
{
foreach (var faction in factionEntities)
{
List<EntityPrefab> entitiesToRemove = new List<EntityPrefab>();
foreach (var entityPrefab in faction.Value)
{
if (entityPrefab.entity.IsDead)
{
entitiesToRemove.Add(entityPrefab);
}
else
{
ITick itike = entityPrefab.entity;
itike.Tick();
}
}
// 删除所有标记为死亡的实体
foreach (var entityToRemove in entitiesToRemove)
{
faction.Value.Remove(entityToRemove);
Destroy(entityToRemove.gameObject);
}
}
}
/// <summary>
/// 根据给定的PawnDef生成一个实体对象。
/// </summary>
/// <param name="pawnDef">定义实体属性的PawnDef对象。</param>
/// <param name="pos">实体生成的位置。</param>
/// <remarks>
/// 1. 如果entityPrefab或pawnDef为null则不会生成实体。
/// 2. 实体将被创建在entityLevel.transform下。
/// 3. 使用EntityPrefab组件初始化实体。
/// </remarks>
public void GenerateEntity(Data.PawnDef pawnDef, Vector3 pos)
{
// 检查entityPrefab是否为空
if (entityPrefab == null)
{
Debug.LogError("Error: entityPrefab is null. Please assign a valid prefab.");
return;
}
// 检查pawnDef是否为空
if (pawnDef == null)
{
Debug.LogError("Error: PawnDef is null. Cannot generate entity without a valid PawnDef.");
return;
}
try
{
// 实例化实体对象
var entity = Instantiate(entityPrefab.gameObject, pos, Quaternion.identity, entityLevel.transform);
// 获取EntityPrefab组件
var entityComponent = entity.GetComponent<EntityPrefab>();
// 检查EntityPrefab组件是否存在
if (entityComponent == null)
{
Debug.LogError($"Error: EntityPrefab component not found on the instantiated object: {entity.name}");
return;
}
// 初始化实体组件
entityComponent.Init(pawnDef);
// 确保派系键存在,并初始化对应的列表
var factionKey = pawnDef.attributes.label == null ? "default" : pawnDef.attributes.label;
if (!factionEntities.ContainsKey(factionKey))
{
factionEntities[factionKey] = new List<EntityPrefab>();
}
factionEntities[factionKey].Add(entityComponent);
}
catch (System.Exception ex)
{
// 捕获并记录任何异常
Debug.LogError($"An error occurred while generating the entity: {ex.Message}");
}
}
protected override void OnStart()
{
factionEntities.Clear();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: aa378b7511b04429b8b6b0efbcce825a
timeCreated: 1753149728

View File

@ -1,22 +0,0 @@
using Prefab;
using UnityEngine;
namespace Managers
{
public class Generator:MonoBehaviour
{
public GameObject entityLevel;
public EntityPrefab entityPrefab;
public void GenerateEntity(Data.PawnDef pawnDef, Vector3 pos)
{
if (entityPrefab == null || pawnDef == null)
return;
GameObject entity = Instantiate(entityPrefab.gameObject, pos, Quaternion.identity, entityLevel.transform);
// entity.name = pawnDef.name;
var entityComponent = entity.GetComponent<EntityPrefab>();
entityComponent?.Init(pawnDef);
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: d78f1b5a44344a4a987e308d3b9478cc
timeCreated: 1752937967

View File

@ -7,62 +7,95 @@ namespace Managers
{
public class PackagesImageManager : Utils.Singleton<PackagesImageManager>
{
public Dictionary<string, Texture2D> packagesImages = new();
public Dictionary<string, Sprite> sprites = new();
public Sprite defaultSprite;
public Dictionary<string, Dictionary<string, Texture2D>> packagesImages = new();
public Dictionary<string, Dictionary<string, Sprite>> sprites = new();
public void Init()
{
if (packagesImages.Count > 0)
return;
defaultSprite = Resources.Load<Sprite>("Default/DefaultImage");
if(defaultSprite)
Debug.Log("加载成功");
var imageDef = Managers.DefineManager.Instance.QueryDefinesByType<ImageDef>();
foreach (var ima in imageDef)
{
if (ima.path == null)
if (ima.path == null || ima.packID == null)
continue;
var pack = Managers.DefineManager.Instance.GetDefinePackage(ima);
var path = Path.Combine(pack.packRootPath, ima.path);
var texture = Configs.ConfigProcessor.LoadTextureByIO(path);
if (texture == null)
continue;
packagesImages.Add(ima.name, texture);
SplitTextureIntoSprites(ima.name, texture, ima.hCount, ima.wCount, ima.pixelsPerUnit);
continue;
var packId = ima.packID;
if (!packagesImages.ContainsKey(packId))
packagesImages[packId] = new Dictionary<string, Texture2D>();
packagesImages[packId].Add(ima.name, texture);
SplitTextureIntoSprites(packId, ima.name, texture, ima.hCount, ima.wCount, ima.pixelsPerUnit);
}
}
void SplitTextureIntoSprites(string name, Texture2D texture, int rows, int cols, int pixelsPerUnit)
private void SplitTextureIntoSprites(
string packId,
string baseName,
Texture2D texture,
int rows,
int cols,
int pixelsPerUnit)
{
if (texture == null || rows <= 0 || cols <= 0)
if (texture == null)
{
Debug.LogError("Invalid parameters for splitting texture.");
Debug.LogError("Texture is null.");
return;
}
// 如果行数或列数小于1则设为1不分割
rows = Mathf.Max(1, rows);
cols = Mathf.Max(1, cols);
var textureWidth = texture.width;
var textureHeight = texture.height;
// 如果不分割rows和cols都为1直接创建单个Sprite
if (rows == 1 && cols == 1)
{
if (!sprites.ContainsKey(packId))
sprites[packId] = new Dictionary<string, Sprite>();
Rect spriteRect = new Rect(0, 0, textureWidth, textureHeight);
var sprite = Sprite.Create(texture, spriteRect, new Vector2(0.5f, 0.5f), pixelsPerUnit);
sprites[packId][baseName] = sprite;
return;
}
var tileWidth = textureWidth / cols;
var tileHeight = textureHeight / rows;
// 确保纹理可以被整除
if (tileWidth * cols != textureWidth || tileHeight * rows != textureHeight)
{
Debug.LogError("Texture dimensions are not divisible by the specified rows and columns.");
return;
}
if (!sprites.ContainsKey(packId))
sprites[packId] = new Dictionary<string, Sprite>();
// 遍历每一行和每一列
for (var row = 0; row < rows; row++)
{
for (var col = 0; col < cols; col++)
{
// 计算当前小块的矩形区域
var spriteRect = new Rect(col * tileWidth, row * tileHeight, tileWidth, tileHeight);
// 创建Sprite
var sprite = Sprite.Create(texture, (Rect)spriteRect, new Vector2(0.5f, 0.5f), pixelsPerUnit);
Rect spriteRect = new(col * tileWidth, row * tileHeight, tileWidth, tileHeight);
var sprite = Sprite.Create(texture, spriteRect, new Vector2(0.5f, 0.5f), pixelsPerUnit);
var index = (rows - row - 1) * cols + col;
sprites[name + $"_{index}"] = sprite;
var spriteName = $"{baseName}_{index}";
sprites[packId][spriteName] = sprite;
}
}
}
@ -70,18 +103,33 @@ namespace Managers
public void Reload()
{
packagesImages.Clear();
sprites.Clear();
Init();
}
public Sprite GetSprite(string name)
public Sprite GetSprite(string packID, string name)
{
return sprites.GetValueOrDefault(name, null);
if (string.IsNullOrEmpty(packID))
{
foreach (var kvp in sprites)
{
if (kvp.Value.TryGetValue(name, out var sprite))
return sprite;
}
}
else if (sprites.TryGetValue(packID, out var dict))
{
if (dict.TryGetValue(name, out var sprite))
return sprite;
}
return defaultSprite;
}
public Sprite GetSprite(string name, int index)
public Sprite GetSprite(string packID, string name, int index)
{
name += $"_{index}";
return GetSprite(name);
var fullName = $"{name}_{index}";
return GetSprite(packID, fullName);
}
}
}

View File

@ -142,7 +142,7 @@ namespace Map
continue;
}
var sprite = imagePack.GetSprite(val);
var sprite = imagePack.GetSprite(mappingTableDef.packID,val);
if (sprite == null)
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);

View File

@ -16,63 +16,13 @@ namespace Prefab
public void Init(Data.PawnDef pawnDef)
{
entity.runtimeAttributes = pawnDef.attributes.Clone();
entity.aiTree = ConvertToAIBase(pawnDef.behaviorTree);
entity.Init(pawnDef);
outline.Init();
outline.Hide();
}
public static AIBase ConvertToAIBase(BehaviorTreeDef behaviorTreeDef)
{
if (behaviorTreeDef == null)
return null;
AIBase aiBase = CreateAIBaseInstance(behaviorTreeDef.className);
if (behaviorTreeDef.childTree != null)
{
foreach (var child in behaviorTreeDef.childTree)
{
if (child != null)
{
aiBase.children.Add(ConvertToAIBase(child));
}
}
}
return aiBase;
}
// 使用反射根据 className 创建具体的 AIBase 子类实例
private static AIBase CreateAIBaseInstance(string className)
{
if (string.IsNullOrEmpty(className))
throw new ArgumentException("className 不能为空");
// 定义可能的命名空间列表
var possibleNamespaces = new[] { "AI"};
foreach (var ns in possibleNamespaces)
{
try
{
// 获取当前程序集
var assembly = typeof(AIBase).Assembly;
// 尝试查找类型
var type = assembly.GetType($"{ns}.{className}");
if (type != null && typeof(AIBase).IsAssignableFrom(type))
{
// 如果找到合适的类型,则创建实例并返回
return (AIBase)Activator.CreateInstance(type);
}
}
catch
{
// 忽略单个命名空间的错误,继续尝试下一个命名空间
}
}
// 如果所有命名空间都未找到对应的类型,抛出异常
throw new InvalidOperationException($"无法找到类型 {className} 或该类型不是 AIBase 的子类");
}
}
}

View File

@ -0,0 +1,89 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace Prefab
{
public class RightMenuPrefab: Utils.MonoSingleton<RightMenuPrefab>,IPointerExitHandler
{
public GameObject menu;
public ButtonPrefab buttonPrefab;
public void Show()
{
gameObject.SetActive(true);
}
public void Hide()
{
gameObject.SetActive(false);
}
public void Init(List<(string name, UnityAction callback)> buttons)
{
if (menu == null || buttonPrefab == null)
{
Debug.LogError("Menu or ButtonPrefab is not assigned!");
return;
}
ClearMenu();
foreach (var (label, callback) in buttons)
{
// 实例化按钮预制体
var instantiatedButton = Instantiate(buttonPrefab.gameObject, menu.transform);
var buttonInstance = instantiatedButton.GetComponent<ButtonPrefab>();
if (buttonInstance != null)
{
// 设置按钮文本
buttonInstance.Label = label;
// 创建一个新的回调函数,包含原始回调和隐藏菜单的操作
UnityAction wrappedCallback = () =>
{
try
{
// 执行原始回调
callback?.Invoke();
}
catch (System.Exception e)
{
Debug.LogError($"Error executing callback for button '{label}': {e.Message}");
}
finally
{
// 隐藏菜单
Hide();
}
};
// 添加包装后的回调
buttonInstance.AddListener(wrappedCallback);
}
else
{
Debug.LogError("Failed to get ButtonPrefab component from instantiated object!");
}
}
}
public void ClearMenu()
{
// 遍历菜单下的所有子对象并销毁它们
foreach (Transform child in menu.transform)
{
Destroy(child.gameObject);
}
}
protected override void OnStart()
{
Hide();
}
public void OnPointerExit(PointerEventData eventData)
{
Hide();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e45cfe2f36eb4f589b6d8f331567974d
timeCreated: 1753196238

View File

@ -1,31 +0,0 @@
using Base;
using UnityEngine;
namespace Test
{
public class ClockTest : MonoBehaviour
{
//private static float timer = 0;
// Start is called once before the first execution of Update after the MonoBehaviour is created
private void Start()
{
var clock = Clock.Instance;
}
// Update is called once per frame
//void Update()
//{
// if (Input.GetKeyUp(KeyCode.W))
// {
// SceneManager.LoadScene("SampleScene");
// }
// if (timer > 1)
// {
// timer -= 1;
// Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ӳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>");
// }
// timer += Time.deltaTime;
//}
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: be939c7ca1c4f374b83b6535b3cbb656

View File

@ -1,3 +1,6 @@
using System;
using Data;
using Managers;
using UnityEngine;
namespace Test
@ -6,11 +9,17 @@ namespace Test
public class TestDefine : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
public EntityManage entityManager;
void Awake()
{
Managers.DefineManager.Instance.Init();
Debug.Log(Managers.DefineManager.Instance);
}
private void Start()
{
var chicken = Managers.DefineManager.Instance.FindDefine<CharacterDef>("testPawn");
entityManager.GenerateEntity(chicken,Vector3.zero);
Debug.Log(chicken);
}
// Update is called once per frame

View File

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Data;
using UnityEngine;
using UnityEngine.UI;
@ -47,6 +48,8 @@ namespace UI
{
var button=InstantiatePrefab(buttonTemplate, menuContent.transform);
button.Label = def.label;
var pawnDef = def;
button.AddListener(() => GenerateEntityCallback(pawnDef));
}
}
/// <summary>
@ -78,6 +81,10 @@ namespace UI
return instantiatedComponent;
}
void GenerateEntityCallback(PawnDef pawnDef)
{
Managers.EntityManage.Instance.GenerateEntity(pawnDef, new(0, 0));
}
}
}

View File

@ -22,7 +22,7 @@
<!-- 2 + (1 * 4) = 6 -->
<Dirt_Dirt_Dirt_Grass value="GrassDirt_13"/>
<!-- 1 + (3 * 4) = 13 -->
<Dirt_Dirt_Grass_Dirt value="GrassDirt_0"/>
<Dirt_Dirt_Grass_Dirt value="GrassDirt_110"/>
<!-- 0 + (0 * 4) = 0 -->
<Dirt_Grass_Dirt_Dirt value="GrassDirt_8"/>
<!-- 0 + (2 * 4) = 8 -->

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Define>
<AttributesDef>
<defName>TestCharacter</defName>
<health>100</health>
@ -9,11 +10,17 @@
<CharacterDef>
<defName>testPawn</defName>
<label>测试小人</label>
<drawingOrder_down>
<DrawNodeDef name="body"/>
</drawingOrder_down>
<description>用于测试功能的角色</description>
<attributes>TestCharacter</attributes>
<affiliation>player</affiliation>
<drawingOrder>
<texturePath>Resources/Character/CatGirl</texturePath>
<drawingOrder_down>
<node name="body"/>
</drawingOrder_down>
</drawingOrder>
<behaviorTree>
<Node className="TrackPlayer"/>
<Node className="RandomWander"/>
</behaviorTree>
</CharacterDef>

View File

@ -1,17 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Define>
<MonsterAttackDef>
<defName>tenMonster</defName>
<immediate>
<count>10</count>
</immediate>
</MonsterAttackDef>
<MonsterDef>
<defName>cheken</defName>
<defName>chicken</defName>
<label>测试鸡</label>
<aiController>embrace</aiController>
<weapon>Claw</weapon>
<!-- <weapon>Claw</weapon> -->
<behaviorTree>
<!-- 如果名字叫做cxk -->
<Node className="ConditionalAI" condition="entity.name=='cxk'">
<!-- 顺序执行 -->
<Node className="SequentialAI">
<!-- 追踪玩家 -->
<Node className="TrackPlayer"/>
<!-- 随机闲逛 -->
<Node className="RandomWander"/>
</Node>
</Node>
<!-- 随机闲逛 -->
<Node className="RandomWander"/>
</behaviorTree>
</MonsterDef>