任务:搭建基本的系统

1.搭建地藏测试场景
(1.放置单向平台
(2.限制摄像机范围
(3.设置相机跟踪
(4.放置图片素材

2.编写地藏boss逻辑
(1.继承自Enemy(内含基本的变量和事件)
(2.当玩家进入戒备范围,startContinue攻击功能

3.创建塞钱箱脚本,目前为空,仅调试用

4.编写召唤攻击逻辑
(1.编写工具类,投掷点,记录投掷力度、方向。
(2.在地藏中保存两套投掷点
(3.攻击时判定玩家位置,进而决定要使用哪一套投掷点
(4.从投掷点获取信息,然后初始化生成的爱欲品
(5.等待召唤攻击的后摇时间,然后发信号表示攻击结束,进入下一个循环

至此,佛教Boss的召唤攻击方式基本开发完毕
This commit is contained in:
Roman 2021-12-08 23:52:17 +08:00
parent 5c0502497d
commit b1063a379f
12 changed files with 729 additions and 340 deletions

View File

@ -0,0 +1,311 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7746389308535175434
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7746389308535175438}
- component: {fileID: 7746389308535175433}
- component: {fileID: 7746389308535175432}
- component: {fileID: 7746389308535175435}
- component: {fileID: 7746389308535175439}
- component: {fileID: 7746389308535175436}
- component: {fileID: 7746389308535175437}
m_Layer: 0
m_Name: "\u7231\u6B32\u54C1"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7746389308535175438
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 11.457179, y: 0.283, z: 0}
m_LocalScale: {x: -1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7746389308535175433
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 4b64b4c73bfa00a4a9552c672359f9fc, 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!61 &7746389308535175432
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.768, y: 0.74}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.768, y: 0.74}
m_EdgeRadius: 0
--- !u!61 &7746389308535175435
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -1.52, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.768, y: 0.74}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 2.27, y: 0.74}
m_EdgeRadius: 0
--- !u!50 &7746389308535175439
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!114 &7746389308535175436
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -333801856, guid: aa0b1eebb5db27a419fa4564bbe5c9c5, type: 3}
m_Name:
m_EditorClassIdentifier:
updateType: 0
isSpeedBased: 0
hasOnStart: 0
hasOnPlay: 0
hasOnUpdate: 0
hasOnStepComplete: 0
hasOnComplete: 0
hasOnTweenCreated: 0
hasOnRewind: 0
onStart:
m_PersistentCalls:
m_Calls: []
onPlay:
m_PersistentCalls:
m_Calls: []
onUpdate:
m_PersistentCalls:
m_Calls: []
onStepComplete:
m_PersistentCalls:
m_Calls: []
onComplete:
m_PersistentCalls:
m_Calls: []
onTweenCreated:
m_PersistentCalls:
m_Calls: []
onRewind:
m_PersistentCalls:
m_Calls: []
delay: 0
duration: 5
easeType: 1
easeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
loops: -1
id:
loopType: 0
orientType: 1
lookAtTransform: {fileID: 0}
lookAtPosition: {x: 0, y: 0, z: 0}
lookAhead: 0
autoPlay: 1
autoKill: 1
relative: 0
isLocal: 0
isClosedPath: 1
pathResolution: 10
pathMode: 3
lockRotation: 0
assignForwardAndUp: 0
forwardDirection: {x: 0, y: 0, z: 1}
upDirection: {x: 0, y: 1, z: 0}
tweenRigidbody: 0
wps: []
fullWps: []
path:
wpLengths:
- 0
- 3.7057567
- 3.7057567
wps:
- {x: 11.457179, y: 0.283, z: 0}
- {x: 15.16288, y: 0.30334127, z: 0}
- {x: 11.457179, y: 0.283, z: 0}
type: 0
subdivisionsXSegment: 10
subdivisions: 30
controlPoints: []
length: 7.4115133
isFinalized: 1
timesTable:
- 0
- 0.5
- 1
lengthsTable: []
inspectorMode: 0
pathType: 0
handlesType: 0
livePreview: 1
handlesDrawMode: 0
perspectiveHandleSize: 0.5
showIndexes: 1
showWpLength: 0
pathColor: {r: 1, g: 1, b: 1, a: 0.5}
lastSrcPosition: {x: 11.457179, y: 0.283, z: 0}
lastSrcRotation: {x: 0, y: 0, z: 0, w: 1}
wpsDropdown: 1
dropToFloorOffset: 0
--- !u!114 &7746389308535175437
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7746389308535175434}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f210b45e49a9b004da5dff2a3e6278d8, type: 3}
m_Name:
m_EditorClassIdentifier:
HP: 3
ATK: 1
speed: 1
coin: 0
canBeHit: 1
state: 0
HPLeft: 0
hitToflyParameter: {x: 3, y: 3}
deadRotationRangeMax: 500
deadRotationRangeMin: 500
inPath: 1
catchOffset: {x: 0, y: 0, z: 0}
breakFreeCount: 5
breakFreeCountLeft: 0

View File

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

View File

@ -123,6 +123,51 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &28312533
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 28312534}
- component: {fileID: 28312535}
m_Layer: 0
m_Name: "\u6295\u63B7\u70B9\u5DE6\u4E0B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &28312534
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 28312533}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.99, y: -1.78, z: -2.003905}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &28312535
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 28312533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8456de2497479ed4e906a55c714f88c5, type: 3}
m_Name:
m_EditorClassIdentifier:
strength: 3
dir: {x: 1, y: 1}
--- !u!1 &295389546
GameObject:
m_ObjectHideFlags: 0
@ -204,7 +249,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &295389549
MonoBehaviour:
@ -218,7 +263,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b74c9082c8d1a6044b40dfae78d89cab, type: 3}
m_Name:
m_EditorClassIdentifier:
hasMoney: 1
hasMoney: 0
--- !u!1 &525554315
GameObject:
m_ObjectHideFlags: 0
@ -274,7 +319,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &552131607
GameObject:
@ -359,7 +404,7 @@ Transform:
m_Children:
- {fileID: 1871661725}
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &552131610
MonoBehaviour:
@ -378,9 +423,18 @@ MonoBehaviour:
speed: 0
coin: 10
canBeHit: 1
HPLeft: 0
state: 0
HPLeft: 0
timeBetweenAttacks: 1
aiYuPinBuildLimit: 0
aiYuPin: {fileID: 7746389308535175434, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
throwingPointGroupUp:
- {fileID: 1656118181}
- {fileID: 561802406}
throwingPointGroupDown:
- {fileID: 28312535}
- {fileID: 2059592404}
CallAiYuPinEndTime: 0
--- !u!61 &552131611
BoxCollider2D:
m_ObjectHideFlags: 0
@ -407,6 +461,51 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 4.8, y: 7.904}
m_EdgeRadius: 0
--- !u!1 &561802405
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 561802407}
- component: {fileID: 561802406}
m_Layer: 0
m_Name: "\u6295\u63B7\u70B9\u53F3\u4E0A"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &561802406
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 561802405}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8456de2497479ed4e906a55c714f88c5, type: 3}
m_Name:
m_EditorClassIdentifier:
strength: 3
dir: {x: -1, y: 1}
--- !u!4 &561802407
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 561802405}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5.01, y: 0.95, z: -2.003905}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &609324641
GameObject:
m_ObjectHideFlags: 0
@ -1026,7 +1125,7 @@ Transform:
m_LocalScale: {x: 3.6625, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!251 &1025813219
PlatformEffector2D:
@ -1155,7 +1254,7 @@ Transform:
m_LocalScale: {x: 3.6625, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1052484726
BoxCollider2D:
@ -1284,7 +1383,7 @@ Transform:
m_LocalScale: {x: 3.6625, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1170153513
BoxCollider2D:
@ -1410,7 +1509,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1226109627}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.037861586, y: -1.6225336, z: -10}
m_LocalPosition: {x: 0.037863016, y: -1.6225317, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@ -1564,7 +1663,7 @@ Transform:
m_LocalScale: {x: 3.6625, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1297453558
BoxCollider2D:
@ -2021,6 +2120,51 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1656118180
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1656118182}
- component: {fileID: 1656118181}
m_Layer: 0
m_Name: "\u6295\u63B7\u70B9\u5DE6\u4E0A"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1656118181
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656118180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8456de2497479ed4e906a55c714f88c5, type: 3}
m_Name:
m_EditorClassIdentifier:
strength: 3
dir: {x: 1, y: 1}
--- !u!4 &1656118182
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656118180}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -5.02, y: 1.06, z: -2.003905}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1678223708
GameObject:
m_ObjectHideFlags: 0
@ -2076,7 +2220,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1760119522
GameObject:
@ -2282,6 +2426,7 @@ GameObject:
m_Component:
- component: {fileID: 1871661725}
- component: {fileID: 1871661726}
- component: {fileID: 1871661727}
m_Layer: 0
m_Name: "\u949F"
m_TagString: Untagged
@ -2354,6 +2499,18 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &1871661727
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1871661724}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eb1ead91b6d7c9949b86dadd3704ba8d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1954591986
GameObject:
m_ObjectHideFlags: 0
@ -2480,7 +2637,7 @@ BoxCollider2D:
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: -5.55}
m_Offset: {x: 0.10174298, y: -5.55}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
@ -2491,7 +2648,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 9.952, y: 3.54}
m_Size: {x: 13.152288, y: 3.54}
m_EdgeRadius: 0
--- !u!1 &2021758230
GameObject:
@ -2575,7 +2732,7 @@ Transform:
m_LocalScale: {x: 3.6625, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &2021758233
BoxCollider2D:
@ -2622,6 +2779,51 @@ PlatformEffector2D:
m_UseSideFriction: 0
m_UseSideBounce: 0
m_SideArc: 1
--- !u!1 &2059592403
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2059592405}
- component: {fileID: 2059592404}
m_Layer: 0
m_Name: "\u6295\u63B7\u70B9\u53F3\u4E0B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2059592404
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2059592403}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8456de2497479ed4e906a55c714f88c5, type: 3}
m_Name:
m_EditorClassIdentifier:
strength: 3
dir: {x: -1, y: 1}
--- !u!4 &2059592405
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2059592403}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5, y: -1.81, z: -2.003905}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2132302661
GameObject:
m_ObjectHideFlags: 0
@ -2680,5 +2882,5 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -958,8 +958,8 @@ MonoBehaviour:
speed: 3
coin: 5
canBeHit: 1
HPLeft: 0
state: 0
HPLeft: 0
deadRotationRangeMax: 500
deadRotationRangeMin: 500
boomTime: 0
@ -1102,316 +1102,6 @@ Rigidbody2D:
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!1 &659041640
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 659041644}
- component: {fileID: 659041643}
- component: {fileID: 659041642}
- component: {fileID: 659041641}
- component: {fileID: 659041645}
- component: {fileID: 659041646}
- component: {fileID: 659041647}
m_Layer: 0
m_Name: "\u7231\u6B32\u54C1"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!61 &659041641
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -1.52, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.768, y: 0.74}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 2.27, y: 0.74}
m_EdgeRadius: 0
--- !u!61 &659041642
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.768, y: 0.74}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.768, y: 0.74}
m_EdgeRadius: 0
--- !u!212 &659041643
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 4b64b4c73bfa00a4a9552c672359f9fc, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &659041644
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 11.457179, y: 0.283, z: 0}
m_LocalScale: {x: -1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &659041645
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!114 &659041646
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -333801856, guid: aa0b1eebb5db27a419fa4564bbe5c9c5, type: 3}
m_Name:
m_EditorClassIdentifier:
updateType: 0
isSpeedBased: 0
hasOnStart: 0
hasOnPlay: 0
hasOnUpdate: 0
hasOnStepComplete: 0
hasOnComplete: 0
hasOnTweenCreated: 0
hasOnRewind: 0
onStart:
m_PersistentCalls:
m_Calls: []
onPlay:
m_PersistentCalls:
m_Calls: []
onUpdate:
m_PersistentCalls:
m_Calls: []
onStepComplete:
m_PersistentCalls:
m_Calls: []
onComplete:
m_PersistentCalls:
m_Calls: []
onTweenCreated:
m_PersistentCalls:
m_Calls: []
onRewind:
m_PersistentCalls:
m_Calls: []
delay: 0
duration: 5
easeType: 1
easeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
loops: -1
id:
loopType: 0
orientType: 1
lookAtTransform: {fileID: 0}
lookAtPosition: {x: 0, y: 0, z: 0}
lookAhead: 0
autoPlay: 1
autoKill: 1
relative: 0
isLocal: 0
isClosedPath: 1
pathResolution: 10
pathMode: 3
lockRotation: 0
assignForwardAndUp: 0
forwardDirection: {x: 0, y: 0, z: 1}
upDirection: {x: 0, y: 1, z: 0}
tweenRigidbody: 0
wps:
- {x: 15.16288, y: 0.30334127, z: 0}
fullWps: []
path:
wpLengths:
- 0
- 3.7057567
- 3.7057567
wps:
- {x: 11.457179, y: 0.283, z: 0}
- {x: 15.16288, y: 0.30334127, z: 0}
- {x: 11.457179, y: 0.283, z: 0}
type: 0
subdivisionsXSegment: 10
subdivisions: 30
controlPoints: []
length: 7.4115133
isFinalized: 1
timesTable:
- 0
- 0.5
- 1
lengthsTable: []
inspectorMode: 0
pathType: 0
handlesType: 0
livePreview: 1
handlesDrawMode: 0
perspectiveHandleSize: 0.5
showIndexes: 1
showWpLength: 0
pathColor: {r: 1, g: 1, b: 1, a: 0.5}
lastSrcPosition: {x: 11.457179, y: 0.283, z: 0}
lastSrcRotation: {x: 0, y: 0, z: 0, w: 1}
wpsDropdown: 0
dropToFloorOffset: 0
--- !u!114 &659041647
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659041640}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f210b45e49a9b004da5dff2a3e6278d8, type: 3}
m_Name:
m_EditorClassIdentifier:
HP: 3
ATK: 1
speed: 1
coin: 0
canBeHit: 1
HPLeft: 0
state: 0
hitToflyParameter: {x: 3, y: 3}
deadRotationRangeMax: 500
deadRotationRangeMin: 500
inPath: 1
catchOffset: {x: 0, y: 0, z: 0}
breakFreeCount: 5
breakFreeCountLeft: 0
--- !u!1 &839378814
GameObject:
m_ObjectHideFlags: 0
@ -1598,8 +1288,8 @@ MonoBehaviour:
speed: 1
coin: 0
canBeHit: 1
HPLeft: 0
state: 0
HPLeft: 0
hitToflyParameter: {x: 3, y: 3}
deadRotationRangeMax: 500
deadRotationRangeMin: 500
@ -2355,8 +2045,8 @@ MonoBehaviour:
speed: 1
coin: 0
canBeHit: 1
HPLeft: 0
state: 0
HPLeft: 0
hitToflyParameter: {x: 3, y: 3}
deadRotationRangeMax: 500
deadRotationRangeMin: 500
@ -2780,3 +2470,60 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e8542bc5f7711d44d8c471ae7ca4eb87, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7746389308018742370
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7746389308535175434, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_Name
value: "\u7231\u6B32\u54C1"
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalPosition.x
value: 11.457179
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalPosition.y
value: 0.283
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7746389308535175438, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6d2fc6e5da22cf748b7c6730494b0460, type: 3}

View File

@ -147,7 +147,7 @@ public class AiYuPin : NormalEnemy
}
//原先会触发自动返回记录起点,但是不能,所以重写空的重新着地事件
protected override void OnRetouchedTheGround(){ canBeHit = true; }
public override void OnRetouchedTheGround(){ canBeHit = true; }
/// <summary>
/// 完全挣脱的时候触发

16
Assets/Scripts/Bell.cs Normal file
View File

@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
/// <summary>
/// 撞钟类,控制地藏头上的钟
/// </summary>
public class Bell : MonoBehaviour
{
void Start(){
Tweener tweener = transform.DOShakePosition(5f,0.3f,1,150,false,false);
tweener.SetLoops(-1);
tweener.SetEase(Ease.InQuad);
}
}

View File

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

View File

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
@ -27,12 +27,36 @@ public class DiZang : Enemy
private delegate IEnumerator Action();
private enum PlayerState{,};
private MyPlayer player;
/// <summary>
/// 到底在上面还是下面生成爱欲品的玩家位置Y轴的界限
/// </summary>
[Header("到底在上面还是下面生成爱欲品的玩家位置Y轴的界限")]
public float aiYuPinBuildLimit;
/// <summary>
/// 爱欲品小怪的预制体,召唤功能会用到
/// </summary>
[Header("爱欲品怪物预制体")][FoldoutGroup("地藏")]
public GameObject aiYuPin;
/// <summary>
/// 场景上方的落怪点,用来召唤爱欲品
/// </summary>
[Header("场景上方的落怪点组")][ListDrawerSettings][FoldoutGroup("地藏")]
public List<ThrowingPoint> throwingPointGroupUp;
/// <summary>
/// 场景下方的落怪点,用来召唤爱欲品
/// </summary>
[Header("场景下方的落怪点组")][ListDrawerSettings][FoldoutGroup("地藏")]
public List<ThrowingPoint> throwingPointGroupDown;
/// <summary>
/// 本次使用的落怪点位置组
/// </summary>
private List<ThrowingPoint> throwingPointGroupUse;
/// <summary>
/// 使用召唤爱欲品后有多少时间的后摇
/// </summary>
public float CallAiYuPinEndTime;
private delegate void NullAction();
private void Init(){
moneyBox = FindObjectOfType<MoneyBox>();
@ -59,7 +83,7 @@ public class DiZang : Enemy
else{
//否则,随机执行召唤或者敲钟
Action action =
((Random.Range(-1f,1f) > 0) ? (Action)RingTheBell : (Action)CallAiYuPin);
((Random.Range(-1f,0f) > 0) ? (Action)RingTheBell : (Action)CallAiYuPin);
StartCoroutine(action());
}
}
@ -72,6 +96,43 @@ public class DiZang : Enemy
//确定玩家在上半边还是下半边
PlayerState playerState =
((player.transform.position.y > aiYuPinBuildLimit) ? PlayerState.: PlayerState.);
//根据玩家位置状态确定所用落怪位置组
throwingPointGroupUse =
((playerState == PlayerState.) ?
throwingPointGroupUp : throwingPointGroupDown);
//创建一个储存生成的爱欲品的列表用于使他们在一段时间后开始Seek
List<AiYuPin> aiYuPins = new List<AiYuPin>();
//遍历位置组
foreach(ThrowingPoint t in throwingPointGroupUse){
//生成一个爱欲品
AiYuPin temp =Instantiate(
aiYuPin,
t.transform.position,//在位置组中元素的位置
Quaternion.identity
).GetComponent<AiYuPin>();
//初始化爱欲品
//该状态为wander使其先保持不动
temp.state = State.wander;
//修改爱欲品面部朝向
if(t.dir.x == -1) temp.transform.rotation = Quaternion.Euler(
temp.transform.rotation.x,
-180f,
temp.transform.localScale.z
);
//根据投掷点内信息给予爱欲品投掷速度
temp.GetComponent<Rigidbody2D>().velocity = t.dir * t.strength;
//把这个爱欲品加入列表
aiYuPins.Add(temp);
}
//一段时间后使他们开始Seek
yield return new WaitForSeconds(0.8f);
foreach(AiYuPin a in aiYuPins){
a.state = State.seek;
}
//等待攻击后摇结束
yield return new WaitForSeconds(CallAiYuPinEndTime);
//发送信号,本次攻击宣告结束
ATKEnd();
}
@ -90,4 +151,6 @@ public class DiZang : Enemy
yield return new WaitForEndOfFrame();
Debug.Log("地藏正在拿钱");
}
private void ATKEnd(){StartCoroutine(ATK());}
}

View File

@ -38,7 +38,6 @@ public class Enemy : MonoBehaviour
/// </summary>
[FoldoutGroup("属性")][Header("掉落金币数")]
public int coin;
/// <summary>
/// 怪物拥有的几种状态
/// </summary>
@ -48,6 +47,11 @@ public class Enemy : MonoBehaviour
/// </summary>
[FoldoutGroup("状态")][Header("当前是否能被攻击")][ReadOnly]
public bool canBeHit = true;
/// <summary>
/// 当前状态
/// </summary>
[EnumPaging][SerializeField][ReadOnly][Header("当前状态")][FoldoutGroup("状态")]
public State state;
// _____ _ _
// | __ \ (_) | |
@ -62,11 +66,6 @@ public class Enemy : MonoBehaviour
[ReadOnly][SerializeField][ProgressBar(0,10,0.15f,0.47f,0.74f)][FoldoutGroup("状态")]
protected float HPLeft;
/// <summary>
/// 当前状态
/// </summary>
[EnumPaging][SerializeField][ReadOnly][Header("当前状态")][FoldoutGroup("状态")]
protected State state;
// ______ _
// | ____| | |
@ -99,7 +98,7 @@ public class Enemy : MonoBehaviour
/// <summary>
/// 当怪物着地的时候触发一次
/// </summary>
protected virtual void OnRetouchedTheGround(){}
public virtual void OnRetouchedTheGround(){}
// _ _ _
// | \ | | | |

View File

@ -119,7 +119,7 @@ public class NormalEnemy : Enemy
canBeHit = false;
}
protected override void OnRetouchedTheGround(){
public override void OnRetouchedTheGround(){
if(!inPath){//如果此时怪物没在巡逻且着地了,说明时被击飞然后着地了
//新建一个动画,让怪物回到初始记录位置
Tween tween = transform.DOMove(sourcePosition,

View File

@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
/// <summary>
/// 投掷点类,用来记录一些信息,供地藏使用召唤攻击的时候用
/// </summary>
public class ThrowingPoint : MonoBehaviour
{
/// <summary>
/// 投掷力度
/// </summary>
[Header("投掷力度")]
public float strength;
/// <summary>
/// 投掷方向
/// </summary>
[Header("投掷方向")]
public Vector2 dir;
}

View File

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