增加功能

This commit is contained in:
2024-10-16 16:43:53 +08:00
parent 897058435c
commit 4920837ed7
10 changed files with 800 additions and 128 deletions

View File

@@ -12,10 +12,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c6fbd4d875fc9c244aa5a60af9e992ab, type: 3}
m_Name: enemyFsm_a
m_EditorClassIdentifier:
viewPosition: {x: 139, y: 309, z: 0}
viewPosition: {x: 181, y: 320, z: 0}
viewScale: {x: 0.7561437, y: 0.7561437, z: 1}
Layers:
- Active
Layers: []
originGUID:
states:
- rect:

View File

@@ -0,0 +1,275 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6fbd4d875fc9c244aa5a60af9e992ab, type: 3}
m_Name: enemyFsm_b
m_EditorClassIdentifier:
viewPosition: {x: 232, y: 290, z: 0}
viewScale: {x: 0.65751624, y: 0.65751624, z: 1}
Layers:
- Active
originGUID:
states:
- rect:
serializedVersion: 2
x: -60
y: -20
width: 200
height: 40
defaultState: 0
name: Any State
StateScripts: []
parents: []
isSubStateMachine: 0
isBuildInState: 1
buildInStateName: Any State
- rect:
serializedVersion: 2
x: -60
y: 380
width: 200
height: 40
defaultState: 0
name: Entry
StateScripts: []
parents: []
isSubStateMachine: 0
isBuildInState: 1
buildInStateName: Entry
- rect:
serializedVersion: 2
x: 240
y: 200
width: 200
height: 40
defaultState: 1
name: sleep
StateScripts: []
parents: []
isSubStateMachine: 0
isBuildInState: 0
buildInStateName:
- rect:
serializedVersion: 2
x: 580
y: -20
width: 200
height: 40
defaultState: 0
name: Active
StateScripts: []
parents: []
isSubStateMachine: 1
isBuildInState: 0
buildInStateName:
- rect:
serializedVersion: 2
x: -140
y: 380
width: 200
height: 40
defaultState: 0
name: Active/Entry
StateScripts: []
parents:
- Active
isSubStateMachine: 0
isBuildInState: 1
buildInStateName: Entry
- rect:
serializedVersion: 2
x: -120
y: -180
width: 200
height: 40
defaultState: 0
name: Active/Any State
StateScripts: []
parents:
- Active
isSubStateMachine: 0
isBuildInState: 1
buildInStateName: Any State
- rect:
serializedVersion: 2
x: 820
y: -140
width: 200
height: 40
defaultState: 0
name: Active/up
StateScripts: []
parents:
- Active
isSubStateMachine: 0
isBuildInState: 1
buildInStateName: up
- rect:
serializedVersion: 2
x: 160
y: 160
width: 200
height: 40
defaultState: 1
name: Idea
StateScripts:
- className: Game.Component.EnemyFSM_AI.Idea
guid: 3e32e90cfcf94a799c192bd48694869c
parents:
- Active
isSubStateMachine: 0
isBuildInState: 0
buildInStateName:
- rect:
serializedVersion: 2
x: 580
y: 420
width: 200
height: 40
defaultState: 0
name: Runawary
StateScripts: []
parents: []
isSubStateMachine: 0
isBuildInState: 0
buildInStateName:
- rect:
serializedVersion: 2
x: 560
y: -40
width: 200
height: 40
defaultState: 0
name: Follow
StateScripts:
- className: Game.Component.EnemyFSM_AI.FollowFore
guid: 91b9bec6145b4ffabdc28f44f3b3c053
parents:
- Active
isSubStateMachine: 0
isBuildInState: 0
buildInStateName:
- rect:
serializedVersion: 2
x: 560
y: 360
width: 200
height: 40
defaultState: 0
name: Walk
StateScripts:
- className: Game.Component.EnemyFSM_AI.RandomWalk
guid: f30cf9a1f060477888024e0f40a3bc3e
parents:
- Active
isSubStateMachine: 0
isBuildInState: 0
buildInStateName:
parameters:
- name: hasAttack
value: 0
parameterType: 2
- name: hasSafeArea
value: 0
parameterType: 2
- name: hasRunaway
value: 0
parameterType: 2
- name: hasActive
value: 1
parameterType: 2
transitions:
- fromStateName: sleep
toStateName: Active
conditions:
- targetValue: 1
parameterName: hasActive
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Active
toStateName: Runawary
conditions:
- targetValue: 1
parameterName: hasRunaway
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Runawary
toStateName: sleep
conditions:
- targetValue: 0
parameterName: hasActive
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Idea
toStateName: Follow
conditions:
- targetValue: 1
parameterName: hasAttack
compareType: 2
- targetValue: 1
parameterName: hasSafeArea
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Active
toStateName: sleep
conditions:
- targetValue: 0
parameterName: hasActive
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Follow
toStateName: Walk
conditions:
- targetValue: 0
parameterName: hasAttack
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Walk
toStateName: Follow
conditions:
- targetValue: 1
parameterName: hasAttack
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Active/Any State
toStateName: Idea
conditions:
- targetValue: 0
parameterName: hasSafeArea
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Runawary
toStateName: Active
conditions:
- targetValue: 0
parameterName: hasRunaway
compareType: 2
group_conditions: []
AutoSwtich: 0
- fromStateName: Idea
toStateName: Walk
conditions:
- targetValue: 1
parameterName: hasSafeArea
compareType: 2
- targetValue: 0
parameterName: hasAttack
compareType: 2
group_conditions: []
AutoSwtich: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 179868f5e4037ea4f98cfb3f6643ec5e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -159,7 +159,7 @@ MonoBehaviour:
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 55
m_Bits: 183
--- !u!114 &22314479
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -194,16 +194,16 @@ Canvas:
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 1575124296}
m_PlaneDistance: 10
m_PlaneDistance: 5
m_PixelPerfect: 1
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_VertexColorAlwaysGammaSpace: 1
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingLayerID: 591389233
m_SortingOrder: 50
m_TargetDisplay: 0
--- !u!224 &22314481
@@ -217,8 +217,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1410837320}
m_Children: []
m_Father: {fileID: 2011646794}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -257,7 +256,7 @@ GameObject:
- component: {fileID: 26908124}
- component: {fileID: 26908130}
m_Layer: 0
m_Name: enemy
m_Name: enemy_A
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -483,7 +482,7 @@ GameObject:
- component: {fileID: 44395144}
- component: {fileID: 44395143}
- component: {fileID: 44395142}
m_Layer: 0
m_Layer: 5
m_Name: Joystick
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -497,13 +496,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 44395140}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalRotation: {x: 0.00000001560446, 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: 505887313}
m_Father: {fileID: 1410837320}
m_Father: {fileID: 1805612736}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -517,7 +516,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 44395140}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
@@ -575,7 +574,7 @@ MonoBehaviour:
isUnregisterAtDisable: 0
_anchor: 0
_anchorOffet: {x: 0, y: 0}
_visible: 1
_visible: 0
_activated: 1
enableCamera: 0
cameraMode: 0
@@ -604,8 +603,8 @@ MonoBehaviour:
isSwipeIn: 0
isSwipeOut: 0
showPSInspector: 1
showSpriteInspector: 1
showEventInspector: 1
showSpriteInspector: 0
showEventInspector: 0
showBehaviourInspector: 0
showAxesInspector: 1
showTouchEventInspector: 0
@@ -635,7 +634,19 @@ MonoBehaviour:
m_Calls: []
onMoveEnd:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1748722036}
m_TargetAssemblyTypeName: Game.Component.PlayerEntity, Assembly-CSharp
m_MethodName: OnMoveEnd
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
onTouchStart:
m_PersistentCalls:
m_Calls: []
@@ -802,7 +813,7 @@ MonoBehaviour:
showSimulatinInspector: 0
thumb: {fileID: 505887313}
joystickArea: 0
userArea: {fileID: 1410837320}
userArea: {fileID: 1595935474}
isTurnAndMove: 0
tmSpeed: 10
tmAdditionnalRotation: 0
@@ -1437,7 +1448,7 @@ GameObject:
- component: {fileID: 505887313}
- component: {fileID: 505887315}
- component: {fileID: 505887314}
m_Layer: 0
m_Layer: 5
m_Name: Thumb
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -1470,7 +1481,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 505887312}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
@@ -1663,6 +1674,90 @@ Transform:
- {fileID: 396268252}
m_Father: {fileID: 1344272198}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &573115298
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 573115299}
- component: {fileID: 573115300}
m_Layer: 0
m_Name: Square
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &573115299
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 573115298}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0.38268343, w: 0.92387956}
m_LocalPosition: {x: 0, y: 0.39, z: 0}
m_LocalScale: {x: 0.4258, y: 0.4258, z: 0.4258}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1748722035}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 45}
--- !u!212 &573115300
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 573115298}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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!1 &590632618
GameObject:
m_ObjectHideFlags: 0
@@ -1690,7 +1785,7 @@ Transform:
m_GameObject: {fileID: 590632618}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: -3.16, y: 1.29, z: 0}
m_LocalPosition: {x: -3.35, y: 2.2, z: 0}
m_LocalScale: {x: 2.436049, y: 0.4254539, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -1980,7 +2075,7 @@ Transform:
m_GameObject: {fileID: 902809060}
serializedVersion: 2
m_LocalRotation: {x: 0.00000001560446, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.77139246, y: -3.1216316, z: 0.12002945}
m_LocalPosition: {x: -0.36860752, y: -3.6916318, z: 0.12002945}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -2345,7 +2440,7 @@ GameObject:
- component: {fileID: 1208061465}
- component: {fileID: 1208061464}
m_Layer: 0
m_Name: enemy (1)
m_Name: enemy_B
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2402,7 +2497,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_runtimeFSMController:
- {fileID: 11400000, guid: 27079b6a45c147e4eb3ea78d2c71e9e1, type: 2}
- {fileID: 11400000, guid: 179868f5e4037ea4f98cfb3f6643ec5e, type: 2}
resetOnDisable: 1
--- !u!61 &1208061466
BoxCollider2D:
@@ -2548,7 +2643,7 @@ SpriteRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: -2413806693520163455, guid: a86470a33a6bf42c4b3595704624658b, type: 3}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_Color: {r: 1, g: 0.64582133, b: 0, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
@@ -2609,7 +2704,7 @@ MonoBehaviour:
file_cachedStartup: {fileID: 4900000, guid: eb538f7c02817f2448aca956bb0c6050, type: 3}
data_cachedStartup:
cacheStartup: 0
showNavGraphs: 0
showNavGraphs: 1
showUnwalkableNodes: 1
debugMode: 0
debugFloor: 0
@@ -2844,12 +2939,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1238765762}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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_LocalScale: {x: 26.6043, y: 26.6043, z: 26.6043}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_Father: {fileID: 1812232173}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1251683917
GameObject:
@@ -3265,93 +3360,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
PlayerEntity: {fileID: 1748722036}
--- !u!1 &1410837319
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1410837320}
- component: {fileID: 1410837323}
- component: {fileID: 1410837322}
- component: {fileID: 1410837321}
m_Layer: 0
m_Name: touchScreen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1410837320
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410837319}
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: 44395141}
m_Father: {fileID: 22314481}
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: -540}
m_SizeDelta: {x: 0, y: -1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1410837321
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410837319}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 191
--- !u!223 &1410837322
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410837319}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 0
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!222 &1410837323
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1410837319}
m_CullTransparentMesh: 1
--- !u!1 &1465892739
GameObject:
m_ObjectHideFlags: 0
@@ -3641,7 +3649,7 @@ Transform:
m_GameObject: {fileID: 1575124293}
serializedVersion: 2
m_LocalRotation: {x: 0.00000001560446, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.0000006129256, z: -12}
m_LocalPosition: {x: -1.14, y: -0.5699994, z: -12}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -3916,6 +3924,271 @@ MonoBehaviour:
m_DissipationDistance: 500
m_PropagationSpeed: 343
m_DefaultVelocity: {x: -1, y: 0, z: 0}
--- !u!1 &1595935473
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1595935474}
- component: {fileID: 1595935477}
- component: {fileID: 1595935476}
- component: {fileID: 1595935475}
m_Layer: 0
m_Name: TouchPad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1595935474
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1595935473}
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: 1805612736}
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: -540}
m_SizeDelta: {x: 0, y: -1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1595935475
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1595935473}
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}
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: 21300004, guid: becfdeef1534456438d787466a94d207, type: 3}
m_Type: 0
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!222 &1595935476
CanvasRenderer:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1595935473}
m_CullTransparentMesh: 1
--- !u!114 &1595935477
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1595935473}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 32a30ee4cdcaaca44a064b72231de6ed, type: 3}
m_Name:
m_EditorClassIdentifier:
isUnregisterAtDisable: 0
_anchor: 0
_anchorOffet: {x: 0, y: 0}
_visible: 1
_activated: 1
enableCamera: 0
cameraMode: 0
camTargetTag: Player
autoLinkTagCam: 1
autoCamTag: MainCamera
cameraTransform: {fileID: 0}
cameraTargetMode: 0
enableWallDetection: 0
wallLayer:
serializedVersion: 2
m_Bits: 0
cameraLookAt: {fileID: 0}
followOffset: {x: 0, y: 6, z: -6}
followDistance: 10
followHeight: 5
followRotationDamping: 5
followHeightDamping: 5
pointId: -1
enableKeySimulation: 1
allowSimulationStandalone: 0
visibleOnStandalone: 1
dPadAxisCount: 0
useFixedUpdate: 0
isOnDrag: 0
isSwipeIn: 0
isSwipeOut: 0
showPSInspector: 1
showSpriteInspector: 0
showEventInspector: 0
showBehaviourInspector: 0
showAxesInspector: 0
showTouchEventInspector: 0
showDownEventInspector: 0
showPressEventInspector: 0
showCameraInspector: 0
onMoveStart:
m_PersistentCalls:
m_Calls: []
onMove:
m_PersistentCalls:
m_Calls: []
onMoveSpeed:
m_PersistentCalls:
m_Calls: []
onMoveEnd:
m_PersistentCalls:
m_Calls: []
onTouchStart:
m_PersistentCalls:
m_Calls: []
onTouchUp:
m_PersistentCalls:
m_Calls: []
OnDownUp:
m_PersistentCalls:
m_Calls: []
OnDownDown:
m_PersistentCalls:
m_Calls: []
OnDownLeft:
m_PersistentCalls:
m_Calls: []
OnDownRight:
m_PersistentCalls:
m_Calls: []
OnPressUp:
m_PersistentCalls:
m_Calls: []
OnPressDown:
m_PersistentCalls:
m_Calls: []
OnPressLeft:
m_PersistentCalls:
m_Calls: []
OnPressRight:
m_PersistentCalls:
m_Calls: []
axisX:
name: Horizontal
autoLinkTagPlayer: 0
autoTag: Player
player: {fileID: 0}
enable: 1
invertedAxis: 0
speed: 1
deadValue: 0.1
valueMethod: 0
curveValue:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
isEnertia: 0
inertia: 0
inertiaThreshold: 0.08
isAutoStab: 0
autoStabThreshold: 0.01
autoStabSpeed: 10
isClampRotation: 0
maxAngle: 90
minAngle: 90
isValueOverTime: 0
overTimeStep: 1
maxOverTimeValue: 1
axisValue: 0
axisSpeedValue: 0
axisThreshold: 0.5
isLockinJump: 0
axisState: 0
_directTransform: {fileID: 0}
directAction: 0
axisInfluenced: 0
actionOn: 1
directCharacterController: {fileID: 0}
directRigidBody: {fileID: 0}
gravity: 0
currentGravity: 0
isJump: 0
unityAxis: Horizontal
showGeneralInspector: 0
showDirectInspector: 0
showInertiaInspector: 0
showSimulatinInspector: 0
axisY:
name: Vertical
autoLinkTagPlayer: 0
autoTag: Player
player: {fileID: 0}
enable: 1
invertedAxis: 0
speed: 1
deadValue: 0.1
valueMethod: 0
curveValue:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
isEnertia: 0
inertia: 0
inertiaThreshold: 0.08
isAutoStab: 0
autoStabThreshold: 0.01
autoStabSpeed: 10
isClampRotation: 0
maxAngle: 90
minAngle: 90
isValueOverTime: 0
overTimeStep: 1
maxOverTimeValue: 1
axisValue: 0
axisSpeedValue: 0
axisThreshold: 0.5
isLockinJump: 0
axisState: 0
_directTransform: {fileID: 0}
directAction: 0
axisInfluenced: 0
actionOn: 1
directCharacterController: {fileID: 0}
directRigidBody: {fileID: 0}
gravity: 0
currentGravity: 0
isJump: 0
unityAxis: Vertical
showGeneralInspector: 0
showDirectInspector: 0
showInertiaInspector: 0
showSimulatinInspector: 0
isDPI: 0
--- !u!1 &1661546404
GameObject:
m_ObjectHideFlags: 0
@@ -4187,6 +4460,8 @@ GameObject:
- component: {fileID: 1748722035}
- component: {fileID: 1748722037}
- component: {fileID: 1748722036}
- component: {fileID: 1748722039}
- component: {fileID: 1748722038}
m_Layer: 0
m_Name: player
m_TagString: Untagged
@@ -4203,10 +4478,11 @@ Transform:
m_GameObject: {fileID: 1748722034}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: -1.14, y: -0.57, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 573115299}
m_Father: {fileID: 1344272198}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1748722036
@@ -4222,6 +4498,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
speed: 4
rigidbody2D: {fileID: 1748722038}
--- !u!212 &1748722037
SpriteRenderer:
m_ObjectHideFlags: 0
@@ -4274,6 +4551,68 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!50 &1748722038
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1748722034}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 1
m_Mass: 0.19634955
m_LinearDrag: 0
m_AngularDrag: 0
m_GravityScale: 0
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 4
--- !u!58 &1748722039
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1748722034}
m_Enabled: 1
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_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
--- !u!1 &1805612735
GameObject:
m_ObjectHideFlags: 0
@@ -4305,7 +4644,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 1595935474}
- {fileID: 44395141}
m_Father: {fileID: 2011646794}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -4329,7 +4670,7 @@ MonoBehaviour:
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 32
m_Bits: 160
--- !u!114 &1805612738
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -4370,7 +4711,7 @@ Canvas:
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_VertexColorAlwaysGammaSpace: 1
m_AdditionalShaderChannelsFlag: 31
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
@@ -4456,7 +4797,8 @@ Transform:
m_LocalPosition: {x: -83.20528, y: -46.119316, z: 45.114952}
m_LocalScale: {x: 0.037587907, y: 0.037587907, z: 0.037587907}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 1238765764}
m_Father: {fileID: 2011646794}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1914211174
@@ -4712,6 +5054,5 @@ SceneRoots:
- {fileID: 1153590225}
- {fileID: 107637204}
- {fileID: 2011646794}
- {fileID: 1238765764}
- {fileID: 1344272198}
- {fileID: 1944799158}

View File

@@ -0,0 +1,26 @@
using UnityEngine;
namespace Game.Component.EnemyFSM_AI
{
public class FollowFore : EnemyFSMState
{
public override void OnEnter ()
{
}
public override void OnUpdate ()
{
var playerEntityTransform = MapContent.Instance.PlayerEntity.transform;
// if (Vector2.Distance (playerEntityTransform.position , this.Entity.transform.position) <= this.Entity.TriggerDistance)
// {
// this.SetAiTarget (playerEntityTransform.position);
// }
// else
{
var forward = playerEntityTransform.up;
this.SetAiTarget (playerEntityTransform.position + forward * this.Entity.TriggerDistance);
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 91b9bec6145b4ffabdc28f44f3b3c053
timeCreated: 1729046548

View File

@@ -1,14 +1,34 @@
using UnityEngine;
using Framework.Utils.Extend;
using UnityEngine;
namespace Game.Component
{
public class PlayerEntity : MonoBehaviour
{
public float speed = 10;
public Rigidbody2D rigidbody2D;
public void OnMove (Vector2 vector)
{
this.transform.Translate (vector * speed * Time.deltaTime);
var t = this.transform;
// 获取前方方向的世界坐标
Vector3 forward = (Vector3)vector;
//根据遥感向量获取一个01的移动速度系数
float speedOffset = forward.magnitude;
Quaternion targetRotation = Quaternion.FromToRotation (Vector3.up , forward.normalized);
transform.rotation = Quaternion.Lerp (transform.rotation , targetRotation , 0.25f);
// Debug.DrawLine (transform.position , transform.position + forward , Color.magenta);
// this.transform.Translate ( Vector3.up * speedOffset * speed * Time.deltaTime);
this.rigidbody2D.MovePosition (t.position + ((Vector3)vector * speed * Time.deltaTime));
// Vector3 v = target.position - transform.position;
// v.z = 0; // 确保向量在2D平面上
// float angle = Vector3.SignedAngle(Vector3.up, v, Vector3.forward);
// Quaternion rotation = Quaternion.Euler(0, 0, angle);
t.position = t.position.SetZ (0);
}
public void OnMoveEnd ()
{
this.transform.rotation = Quaternion.Euler (0 , 0 , this.transform.rotation.eulerAngles.z);
}
}
}