(client) feat:实现摄像机跟踪,柏林噪声改为单例,角色渲染树支持指定像素密度

chore:将UI的Tick进行了显示时显式添加并作为预制体
This commit is contained in:
m0_75251201
2025-08-05 14:54:30 +08:00
parent 3c9be3a30c
commit 6a222d82b2
29 changed files with 2217 additions and 3262 deletions

View File

@ -0,0 +1,466 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2669798517361862450
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8654739876786722101}
- component: {fileID: 7402578691222625163}
m_Layer: 5
m_Name: EntityPlacementUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8654739876786722101
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2669798517361862450}
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: 7782696062465364445}
- {fileID: 992367162028424711}
- {fileID: 1914629702951577723}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &7402578691222625163
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2669798517361862450}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 22c2554b0c0949aab37618f3a80ffe5a, type: 3}
m_Name:
m_EditorClassIdentifier:
exclusive: 1
needPause: 1
isInputOccupied: 1
actionButton: 0
promptText: {fileID: 4541848766221811720}
--- !u!1 &3815626671234026069
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1914629702951577723}
- component: {fileID: 3616185305303010002}
- component: {fileID: 4541848766221811720}
m_Layer: 5
m_Name: prompt
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1914629702951577723
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3815626671234026069}
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: 8654739876786722101}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 110, y: -160}
m_SizeDelta: {x: 200, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3616185305303010002
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3815626671234026069}
m_CullTransparentMesh: 1
--- !u!114 &4541848766221811720
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3815626671234026069}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u8BF4\u660E\u6587\u672C"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_sharedMaterial: {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2533359615
m_fontColor: {r: 1, g: 1, b: 1, a: 0.5882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 12
m_fontSizeBase: 12
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5084173435030275924
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7782696062465364445}
- component: {fileID: 2616273789460816732}
- component: {fileID: 4475653812953191369}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7782696062465364445
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5084173435030275924}
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: 8654739876786722101}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -50}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2616273789460816732
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5084173435030275924}
m_CullTransparentMesh: 1
--- !u!114 &4475653812953191369
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5084173435030275924}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "--\u6682\u505C\u4E2D--"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_sharedMaterial: {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2533359615
m_fontColor: {r: 1, g: 1, b: 1, a: 0.5882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &6401807867501474515
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 992367162028424711}
- component: {fileID: 8472541135328430158}
- component: {fileID: 5585349297193151846}
m_Layer: 5
m_Name: Text (TMP) (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &992367162028424711
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6401807867501474515}
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: 8654739876786722101}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -15}
m_SizeDelta: {x: 200, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8472541135328430158
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6401807867501474515}
m_CullTransparentMesh: 1
--- !u!114 &5585349297193151846
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6401807867501474515}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u6309Esc\u8FD4\u56DE\uFF0C\u70B9\u51FB\u4EFB\u610F\u4F4D\u7F6E\u751F\u6210"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_sharedMaterial: {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2533359615
m_fontColor: {r: 1, g: 1, b: 1, a: 0.5882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 12
m_fontSizeBase: 12
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}

View File

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

View File

@ -0,0 +1,490 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3530227357112532485
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1633840166558733415}
- component: {fileID: 4955394867221047595}
- component: {fileID: 925583570261713930}
m_Layer: 5
m_Name: EscUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1633840166558733415
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3530227357112532485}
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: 2054715303808414256}
- {fileID: 5084767838786362069}
- {fileID: 5683899746708222069}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &4955394867221047595
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3530227357112532485}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7eac7c56e1474c4ea646c0a408d293a3, type: 3}
m_Name:
m_EditorClassIdentifier:
exclusive: 0
needPause: 1
isInputOccupied: 0
actionButton: 27
--- !u!114 &925583570261713930
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3530227357112532485}
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: 4
m_Spacing: 10
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1001 &861726664512651295
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1633840166558733415}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: continue
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: 1
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: 1
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: 399.99997
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -184.99998
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: "\u7EE7\u7EED"
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 4955394867221047595}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ContinueButton
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: UI.EscUI, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &2054715303808414256 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 861726664512651295}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5901437432862894330
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1633840166558733415}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: settings
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: 1
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: 1
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: 399.99997
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -224.99998
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: "\u8BBE\u7F6E"
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 4955394867221047595}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: SettingsButton
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: UI.EscUI, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &5084767838786362069 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 5901437432862894330}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6455879070007984730
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1633840166558733415}
m_Modifications:
- target: {fileID: 190104900697248908, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_Name
value: exit
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: 1
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: 1
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: 399.99997
objectReference: {fileID: 0}
- target: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -265
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: "\u9000\u51FA"
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 4955394867221047595}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ExitButton
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: UI.EscUI, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 8827200521422920569, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
--- !u!224 &5683899746708222069 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1690722858018107951, guid: f0afd08be12de0d43af753af4f618da4, type: 3}
m_PrefabInstance: {fileID: 6455879070007984730}
m_PrefabAsset: {fileID: 0}

View File

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

View File

@ -0,0 +1,191 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6234599666576187591
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4909647461971021489}
- component: {fileID: 6064786699131207108}
- component: {fileID: 1754810506731636903}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4909647461971021489
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6234599666576187591}
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: 6806539210387795853}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: -50}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6064786699131207108
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6234599666576187591}
m_CullTransparentMesh: 1
--- !u!114 &1754810506731636903
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6234599666576187591}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "--\u6682\u505C\u4E2D--"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_sharedMaterial: {fileID: -1361428157011412921, guid: 317edb274e9c5144a9916937bdbf7716, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2533359615
m_fontColor: {r: 1, g: 1, b: 1, a: 0.5882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8396046402299122671
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6806539210387795853}
- component: {fileID: 4127228141304923084}
m_Layer: 5
m_Name: Pause
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &6806539210387795853
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8396046402299122671}
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: 4909647461971021489}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &4127228141304923084
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8396046402299122671}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bcc7e9d015ee465684be520b65c2e182, type: 3}
m_Name:
m_EditorClassIdentifier:
exclusive: 0
needPause: 1
isInputOccupied: 0
actionButton: 112

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -73,7 +73,7 @@ namespace AI
{
public override JobBase GetJob(Entity.Entity target)
{
throw new NotImplementedException();
return new TrackPlayerJob();
}
}
public class RandomWander : AIBase
@ -83,5 +83,11 @@ namespace AI
return new WanderJob();
}
}
public class Idel : AIBase
{
public override JobBase GetJob(Entity.Entity target)
{
return new IdleJob();
}
}
}

View File

@ -114,6 +114,10 @@ namespace Base
// 显示目标窗口并更新缓存与暂停状态
windowToShow.Show();
var itick=windowToShow as ITickUI;
if (itick != null)
Base.Clock.AddTickUI(itick);
needUpdate = true;
}

View File

@ -1,13 +1,85 @@
using Base;
using UnityEngine;
namespace CameraControl
{
public class CameraControl:MonoBehaviour,Base.ITick
public class CameraControl : Utils.MonoSingleton<CameraControl>, ITick, ITickUI
{
public Entity.Entity focusedEntity=null;
// 当前被聚焦的目标实体
public Entity.Entity focusedEntity = null;
// Camera movement variables
private Vector3 _dragOrigin;
private bool _isDragging = false;
private float _zoomSpeed = 5f;
private float _minZoom = 2f;
private float _maxZoom = 20f;
private Camera _camera;
protected override void OnStart()
{
_camera = Camera.main;
if (_camera == null)
{
_camera = FindFirstObjectByType<Camera>();
}
}
public void Tick()
{
if (focusedEntity)
{
// Follow the focused entity's position
var targetPosition = new Vector3(
focusedEntity.Position.x,
focusedEntity.Position.y,
_camera.transform.position.z);
_camera.transform.position = Vector3.Lerp(
_camera.transform.position,
targetPosition,
Time.fixedDeltaTime * 5f);
}
}
public void TickUI()
{
HandleMiddleMouseDrag();
HandleMouseZoom();
}
private void HandleMiddleMouseDrag()
{
// Start drag
if (Input.GetMouseButtonDown(2)) // Middle mouse button
{
_dragOrigin = _camera.ScreenToWorldPoint(Input.mousePosition);
_isDragging = true;
focusedEntity = null; // Clear focus when manually moving camera
}
// During drag
if (Input.GetMouseButton(2) && _isDragging)
{
var difference = _dragOrigin - _camera.ScreenToWorldPoint(Input.mousePosition);
_camera.transform.position += difference;
}
// End drag
if (Input.GetMouseButtonUp(2))
{
_isDragging = false;
}
}
private void HandleMouseZoom()
{
var scroll = Input.GetAxis("Mouse ScrollWheel");
if (scroll == 0) return;
var newSize = _camera.orthographicSize - scroll * _zoomSpeed;
_camera.orthographicSize = Mathf.Clamp(newSize, _minZoom, _maxZoom);
}
}
}

View File

@ -32,6 +32,7 @@ namespace Data
public DrawNodeDef drawingOrder_left;
public DrawNodeDef drawingOrder_right;
public string texturePath;
public int pixelsPerUnit = 16;
public DrawNodeDef GetDrawingOrder(Orientation orientation)
{
@ -73,7 +74,7 @@ namespace Data
public DrawNodeType drawNodeType = DrawNodeType.Image;
public string nodeName;
public Vector2 position = new(0, 0);
public float FPS = 1;
public float FPS = 0.5f;
public override bool Init(XElement xmlDef)
{

View File

@ -14,6 +14,8 @@ namespace Entity
public Entity entity;
private bool _select = false;
public static Vector3 minimum=new(0.5f,0.5f,0.5f);
public void Init()
{
@ -42,20 +44,32 @@ namespace Entity
/// </returns>
public Vector3 GetSize()
{
// 获取所有子对象的 Renderer 组件
var renderers = body.GetComponentsInChildren<Renderer>();
// 如果没有找到任何 Renderer返回一个默认值 (-1, -1, -1)
if (renderers.Length == 0)
{
return new(-1, -1);
return minimum;
}
// 初始化 totalBounds 为第一个 Renderer 的 bounds
var totalBounds = renderers[0].bounds;
// 遍历剩余的 Renderer将它们的 bounds 合并到 totalBounds 中
for (var i = 1; i < renderers.Length; i++)
{
totalBounds.Encapsulate(renderers[i].bounds);
}
// 获取合并后的包围盒的大小
var size = totalBounds.size;
// 确保每个维度的大小都不小于 0.5
size.x = Mathf.Max(size.x, 0.5f);
size.y = Mathf.Max(size.y, 0.5f);
size.z = Mathf.Max(size.z, 0.5f);
return size;
}
@ -87,11 +101,11 @@ namespace Entity
{
var result = new List<(string name, UnityAction callback)>();
if (entity.PlayerControlled)
result.Add(("结束操控", () => entity.PlayerControlled = false));
result.Add(("结束操控", EndControl));
else
result.Add(("手动操控", () => entity.PlayerControlled = true));
result.Add(("手动操控", StartControl));
result.Add(("杀死", () => entity.Kill()));
result.Add(("变成笨蛋", () => BecomeDefault()));
result.Add(("变成笨蛋", BecomeDefault));
return result;
}
@ -100,5 +114,17 @@ namespace Entity
entity.Kill();
Managers.EntityManage.Instance.GenerateDefaultEntity(entity.Position);
}
private void StartControl()
{
entity.PlayerControlled = true;
CameraControl.CameraControl.Instance.focusedEntity=entity;
}
private void EndControl()
{
entity.PlayerControlled = false;
CameraControl.CameraControl.Instance.focusedEntity=null;
}
}
}

View File

@ -25,7 +25,6 @@ namespace Managers
defaultSprite = Resources.Load<Sprite>("Default/DefaultImage");
InitImageDef();
InitDrawOrder();
packagesImages = null;
}
public void InitImageDef()
@ -54,39 +53,101 @@ namespace Managers
public void InitDrawOrder()
{
var drawOrderDef = Managers.DefineManager.Instance.QueryDefinesByType<DrawingOrderDef>();
if (drawOrderDef == null || drawOrderDef.Length == 0)
try
{
return;
}
Dictionary<string, string> packRootSite = new();
foreach (var drawOrder in drawOrderDef)
{
if (string.IsNullOrEmpty(drawOrder.texturePath) || string.IsNullOrEmpty(drawOrder.packID))
continue;
if (!packRootSite.ContainsKey(drawOrder.packID))
packRootSite[drawOrder.packID] = Managers.DefineManager.Instance.GetPackagePath(drawOrder.packID);
var rootPath= packRootSite[drawOrder.packID];
var folderPath=Path.Combine(rootPath, drawOrder.texturePath);
var imagePath = Configs.ConfigProcessor.GetFilesByExtensions(folderPath,
new[]
{
"jpg", "jpeg", "png", "tga", "tif", "tiff", "psd", "bmp"
});
foreach (var path in imagePath)
// 查询绘制顺序定义
var drawOrderDef = Managers.DefineManager.Instance.QueryDefinesByType<DrawingOrderDef>();
if (drawOrderDef == null || drawOrderDef.Length == 0)
{
var image=Configs.ConfigProcessor.LoadTextureByIO(path);
if (image == null)
continue;
var spr=Sprite.Create(
image,
new Rect(0, 0, image.width, image.height),
new Vector2(0.5f, 0.5f) // 中心点
);
var name=Path.GetFileNameWithoutExtension(path);
InsertBodyTexture(drawOrder.packID, drawOrder.texturePath, name, spr);
Debug.LogWarning("No DrawingOrderDef found.");
return;
}
// 初始化包路径字典
Dictionary<string, string> packRootSite = new();
foreach (var drawOrder in drawOrderDef)
{
// 检查必要字段是否为空
if (string.IsNullOrEmpty(drawOrder.texturePath) || string.IsNullOrEmpty(drawOrder.packID))
{
Debug.LogWarning(
$"Skipping invalid drawOrder: texturePath or packID is null or empty. PackID: {drawOrder.packID}");
continue;
}
// 获取包路径
if (!packRootSite.ContainsKey(drawOrder.packID))
{
var packagePath = Managers.DefineManager.Instance.GetPackagePath(drawOrder.packID);
if (string.IsNullOrEmpty(packagePath))
{
Debug.LogError($"Package path not found for packID: {drawOrder.packID}");
continue;
}
packRootSite[drawOrder.packID] = packagePath;
}
var rootPath = packRootSite[drawOrder.packID];
var folderPath = Path.Combine(rootPath, drawOrder.texturePath);
// 获取图像文件列表
try
{
var imagePath = Configs.ConfigProcessor.GetFilesByExtensions(folderPath,
new[] { "jpg", "jpeg", "png", "tga", "tif", "tiff", "psd", "bmp" });
foreach (var path in imagePath)
{
// 加载纹理
Texture2D image = null;
try
{
image = Configs.ConfigProcessor.LoadTextureByIO(path);
}
catch (Exception ex)
{
Debug.LogError($"Failed to load texture from path: {path}. Error: {ex.Message}");
continue;
}
if (image == null)
{
Debug.LogWarning($"Texture loaded from path: {path} is null.");
continue;
}
// 创建精灵
try
{
var spr = Sprite.Create(
image,
new Rect(0, 0, image.width, image.height),
new Vector2(0.5f, 0.5f), // 中心点
drawOrder.pixelsPerUnit
);
var name = Path.GetFileNameWithoutExtension(path);
// 插入纹理
InsertBodyTexture(drawOrder.packID, drawOrder.texturePath, name, spr);
}
catch (Exception ex)
{
Debug.LogError($"Failed to create sprite from texture: {path}. Error: {ex.Message}");
}
}
}
catch (Exception ex)
{
Debug.LogError($"Failed to retrieve files from folder: {folderPath}. Error: {ex.Message}");
}
}
}
catch (Exception ex)
{
Debug.LogError($"An unexpected error occurred in InitDrawOrder: {ex.Message}");
}
}

View File

@ -0,0 +1,87 @@
using System.Collections.Generic;
using Data;
using UnityEngine;
using UnityEngine.Tilemaps;
namespace Managers
{
public class TileManager:Utils.Singleton<TileManager>
{
public Dictionary<string,TileBase> tileBaseMapping = new();
public Dictionary<(int, int, int, int), TileBase> tileToTileBaseMapping = new();
public Dictionary<string, int> tileID = new();
public void Init()
{
if (tileToTileBaseMapping.Count > 0)
return;
Managers.PackagesImageManager.Instance.Init();
var imagePack = Managers.PackagesImageManager.Instance;
var tileType = Managers.DefineManager.Instance.QueryDefinesByType<TileDef>();
for (var i = 0; i < tileType.Length; i++)
{
tileID.Add(tileType[i].name, i);
}
var tileTextureMappingDef=Managers.DefineManager.Instance.QueryDefinesByType<TileMappingTableDef>();
foreach (var mappingTableDef in tileTextureMappingDef)
{
foreach (var keyVal in mappingTableDef.tileDict)
{
var key = keyVal.Key;
var val = keyVal.Value;
var parts = key.Split('_');
if (parts.Length != 4)
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{key}内容不合法!\n应该为[瓦片名称_瓦片名称_瓦片名称_瓦片名称]的格式");
continue;
}
if (!(tileID.TryGetValue(parts[0], out var k1) &&
tileID.TryGetValue(parts[1], out var k2) &&
tileID.TryGetValue(parts[2], out var k3) &&
tileID.TryGetValue(parts[3], out var k4)))
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{key}中存在未定义的瓦片名称");
continue;
}
var sprite = imagePack.GetSprite(mappingTableDef.packID,val);
if (sprite == null)
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{val}中存在未定义的图片名称");
continue;
}
if (tileToTileBaseMapping.ContainsKey((k1, k2, k3, k4)))
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogWarning($"来自{packName}定义的TileMappingTableDef键值{(k1, k2, k3, k4)}存在重复索引,将忽略重复项");
continue;
}
var tile = LoadTile(sprite);
tileToTileBaseMapping[(k1, k2, k3, k4)] = tile;
tileBaseMapping[val] = tile;
}
}
}
public void Reload()
{
tileToTileBaseMapping.Clear();
Init();
}
public TileBase LoadTile(Sprite sprite)
{
var newTile = ScriptableObject.CreateInstance<Tile>();
newTile.sprite = sprite;
newTile.color = Color.white;
newTile.colliderType = Tile.ColliderType.Sprite;
return newTile;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ff3c1eb2791148068c9f03baeb04f96f
timeCreated: 1754375678

View File

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using Data;
using Managers;
using UnityEngine;
using UnityEngine.Tilemaps;
@ -9,23 +10,30 @@ namespace Map
public class DoubleMap : MonoBehaviour
{
public List<List<int>> mapData = new();
// public Tilemap dataLevel;
public Tilemap textureLevel;
public Dictionary<string, TileBase> tileDict = new();
private int offsetX = 0; // 地图数据的 X 偏移量
private int offsetY = 0; // 地图数据的 Y 偏移量
void Start()
{
TileManager.Instance.Init();
var mapSize = 10;
float noiseScale = 0.1f;
// 设置偏移量
offsetX = -5; // 示例:地图数据从 (-5, -5) 开始
offsetY = -5;
for (int x = 0; x < mapSize; x++)
{
List<int> col = new();
for (int y = 0; y < mapSize; y++)
{
// 计算柏林噪声值
float noiseValue = Mathf.PerlinNoise(x * noiseScale, y * noiseScale);
float noiseValue = Mathf.PerlinNoise((x + offsetX) * noiseScale, (y + offsetY) * noiseScale);
if (noiseValue < 0.5f) // 小于 0.5 表示 Dirt
{
col.Add(TileManager.Instance.tileID.GetValueOrDefault("Dirt"));
@ -34,11 +42,12 @@ namespace Map
{
col.Add(TileManager.Instance.tileID.GetValueOrDefault("Grass"));
}
}
mapData.Add(col);
UpdateTexture();
}
UpdateTexture();
}
public void UpdateTexture()
@ -54,33 +63,46 @@ namespace Map
public int GetTile(int x, int y)
{
if (x < 0 || x >= mapData.Count)
// 转换为相对于 mapData 的索引
int relativeX = x - offsetX;
int relativeY = y - offsetY;
if (relativeX < 0 || relativeX >= mapData.Count)
{
return 0;
}
var col = mapData[x];
if (y < 0 || y >= mapData.Count)
var col = mapData[relativeX];
if (relativeY < 0 || relativeY >= mapData.Count)
{
return 0;
}
return col[y];
return col[relativeY];
}
public void SetTile(int x, int y, string tileName)
{
SetTile(x,y,TileManager.Instance.tileID.GetValueOrDefault(tileName));
SetTile(x, y, TileManager.Instance.tileID.GetValueOrDefault(tileName));
}
public void SetTile(int x, int y, int id)
{
mapData[x][y] = id;
UpdateTexture(x, y);
UpdateTexture(x, y-1);
UpdateTexture(x-1, y);
UpdateTexture(x-1, y-1);
// 转换为相对于 mapData 的索引
int relativeX = x - offsetX;
int relativeY = y - offsetY;
if (relativeX >= 0 && relativeX < mapData.Count &&
relativeY >= 0 && relativeY < mapData[relativeX].Count)
{
mapData[relativeX][relativeY] = id;
UpdateTexture(x, y);
UpdateTexture(x, y - 1);
UpdateTexture(x - 1, y);
UpdateTexture(x - 1, y - 1);
}
}
/// <summary>
/// 更新对应坐标的贴图
/// </summary>
@ -89,94 +111,27 @@ namespace Map
/// <returns></returns>
public void UpdateTexture(int x, int y)
{
// 转换为相对于 mapData 的索引
int relativeX = x - offsetX;
int relativeY = y - offsetY;
if (relativeX < 0 || relativeX >= mapData.Count ||
relativeY < 0 || relativeY >= mapData[relativeX].Count)
{
return; // 如果超出范围,直接返回
}
var lt = GetTile(x, y + 1);
var rt = GetTile(x + 1, y + 1);
var lb = GetTile(x, y);
var rb = GetTile(x + 1, y);
if (TileManager.Instance.tileToTileBaseMapping.ContainsKey((lt, rt, lb, rb)))
{
textureLevel.SetTile(new(x,y),TileManager.Instance.tileToTileBaseMapping[(lt, rt, lb, rb)]);
textureLevel.SetTile(new Vector3Int(x, y, 0),
TileManager.Instance.tileToTileBaseMapping[(lt, rt, lb, rb)]);
}
}
}
public class TileManager:Utils.Singleton<TileManager>
{
public Dictionary<string,TileBase> tileBaseMapping = new();
public Dictionary<(int, int, int, int), TileBase> tileToTileBaseMapping = new();
public Dictionary<string, int> tileID = new();
public void Init()
{
if (tileToTileBaseMapping.Count > 0)
return;
Managers.PackagesImageManager.Instance.Init();
var imagePack = Managers.PackagesImageManager.Instance;
var tileType = Managers.DefineManager.Instance.QueryDefinesByType<TileDef>();
for (var i = 0; i < tileType.Length; i++)
{
tileID.Add(tileType[i].name, i);
}
var tileTextureMappingDef=Managers.DefineManager.Instance.QueryDefinesByType<TileMappingTableDef>();
foreach (var mappingTableDef in tileTextureMappingDef)
{
foreach (var keyVal in mappingTableDef.tileDict)
{
var key = keyVal.Key;
var val = keyVal.Value;
var parts = key.Split('_');
if (parts.Length != 4)
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{key}内容不合法!\n应该为[瓦片名称_瓦片名称_瓦片名称_瓦片名称]的格式");
continue;
}
if (!(tileID.TryGetValue(parts[0], out var k1) &&
tileID.TryGetValue(parts[1], out var k2) &&
tileID.TryGetValue(parts[2], out var k3) &&
tileID.TryGetValue(parts[3], out var k4)))
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{key}中存在未定义的瓦片名称");
continue;
}
var sprite = imagePack.GetSprite(mappingTableDef.packID,val);
if (sprite == null)
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogError($"来自{packName}定义的TileMappingTableDef键值{val}中存在未定义的图片名称");
continue;
}
if (tileToTileBaseMapping.ContainsKey((k1, k2, k3, k4)))
{
var packName = Managers.DefineManager.Instance.GetDefinePackageName(mappingTableDef);
Debug.LogWarning($"来自{packName}定义的TileMappingTableDef键值{(k1, k2, k3, k4)}存在重复索引,将忽略重复项");
continue;
}
var tile = LoadTile(sprite);
tileToTileBaseMapping[(k1, k2, k3, k4)] = tile;
tileBaseMapping[val] = tile;
}
}
}
public void Reload()
{
tileToTileBaseMapping.Clear();
Init();
}
public TileBase LoadTile(Sprite sprite)
{
var newTile = ScriptableObject.CreateInstance<Tile>();
newTile.sprite = sprite;
newTile.color = Color.white;
newTile.colliderType = Tile.ColliderType.Sprite;
return newTile;
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
namespace Map
{
public class MapGenerator:MonoBehaviour
{
public DoubleMap baseLevel;
public Tilemap buildLevel;
public Tilemap plantLevel;
public void Start()
{
var perline= Utils.PerlinNoise.Instance;
int size = 100;
for (int i = -size; i <= size; i++)
{
for (int j = -size; j <= size; j++)
{
var val = perline.Noise(i, j);
if (val < 0)
{
}
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 81339b242c794b8d9d28d7111a46bfbf
timeCreated: 1754370253

View File

@ -83,7 +83,24 @@ namespace Prefab
// 外部控制方法
public void SetPaused(bool paused) => _isPaused = paused;
public void SetSprites(Sprite[] newSprites) => _sprites = newSprites;
public void SetSprites(Sprite[] newSprites)
{
_sprites = newSprites;
// 如果有新的精灵数组,则立即显示第一帧
if (_sprites != null && _sprites.Length > 0)
{
_currentFrameIndex = 0; // 重置当前帧索引为第一帧
_renderer.sprite = _sprites[_currentFrameIndex]; // 立即显示第一帧
}
else
{
_renderer.sprite = null; // 如果没有精灵,则清空渲染器
}
// 重置帧计时器,以确保从头开始播放
_frameTimer = 0f;
}
public void SetFPS(float newFPS) => _fps = Mathf.Max(0.1f, newFPS);
public void SetStaticSprite(Sprite sprite) => _staticSprite = sprite;
}

View File

@ -2,14 +2,19 @@ using System;
namespace Utils
{
public class PerlinNoise
public class PerlinNoise : Utils.Singleton<PerlinNoise>
{
private readonly int[] _p; // 混淆表
private int[] _p; // 混淆表
private const int DefaultSeed = 0; // 默认种子
// 构造函数:初始化混淆表
public PerlinNoise(int seed)
public PerlinNoise()
{
Initialize(DefaultSeed);
}
// 初始化混淆表
private void Initialize(int seed)
{
// 初始化为0-255的随机排列
_p = new int[512]; // 混淆表加倍以方便使用
var permutation = new int[256];
var random = new Random(seed);
@ -34,67 +39,67 @@ namespace Utils
}
}
// 重新指定种子
public void Reinitialize(int seed)
{
Initialize(seed);
}
// 平滑函数 (6t^5 - 15t^4 + 10t^3)
private double Fade(double t)
private static double Fade(double t)
{
return t * t * t * (t * (t * 6 - 15) + 10);
}
// 线性插值
private double Lerp(double t, double a, double b)
private static double Lerp(double t, double a, double b)
{
return a + t * (b - a);
}
// 计算梯度向量和距离向量的点积
private double Grad(int hash, double x, double y, double z)
private static double Grad(int hash, double x, double y, double z)
{
// 根据hash值确定使用哪个梯度向量
// 12个梯度向量由以下组合构成(+/-1, +/-1, 0), (+/-1, 0, +/-1), (0, +/-1, +/-1)
switch (hash & 0xF) // 取hash值的最后4位
return (hash & 0xF) switch // hash值的最后4位
{
case 0x0: return x + y;
case 0x1: return -x + y;
case 0x2: return x - y;
case 0x3: return -x - y;
case 0x4: return x + z;
case 0x5: return -x + z;
case 0x6: return x - z;
case 0x7: return -x - z;
case 0x8: return y + z;
case 0x9: return -y + z;
case 0xA: return y - z;
case 0xB: return -y - z;
case 0xC: return y + x; // 这四个是重复的但Ken Perlin的原始实现中包含它们。
case 0xD: return -y + x; // 它们对噪声质量影响不大,但保持了表格的一致性。
case 0xE: return y - x;
case 0xF: return -y - x;
default: return 0; // 不应该发生
}
0x0 => x + y,
0x1 => -x + y,
0x2 => x - y,
0x3 => -x - y,
0x4 => x + z,
0x5 => -x + z,
0x6 => x - z,
0x7 => -x - z,
0x8 => y + z,
0x9 => -y + z,
0xA => y - z,
0xB => -y - z,
0xC => y + x,
0xD => -y + x,
0xE => y - x,
0xF => -y - x,
_ => 0
};
}
/// <summary>
/// 为给定的(x, y, z)坐标生成3D Perlin噪声。
/// 输出值通常在-1到1之间。
/// </summary>
public double Noise(double x, double y, double z)
public double Noise(double x, double y=0, double z = 0)
{
// 找到包含该点的单位立方体
var X = (int)Math.Floor(x) & 255;
var Y = (int)Math.Floor(y) & 255;
var Z = (int)Math.Floor(z) & 255;
// 找到该点在立方体内的相对x, y, z坐标
x -= Math.Floor(x);
y -= Math.Floor(y);
z -= Math.Floor(z);
// 计算x, y, z的平滑曲线
var u = Fade(x);
var v = Fade(y);
var w = Fade(z);
// 对立方体的8个角进行哈希计算
var A = _p[X] + Y;
var AA = _p[A] + Z;
var AB = _p[A + 1] + Z;
@ -102,7 +107,6 @@ namespace Utils
var BA = _p[B] + Z;
var BB = _p[B + 1] + Z;
// 获取所有8个角的哈希值
var H000 = _p[AA];
var H100 = _p[BA];
var H010 = _p[AB];
@ -112,19 +116,14 @@ namespace Utils
var H011 = _p[AB + 1];
var H111 = _p[BB + 1];
// 计算所有8个角的点积并插值
double x0, x1, y0, y1;
x0 = Lerp(u, Grad(H000, x, y, z), // (0,0,0)
Grad(H100, x - 1, y, z)); // (1,0,0)
x1 = Lerp(u, Grad(H010, x, y - 1, z), // (0,1,0)
Grad(H110, x - 1, y - 1, z)); // (1,1,0)
x0 = Lerp(u, Grad(H000, x, y, z), Grad(H100, x - 1, y, z));
x1 = Lerp(u, Grad(H010, x, y - 1, z), Grad(H110, x - 1, y - 1, z));
y0 = Lerp(v, x0, x1);
x0 = Lerp(u, Grad(H001, x, y, z - 1), // (0,0,1)
Grad(H101, x - 1, y, z - 1)); // (1,0,1)
x1 = Lerp(u, Grad(H011, x, y - 1, z - 1), // (0,1,1)
Grad(H111, x - 1, y - 1, z - 1)); // (1,1,1)
x0 = Lerp(u, Grad(H001, x, y, z - 1), Grad(H101, x - 1, y, z - 1));
x1 = Lerp(u, Grad(H011, x, y - 1, z - 1), Grad(H111, x - 1, y - 1, z - 1));
y1 = Lerp(v, x0, x1);
return Lerp(w, y0, y1);

File diff suppressed because one or more lines are too long

View File

@ -1,22 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Define>
<AttributesDef>
<defName>TestCharacter</defName>
<health>100</health>
<moveSpeed>2</moveSpeed>
</AttributesDef>
<CharacterDef>
<defName>testPawn</defName>
<label>测试小人</label>
<description>用于测试功能的角色</description>
<attributes>TestCharacter</attributes>
<attributes>
<health>100</health>
<moveSpeed>2</moveSpeed>
</attributes>
<affiliation>player</affiliation>
<drawingOrder>
<texturePath>Resources\Character\Test</texturePath>
<drawingOrder_down>
<node name="Body"/>
<node name="Body" type="Animation" FPS="0.5"/>
</drawingOrder_down>
</drawingOrder>
<behaviorTree>
<Node className="RandomWander"/>
</behaviorTree>
</CharacterDef>
<CharacterDef>
<defName>HighHP</defName>
<label>耐肘王</label>
<description>超高的血条,有了耐肘王,一个人就有一百个人的力量了!</description>
<attributes>
<health>10000</health>
<moveSpeed>2</moveSpeed>
</attributes>
<affiliation>player</affiliation>
<drawingOrder>
<texturePath>Resources\Character\Test</texturePath>
<drawingOrder_down>
<node name="Body"/>
</drawingOrder_down>
</drawingOrder>
<behaviorTree>
@ -24,4 +40,45 @@
</behaviorTree>
</CharacterDef>
<CharacterDef>
<defName>HighSpeed</defName>
<label>跑得快</label>
<description>超高速度,只要跑的够快,摄像机也追不上</description>
<attributes>
<health>100</health>
<moveSpeed>20</moveSpeed>
</attributes>
<affiliation>player</affiliation>
<drawingOrder>
<texturePath>Resources\Character\HighSpeed</texturePath>
<pixelsPerUnit>100</pixelsPerUnit>
<drawingOrder_down>
<node name="Body"/>
</drawingOrder_down>
</drawingOrder>
<behaviorTree>
<Node className="Idel"/>
</behaviorTree>
</CharacterDef>
<CharacterDef>
<defName>powerMan</defName>
<label>超人</label>
<description>跑到又快又难肘</description>
<attributes>
<health>10000</health>
<moveSpeed>20</moveSpeed>
</attributes>
<affiliation>player</affiliation>
<drawingOrder>
<texturePath>Resources\Character\Test</texturePath>
<drawingOrder_down>
<node name="Body" />
</drawingOrder_down>
</drawingOrder>
<behaviorTree>
<Node className="Idel"/>
</behaviorTree>
</CharacterDef>
</Define>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB