Remove collision between player and enemies
Add knockback to enemies
This commit is contained in:
parent
6c74f32fc5
commit
774688d692
@ -48,7 +48,7 @@ CapsuleCollider2D:
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Bits: 512
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
@ -182,8 +182,8 @@ Transform:
|
||||
m_GameObject: {fileID: 5621972084801698921}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.1984, z: 0}
|
||||
m_LocalScale: {x: 0.62654996, y: 0.55155003, z: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.114, z: 0}
|
||||
m_LocalScale: {x: 3, y: 3, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 243343966221896818}
|
||||
@ -232,8 +232,8 @@ SpriteRenderer:
|
||||
m_SortingLayerID: 651355007
|
||||
m_SortingLayer: 4
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -9095717837082945937, guid: 207ee8102dd4143d288186ef0be518ee, type: 3}
|
||||
m_Color: {r: 1, g: 0.084905505, b: 0.084905505, a: 1}
|
||||
m_Sprite: {fileID: 21300000, guid: 748ae8b33df036b46a86e0387f1602cf, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
@ -296,7 +296,7 @@ CapsuleCollider2D:
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Bits: 512
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
@ -339,7 +339,7 @@ Rigidbody2D:
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 8
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 1
|
||||
|
||||
@ -9,7 +9,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1897313902523258814}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Visuals
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -46,7 +46,7 @@ GameObject:
|
||||
- component: {fileID: 1787569555844345674}
|
||||
- component: {fileID: 3647552498760287226}
|
||||
- component: {fileID: 7014899162285736705}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Character
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -91,7 +91,7 @@ SpriteRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 2100000, guid: 475fbc277d3530045b66013cd2dc50b2, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
@ -112,12 +112,12 @@ SpriteRenderer:
|
||||
m_SortingLayerID: 651355007
|
||||
m_SortingLayer: 4
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 1468673379, guid: cca4ee180637d1442bc16ac530501cee, type: 3}
|
||||
m_Sprite: {fileID: 9128384846270689552, guid: 6068df6a0f8c12a4496df681a7b310c6, 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: 2}
|
||||
m_Size: {x: 0.96, y: 0.8}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
@ -133,7 +133,7 @@ Animator:
|
||||
m_GameObject: {fileID: 3555620562472737319}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 9100000, guid: 47d96364271d1944c8b2c9ed00c09341, type: 2}
|
||||
m_Controller: {fileID: 9100000, guid: ba58731883bc8cb40be2ed19cc4be25a, type: 2}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
@ -154,7 +154,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3783325528514321640}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Attacks
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -192,7 +192,7 @@ GameObject:
|
||||
- component: {fileID: 7139240040885940656}
|
||||
- component: {fileID: 8783676367030864381}
|
||||
- component: {fileID: 1825172400684165510}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: MeleeAttacks
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -379,7 +379,7 @@ CapsuleCollider2D:
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
@ -394,7 +394,7 @@ Rigidbody2D:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5233403024226430001}
|
||||
m_BodyType: 2
|
||||
m_BodyType: 1
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
@ -405,10 +405,10 @@ Rigidbody2D:
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 128
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
@ -423,7 +423,8 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 7702329272476180476}
|
||||
- component: {fileID: 746752959509100355}
|
||||
m_Layer: 0
|
||||
- component: {fileID: 6597882534697498354}
|
||||
m_Layer: 9
|
||||
m_Name: Trail
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@ -439,8 +440,8 @@ Transform:
|
||||
m_GameObject: {fileID: 6399305692263416751}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.56999993, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_LocalPosition: {x: 0.028, y: -1.064, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.5, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1897313902523258814}
|
||||
@ -561,6 +562,61 @@ TrailRenderer:
|
||||
m_Autodestruct: 0
|
||||
m_Emitting: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
--- !u!212 &6597882534697498354
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6399305692263416751}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 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: 651355007
|
||||
m_SortingLayer: 4
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -2413806693520163455, guid: ebe73ca9363db456bacf42c025bb4847, type: 3}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.83137256}
|
||||
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 &9074809610135348735
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -572,13 +628,13 @@ GameObject:
|
||||
- component: {fileID: 9053513097682960937}
|
||||
- component: {fileID: 2353993781959106024}
|
||||
- component: {fileID: 3461693610759608285}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Aura
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &9053513097682960937
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -588,7 +644,7 @@ Transform:
|
||||
m_GameObject: {fileID: 9074809610135348735}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: -0.195, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@ -5405,13 +5461,13 @@ GameObject:
|
||||
- component: {fileID: 4613858514893913661}
|
||||
- component: {fileID: 1597424103648595187}
|
||||
- component: {fileID: 4673608109423225760}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Structural
|
||||
m_TagString: Structural
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &4613858514893913661
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -5421,7 +5477,7 @@ Transform:
|
||||
m_GameObject: {fileID: 9098681062314285509}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: -0.434, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@ -5526,7 +5582,7 @@ BoxCollider2D:
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 0.5041871, y: 0.25876725}
|
||||
m_Size: {x: 0.8092319, y: 0.33894694}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &9147163641451663911
|
||||
GameObject:
|
||||
@ -5541,7 +5597,7 @@ GameObject:
|
||||
- component: {fileID: 1680573792925415762}
|
||||
- component: {fileID: 1203434784585445923}
|
||||
- component: {fileID: 9117212351613092415}
|
||||
m_Layer: 0
|
||||
m_Layer: 9
|
||||
m_Name: Player
|
||||
m_TagString: Player
|
||||
m_Icon: {fileID: 0}
|
||||
@ -5591,7 +5647,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Builder: {fileID: 7211159566486303287}
|
||||
RigidBody: {fileID: 1203434784585445923}
|
||||
Rigidbody: {fileID: 1203434784585445923}
|
||||
Animator: {fileID: 7014899162285736705}
|
||||
Renderer: {fileID: 3647552498760287226}
|
||||
Aura: {fileID: 2353993781959106024}
|
||||
@ -5600,12 +5656,44 @@ MonoBehaviour:
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
FighterClass:
|
||||
TimeElapsed: 0
|
||||
MaxHealth: 0
|
||||
MaxMana: 0
|
||||
AttackPower: 0
|
||||
MagicPower: 0
|
||||
AnimationToPlay:
|
||||
AvailableSkills: []
|
||||
ComboResetTime: 0
|
||||
LastComboTime: 0
|
||||
ChargingAnAttack: 0
|
||||
ChargeValue: 0
|
||||
AllowBladeVortex: 0
|
||||
ChargeTick: 0
|
||||
ComboTimeElapsed: 0
|
||||
Cooldown: 0
|
||||
TimesUp: 0
|
||||
CurrentState: 0
|
||||
AttackAnimator: {fileID: 3038315303589083823}
|
||||
StaminaMax: 100
|
||||
Stamina: 0
|
||||
StaminaRegenPerSecond: 20
|
||||
StaminaSliderHud: {fileID: 0}
|
||||
MoveSpeed: 16
|
||||
DashMultiplier: 80
|
||||
DriftSpeed: 80
|
||||
DriftFactorial: 0.85
|
||||
MoveSpeedDampener: 1
|
||||
DashSpeedInitial: 200
|
||||
DashSpeed: 0
|
||||
DashDecayRate: 30
|
||||
DashDelay1: 0.05
|
||||
DashDelay2: 0.05
|
||||
DashCooldown: 0.1
|
||||
JumpDelay: 0.3
|
||||
VfxDash: {fileID: 4566952472781634859, guid: daf6ae43ee06c424ba624a471e90b72c, type: 3}
|
||||
VfxKineticSurge: {fileID: 4566952472781634859, guid: 0d7c4835b1f550241bb630daef9e33e8, type: 3}
|
||||
VfxShockwave: {fileID: 8992219285309707884, guid: 1f334a9f024858d44b8a3ff8bd31dc97, type: 3}
|
||||
PrevDirection: {x: 0, y: 0}
|
||||
SkillInUse: 0
|
||||
LastDirection: 1
|
||||
--- !u!50 &1203434784585445923
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
@ -5628,7 +5716,7 @@ Rigidbody2D:
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Bits: 136
|
||||
m_Interpolate: 1
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 1
|
||||
@ -5667,7 +5755,7 @@ BoxCollider2D:
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: -0.00097227097, y: -0.59421855}
|
||||
m_Offset: {x: -0.00097227097, y: -1.0443913}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0, y: 0}
|
||||
@ -5677,5 +5765,5 @@ BoxCollider2D:
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 0.5041871, y: 0.25876725}
|
||||
m_Size: {x: 0.84173715, y: 0.26204228}
|
||||
m_EdgeRadius: 0
|
||||
|
||||
@ -233,13 +233,13 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 64029825}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 16.61, y: -15.86, z: 0}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 23.01954, y: -11.82811, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1252500659}
|
||||
m_Father: {fileID: 0}
|
||||
m_Father: {fileID: 267352325}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &64029827
|
||||
MonoBehaviour:
|
||||
@ -253,7 +253,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 297bf7fd6271a174194f3ff9950eb487, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
GoblerPreFab: {fileID: 6411951171763069002, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
EnemyPrefabKey: 00000000
|
||||
EnemyPrefab:
|
||||
- {fileID: 6411951171763069002, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
EnemySpawnCountForTesting: 05000000
|
||||
CanStartSpawning: 1
|
||||
--- !u!1 &92430589 stripped
|
||||
GameObject:
|
||||
@ -340,11 +343,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 142887252}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!50 &164601440 stripped
|
||||
Rigidbody2D:
|
||||
m_CorrespondingSourceObject: {fileID: 1203434784585445923, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
m_PrefabInstance: {fileID: 2316236105731553357}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &176512938
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -454,6 +452,7 @@ Transform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 64029826}
|
||||
- {fileID: 2076322256}
|
||||
- {fileID: 1302188856}
|
||||
- {fileID: 176512939}
|
||||
@ -872,66 +871,63 @@ MonoBehaviour:
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
CustomBlends: {fileID: 0}
|
||||
--- !u!1 &607039651 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 6399305692263416751, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
m_PrefabInstance: {fileID: 2316236105731553357}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!212 &607039654
|
||||
SpriteRenderer:
|
||||
--- !u!1001 &584901200
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 607039651}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 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: 651355007
|
||||
m_SortingLayer: 4
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -2413806693520163455, guid: ebe73ca9363db456bacf42c025bb4847, type: 3}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.83137256}
|
||||
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
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -0.6309252
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.25825265
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 243343966221896818, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6411951171763069002, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Gobler
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6447e7f877b893f46bc4efe1ebc9fe9e, type: 3}
|
||||
--- !u!1 &646453418
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -86326,50 +86322,10 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: Stamina
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: JumpDelay
|
||||
value: 0.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: Rigidbody
|
||||
value:
|
||||
objectReference: {fileID: 164601440}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: VfxShockwave
|
||||
value:
|
||||
objectReference: {fileID: 8992219285309707884, guid: 1f334a9f024858d44b8a3ff8bd31dc97, type: 3}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: DashDecayRate
|
||||
value: 30
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: DashMultiplier
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: VfxKineticSurge
|
||||
value:
|
||||
objectReference: {fileID: 4566952472781634859, guid: 0d7c4835b1f550241bb630daef9e33e8, type: 3}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: DashSpeedInitial
|
||||
value: 200
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: StaminaSliderHud
|
||||
value:
|
||||
objectReference: {fileID: 1940124276}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: StaminaRegenPerSecond
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: FighterClass.VfxKineticSurge
|
||||
value:
|
||||
objectReference: {fileID: 4566952472781634859, guid: 0d7c4835b1f550241bb630daef9e33e8, type: 3}
|
||||
- target: {fileID: 1680573792925415762, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: 'ClassIndicators.Array.data[0]'
|
||||
value:
|
||||
@ -86386,42 +86342,6 @@ PrefabInstance:
|
||||
propertyPath: 'ClassIndicators.Array.data[3]'
|
||||
value:
|
||||
objectReference: {fileID: 1731397399}
|
||||
- target: {fileID: 1787569555844345674, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1825172400684165510, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_BodyType
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1825172400684165510, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_ExcludeLayers.m_Bits
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1825172400684165510, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IncludeLayers.m_Bits
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3647552498760287226, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 0.96
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3647552498760287226, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 0.8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3647552498760287226, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: 9128384846270689552, guid: 6068df6a0f8c12a4496df681a7b310c6, type: 3}
|
||||
- target: {fileID: 3647552498760287226, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3647552498760287226, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 475fbc277d3530045b66013cd2dc50b2, type: 2}
|
||||
- target: {fileID: 4060073025839678449, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -3.64
|
||||
@ -86462,109 +86382,20 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4613858514893913661, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.434
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4673608109423225760, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 0.8092319
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4673608109423225760, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 0.33894694
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4673608109423225760, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Offset.x
|
||||
value: -0.00097227097
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5203709406065552287, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 0.64
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5203709406065552287, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 0.32
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7014899162285736705, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Controller
|
||||
value:
|
||||
objectReference: {fileID: 9100000, guid: ba58731883bc8cb40be2ed19cc4be25a, type: 2}
|
||||
- target: {fileID: 7139240040885940656, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_EdgeRadius
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7139240040885940656, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IncludeLayers.m_Bits
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7702329272476180476, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7702329272476180476, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7702329272476180476, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.028
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7702329272476180476, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -1.064
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8783676367030864381, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8783676367030864381, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
- target: {fileID: 9117212351613092415, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_ExcludeLayers.m_Bits
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8783676367030864381, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IncludeLayers.m_Bits
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9053513097682960937, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.195
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9074809610135348735, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9098681062314285509, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9117212351613092415, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 0.84173715
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9117212351613092415, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 0.26204228
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9117212351613092415, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Offset.x
|
||||
value: -0.00097227097
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9117212351613092415, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Offset.y
|
||||
value: -1.0443913
|
||||
value: 136
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9147163641451663911, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Player
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_RemovedGameObjects:
|
||||
- {fileID: 4553260134269457595, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
- {fileID: 9098681062314285509, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 6399305692263416751, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 607039654}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: d00d92ab204198c489965b31a298b234, type: 3}
|
||||
--- !u!1001 &3495966144891276242
|
||||
PrefabInstance:
|
||||
@ -86946,4 +86777,4 @@ SceneRoots:
|
||||
- {fileID: 2316236105731553357}
|
||||
- {fileID: 1341160148}
|
||||
- {fileID: 268356502}
|
||||
- {fileID: 64029826}
|
||||
- {fileID: 584901200}
|
||||
|
||||
@ -7,6 +7,6 @@ using static UnityEditor.PlayerSettings;
|
||||
namespace AI.Base {
|
||||
public class EnemyStateManager : MonoBehaviour {
|
||||
public static EnemyStateManager Instance;
|
||||
public static List<GoblerStateManager> Goblers = new List<GoblerStateManager>();
|
||||
public static List<Gobler> Goblers = new List<Gobler>();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,11 +2,14 @@
|
||||
using NUnit.Framework.Internal.Execution;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using static EnemySpawnerData;
|
||||
|
||||
public class GoblerStateManager : Alive {
|
||||
|
||||
public class Gobler : Alive {
|
||||
[Header("Mechanics Attributes")]
|
||||
[SerializeField] public float ChaseDistance = 10f;
|
||||
[SerializeField] public float ChaseDistanceBuffer = 1f;
|
||||
@ -28,13 +31,16 @@ public class GoblerStateManager : Alive {
|
||||
private Vector2 CrystalPos { get { return GameManager.Crystal.transform.position; } }
|
||||
|
||||
private GameObject Owner;
|
||||
private Rigidbody2D Rigidbody;
|
||||
private Transform MyTransform { get { return Owner.transform; } }
|
||||
private Vector2 MyPos { get { return MyTransform.position; } set { MyTransform.position = value; } }
|
||||
|
||||
private NavMeshAgent PathAgent;
|
||||
|
||||
private List<Material> Materials;
|
||||
|
||||
public GoblerStateManager(GameObject owner) {
|
||||
|
||||
public Gobler(GameObject owner) {
|
||||
Owner = owner;
|
||||
PathAgent = Owner.GetComponent<NavMeshAgent>();
|
||||
PathAgent.updateRotation = false;
|
||||
@ -44,11 +50,15 @@ public class GoblerStateManager : Alive {
|
||||
|
||||
MaxHealth = 100;
|
||||
CurrentHealth = MaxHealth;
|
||||
OnTakeDamage += (damage, direction) => SetState(State.TakeDamage);
|
||||
OnDeath += () => SetState(State.Die);
|
||||
|
||||
Rigidbody = Owner.GetComponent<Rigidbody2D>();
|
||||
Materials = Owner.GetComponentsInChildren<SpriteRenderer>().Select(x => x.material).ToList();
|
||||
|
||||
SetState(State.GoToCrystal);
|
||||
EnemySpawnerManager.UpdateTick += Update;
|
||||
EnemySpawnerManager.GizmoTick += OnDrawGizmos;
|
||||
EnemyManagers[Enemies.Gobler].UpdateTick += Update;
|
||||
EnemyManagers[Enemies.Gobler].GizmoTick += OnDrawGizmos;
|
||||
}
|
||||
|
||||
public float DistFromPlayer { get; private set; }
|
||||
@ -62,14 +72,15 @@ public class GoblerStateManager : Alive {
|
||||
AttackCrystal,
|
||||
ChasePlayer,
|
||||
AttackPlayer,
|
||||
Damaged,
|
||||
TakeDamage,
|
||||
Die
|
||||
}
|
||||
|
||||
|
||||
protected void SetPriorityState() {
|
||||
if (CurrentState == State.AttackPlayer) return;
|
||||
if (CurrentState == State.ChasePlayer) return;
|
||||
if (CurrentState == State.Damaged) return;
|
||||
if (CurrentState == State.TakeDamage) return;
|
||||
if (CurrentState == State.Die) return;
|
||||
if (DistFromPlayer > ChaseDistance) return;
|
||||
SetState(State.ChasePlayer);
|
||||
@ -88,14 +99,13 @@ public class GoblerStateManager : Alive {
|
||||
|
||||
switch (CurrentState) {
|
||||
case State.None:
|
||||
SetState(State.GoToCrystal);
|
||||
break;
|
||||
|
||||
|
||||
case State.GoToCrystal:
|
||||
PathAgent.SetDestination(CrystalPos);
|
||||
|
||||
//if (DistFromCrystal < 1)
|
||||
// SetState(State.Die);
|
||||
break;
|
||||
|
||||
|
||||
@ -104,25 +114,28 @@ public class GoblerStateManager : Alive {
|
||||
|
||||
|
||||
case State.ChasePlayer:
|
||||
//MyPos += (PlayerPos - MyPos).normalized * Speed * Time.deltaTime;
|
||||
PathAgent.SetDestination(PlayerPos);
|
||||
|
||||
if (DistFromPlayer > ChaseDistance + ChaseDistanceBuffer)
|
||||
SetState(State.GoToCrystal);
|
||||
//else if (DistFromPlayer < 1)
|
||||
// SetState(State.Die);
|
||||
if (DistFromPlayer > ChaseDistance + ChaseDistanceBuffer)
|
||||
SetState(State.GoToCrystal);
|
||||
else
|
||||
PathAgent.SetDestination(PlayerPos);
|
||||
break;
|
||||
|
||||
|
||||
case State.AttackPlayer:
|
||||
break;
|
||||
|
||||
case State.Damaged:
|
||||
|
||||
case State.TakeDamage:
|
||||
Rigidbody.linearVelocity = DirectionOfDamage * 100 * InvincibilityLeft;
|
||||
Materials.ForEach(x => x.SetFloat("_FlashAmount", InvincibilityLeft));
|
||||
if (!IsInvincible) SetState(State.None);
|
||||
break;
|
||||
|
||||
|
||||
case State.Die:
|
||||
EnemySpawnerManager.RemoveGobler(Owner);
|
||||
EnemySpawnerManager.DestroyEnemy(Owner, Enemies.Gobler);
|
||||
SetState(State.None);
|
||||
break;
|
||||
|
||||
@ -133,10 +146,12 @@ public class GoblerStateManager : Alive {
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void SetState(State newState) {
|
||||
CurrentState = newState;
|
||||
switch (CurrentState) {
|
||||
case State.None:
|
||||
PathAgent.isStopped = false;
|
||||
break;
|
||||
|
||||
|
||||
@ -156,7 +171,9 @@ public class GoblerStateManager : Alive {
|
||||
break;
|
||||
|
||||
|
||||
case State.Damaged:
|
||||
case State.TakeDamage:
|
||||
PathAgent.isStopped = true;
|
||||
Materials.ForEach(x => x.SetColor("_FlashColor", Color.white));
|
||||
break;
|
||||
|
||||
|
||||
@ -169,7 +186,6 @@ public class GoblerStateManager : Alive {
|
||||
|
||||
|
||||
|
||||
|
||||
protected void OnDrawGizmos() {
|
||||
if (Owner == null) return;
|
||||
|
||||
@ -178,8 +194,11 @@ public class GoblerStateManager : Alive {
|
||||
DrawAttackReach();
|
||||
}
|
||||
|
||||
private void DrawWireSphere(Color color, Vector2 center, float radius) => EnemyManagers[Enemies.Gobler].DrawWireSphere(color, center, radius);
|
||||
|
||||
|
||||
private void DrawChaseDistance() {
|
||||
EnemySpawnerManager.DrawWireSphere(Color.green, MyPos, ChaseDistance);
|
||||
DrawWireSphere(Color.green, MyPos, ChaseDistance);
|
||||
}
|
||||
|
||||
private void DrawAttackDistance() {
|
||||
@ -190,39 +209,44 @@ public class GoblerStateManager : Alive {
|
||||
|
||||
private void DrawAttackReach() {
|
||||
//if (CurrentState != (IState)AttackState) return;
|
||||
Gizmos.color = Color.red;
|
||||
//Gizmos.color = Color.red;
|
||||
|
||||
Vector2 direction2D = (PlayerPos - MyPos).normalized;
|
||||
Vector2 point2D = MyPos + direction2D * AttackDistance;
|
||||
//Gizmos.DrawWireSphere(point2D, AttackMaskDiameter);
|
||||
EnemySpawnerManager.DrawWireSphere(Color.red, point2D, AttackMaskDiameter);
|
||||
DrawWireSphere(Color.red, point2D, AttackMaskDiameter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Alive {
|
||||
public int MaxHealth { get; protected set; }
|
||||
public int CurrentHealth { get; protected set; }
|
||||
public bool IsDead => CurrentHealth <= 0;
|
||||
|
||||
public bool IsInvincible => Time.time < invincibleUntil;
|
||||
protected float invincibleUntil = 0f;
|
||||
|
||||
protected float invincibilityDuration = 1f;
|
||||
public bool IsInvincible => Time.time < InvincibleUntil;
|
||||
protected float InvincibleUntil = 0f;
|
||||
protected float InvincibilityLeft => Math.Max(0, InvincibleUntil - Time.time);
|
||||
protected float InvincibilityDuration = 0.2f;
|
||||
|
||||
public event Action<int, Vector2> OnTakeDamage;
|
||||
public event Action OnDeath;
|
||||
public event Action<int> OnHeal;
|
||||
|
||||
protected int DamageTaken;
|
||||
protected Vector2 DirectionOfDamage;
|
||||
|
||||
public void TakeDamage(int amount, Vector2 hitDirection) {
|
||||
if (IsDead || IsInvincible) return;
|
||||
|
||||
CurrentHealth -= amount;
|
||||
CurrentHealth = Mathf.Max(CurrentHealth, 0);
|
||||
invincibleUntil = Time.time + invincibilityDuration;
|
||||
InvincibleUntil = Time.time + InvincibilityDuration;
|
||||
DamageTaken = amount;
|
||||
|
||||
hitDirection = hitDirection.normalized;
|
||||
if (hitDirection == Vector2.zero) hitDirection = Vector2.up;
|
||||
DirectionOfDamage = hitDirection;
|
||||
OnTakeDamage?.Invoke(amount, hitDirection);
|
||||
|
||||
if (CurrentHealth == 0) OnDeath?.Invoke();
|
||||
@ -238,6 +262,6 @@ public class Alive {
|
||||
|
||||
public void Reset() {
|
||||
CurrentHealth = MaxHealth;
|
||||
invincibleUntil = 0f;
|
||||
InvincibleUntil = 0f;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Runtime/AI/EnemyManager/Gobler.cs.meta
Normal file
2
Assets/Scripts/Runtime/AI/EnemyManager/Gobler.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25cbd57f9b1673e41934e4fe6d8c6067
|
||||
@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5c89455bac58d943a2e1e110d37a24d
|
||||
@ -102,6 +102,7 @@ public class ClassBase {
|
||||
if (AttackCoroutine != null)
|
||||
Player.Instance.StopCoroutine(AttackCoroutine);
|
||||
var center = PlayerPos + Player.PrevDirection * centerOffset;
|
||||
hitDelay = 0;
|
||||
AttackCoroutine = Player.Instance.StartCoroutine(CreateHitBoxHelper(center, radius, hitDelay, hitDuration));
|
||||
}
|
||||
|
||||
|
||||
@ -71,8 +71,8 @@ public class MeleeFighterClass : ClassBase {
|
||||
case AttackState.BasicAttack3:
|
||||
if (ComboTimeElapsed <= 0.1) break;
|
||||
ChangeState(AttackState.KineticSurgeRelease);
|
||||
AttackAnimator.MeleeResetKineticCharge();
|
||||
AttackAnimator.MeleeKineticSurge();
|
||||
AttackAnimator?.MeleeResetKineticCharge();
|
||||
AttackAnimator?.MeleeKineticSurge();
|
||||
AnimationToPlay = "Attack1";
|
||||
TextPopUp.SpawnFloatingText("KineticSurge", Color.red, 3);
|
||||
AllowBladeVortex = ComboTimeElapsed <= 0.1f;
|
||||
@ -97,7 +97,7 @@ public class MeleeFighterClass : ClassBase {
|
||||
if (!ChargingAnAttack && TimesUp || Player.IsJumping) {
|
||||
Player.MoveSpeedDampener = 1;
|
||||
ChangeState(AttackState.None);
|
||||
AttackAnimator.MeleeResetKineticCharge();
|
||||
AttackAnimator?.MeleeResetKineticCharge();
|
||||
Player.SkillInUse = false;
|
||||
}
|
||||
}
|
||||
@ -231,19 +231,19 @@ public class MeleeFighterClass : ClassBase {
|
||||
|
||||
case AttackState.BasicAttack1:
|
||||
AnimationToPlay = "Attack1";
|
||||
AttackAnimator.MeleeBasic(1);
|
||||
AttackAnimator?.MeleeBasic(1);
|
||||
CreateHitBoxOffset(2, 3, 0.1f, 0.1f);
|
||||
break;
|
||||
|
||||
case AttackState.BasicAttack2:
|
||||
AnimationToPlay = "Attack2";
|
||||
AttackAnimator.MeleeBasic(2);
|
||||
AttackAnimator?.MeleeBasic(2);
|
||||
CreateHitBoxOffset(2, 3, 0.1f, 0.1f);
|
||||
break;
|
||||
|
||||
case AttackState.BasicAttack3:
|
||||
AnimationToPlay = "Attack1";
|
||||
AttackAnimator.MeleeBasic(3);
|
||||
AttackAnimator?.MeleeBasic(3);
|
||||
CreateHitBoxOffset(2, 3, 0.1f, 0.1f);
|
||||
break;
|
||||
|
||||
|
||||
@ -203,7 +203,8 @@ public class Player : MonoBehaviour {
|
||||
if (!hit.CompareTag("EnemyHurtBox")) continue;
|
||||
|
||||
GameObject parent = hit.transform.parent?.gameObject;
|
||||
EnemySpawnerData.Goblers[parent].TakeDamage(30, transform.position - parent.transform.position);
|
||||
//EnemySpawnerData.EnemyMap[parent].TakeDamage(0, transform.position - parent.transform.position);
|
||||
EnemySpawnerData.EnemyMap[parent].TakeDamage(0, PrevDirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,42 +1,55 @@
|
||||
using AI.Base;
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using static EnemySpawnerManager;
|
||||
using static EnemySpawnerData;
|
||||
using static UnityEngine.EventSystems.EventTrigger;
|
||||
|
||||
|
||||
public class EnemySpawnerManager : MonoBehaviour {
|
||||
public static EnemySpawnerManager Instance;
|
||||
public static Action UpdateTick;
|
||||
public static Action GizmoTick;
|
||||
|
||||
[SerializeField] public GameObject GoblerPreFab;
|
||||
private GameObjectPool GoblerPool;
|
||||
[SerializeField] public List<Enemies> EnemyPrefabKey;
|
||||
[SerializeField] public List<GameObject> EnemyPrefab;
|
||||
[SerializeField] public List<int> EnemySpawnCountForTesting;
|
||||
[SerializeField] public bool CanStartSpawning = true;
|
||||
|
||||
private Dictionary<Enemies, int> PrefabIndex = new Dictionary<Enemies, int>();
|
||||
private Dictionary<Enemies, int> EnemySpawnCountForTestingDict = new Dictionary<Enemies, int>();
|
||||
private List<Enemies> ListOfEnemies;
|
||||
|
||||
public class Gobler {
|
||||
public GameObject Object;
|
||||
public GoblerStateManager Manager;
|
||||
|
||||
public Gobler(GameObject obj, GoblerStateManager manager) {
|
||||
Object = obj;
|
||||
Manager = manager;
|
||||
}
|
||||
}
|
||||
|
||||
public void Awake() {
|
||||
Instance = this;
|
||||
EnemySpawnerData.Goblers.Clear();
|
||||
GoblerPool = new GameObjectPool(GoblerPreFab, 50, 200);
|
||||
|
||||
for (int i = 0; i < EnemyPrefabKey.Count; i++) {
|
||||
PrefabIndex.Add(EnemyPrefabKey[i], i);
|
||||
EnemySpawnCountForTestingDict.Add(EnemyPrefabKey[i], EnemySpawnCountForTesting[i]);
|
||||
}
|
||||
|
||||
public static void RemoveGobler(GameObject gameObject) {
|
||||
//ListOfEnemies = Enum.GetValues(typeof(Enemies)).Cast<Enemies>().ToList();
|
||||
ListOfEnemies = EnemyPrefabKey;
|
||||
Owner = this.GameObject();
|
||||
RestartData();
|
||||
foreach (var enemy in ListOfEnemies) {
|
||||
InitializeEnemyData(enemy, EnemyPrefab[PrefabIndex[enemy]]);
|
||||
ApplyInitialTestSpawnIfApplicable(enemy);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyInitialTestSpawnIfApplicable(Enemies enemy) {
|
||||
if (!EnemySpawnCountForTestingDict.ContainsKey(enemy)) return;
|
||||
MaxSpawnCount[enemy] = EnemySpawnCountForTestingDict[enemy];
|
||||
}
|
||||
|
||||
public static void DestroyEnemy(GameObject gameObject, Enemies enemy) {
|
||||
Destroy(gameObject);
|
||||
EnemySpawnerData.Goblers.Remove(gameObject);
|
||||
CurrentSpawnCount[enemy]--;
|
||||
}
|
||||
|
||||
public void Update() {
|
||||
@ -47,14 +60,20 @@ public class EnemySpawnerManager : MonoBehaviour {
|
||||
public void StartSpawning() {
|
||||
if (!CanStartSpawning) return;
|
||||
|
||||
while (EnemySpawnerData.Goblers.Count() < EnemySpawnerData.MaxGoblers) {
|
||||
var gobler = GoblerPool.Get(transform.position, Quaternion.identity);
|
||||
EnemySpawnerData.Goblers.Add(gobler, new GoblerStateManager(gobler));
|
||||
foreach (var enemy in ListOfEnemies)
|
||||
while (CurrentSpawnCount[enemy] < MaxSpawnCount[enemy]) {
|
||||
var enemyObject = EnemyGameObjectPools[enemy].Get(transform.position, Quaternion.identity);
|
||||
var enemyScript = new Gobler(enemyObject);
|
||||
EnemyMap.Add(enemyObject, enemyScript);
|
||||
CurrentSpawnCount[enemy]++;
|
||||
}
|
||||
|
||||
CanStartSpawning = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void OnDrawGizmos() {
|
||||
GizmoTick?.Invoke();
|
||||
}
|
||||
@ -65,7 +84,57 @@ public class EnemySpawnerManager : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
public static class EnemySpawnerData {
|
||||
public static Dictionary<GameObject, GoblerStateManager> Goblers = new Dictionary<GameObject, GoblerStateManager>();
|
||||
public static int MaxGoblers = 100;
|
||||
|
||||
|
||||
public class EnemyManager : MonoBehaviour {
|
||||
public Action UpdateTick;
|
||||
public Action GizmoTick;
|
||||
|
||||
public void Update() {
|
||||
UpdateTick?.Invoke();
|
||||
}
|
||||
|
||||
public void OnDrawGizmos() {
|
||||
GizmoTick?.Invoke();
|
||||
}
|
||||
|
||||
public void DrawWireSphere(Color color, Vector3 center, float radius) {
|
||||
Gizmos.color = color;
|
||||
Gizmos.DrawWireSphere(center, radius);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class EnemySpawnerData {
|
||||
public enum Enemies {
|
||||
Gobler,
|
||||
}
|
||||
|
||||
public static GameObject Owner;
|
||||
public static Dictionary<Enemies, GameObject> ObjectPrefabs = new Dictionary<Enemies, GameObject>();
|
||||
public static Dictionary<Enemies, GameObjectPool> EnemyGameObjectPools = new Dictionary<Enemies, GameObjectPool>();
|
||||
public static Dictionary<Enemies, EnemyManager> EnemyManagers = new Dictionary<Enemies, EnemyManager>();
|
||||
public static Dictionary<Enemies, int> MaxSpawnCount = new Dictionary<Enemies, int>();
|
||||
public static Dictionary<Enemies, int> CurrentSpawnCount = new Dictionary<Enemies, int>();
|
||||
public static Dictionary<GameObject, Alive> EnemyMap = new Dictionary<GameObject, Alive>();
|
||||
|
||||
public static void RestartData() {
|
||||
ObjectPrefabs = new Dictionary<Enemies, GameObject>();
|
||||
EnemyGameObjectPools = new Dictionary<Enemies, GameObjectPool>();
|
||||
EnemyManagers = new Dictionary<Enemies, EnemyManager>();
|
||||
MaxSpawnCount = new Dictionary<Enemies, int>();
|
||||
CurrentSpawnCount = new Dictionary<Enemies, int>();
|
||||
EnemyMap = new Dictionary<GameObject, Alive>();
|
||||
}
|
||||
|
||||
public static void InitializeEnemyData(Enemies enemy, GameObject prefab) {
|
||||
EnemyGameObjectPools.Add(enemy, new GameObjectPool(prefab, 50, 200));
|
||||
EnemyManagers.Add(enemy, Owner.AddComponent<EnemyManager>());
|
||||
MaxSpawnCount.Add(enemy, 0);
|
||||
CurrentSpawnCount.Add(enemy, 0);
|
||||
}
|
||||
|
||||
//public static Dictionary<GameObject, Gobler> Goblers = new Dictionary<GameObject, Gobler>();
|
||||
//public static int MaxGoblers = 100;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": {
|
||||
"m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"bd3cb4af8406d4436a2ae8c2aafe1f8d\",\"type\":3}}",
|
||||
"m_SerializedTexture": "",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"isMainTexture": false,
|
||||
@ -346,7 +346,7 @@
|
||||
"m_SerializedTexture": "",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"m_DefaultType": 3
|
||||
"m_DefaultType": 0
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@ TagManager:
|
||||
- Ground
|
||||
- HitBox
|
||||
- EnemyHitBox
|
||||
- EnemyHurtBox
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
@ -18,7 +19,7 @@ TagManager:
|
||||
- Structures
|
||||
- EnemyHitBox
|
||||
- PlayerHitBox
|
||||
-
|
||||
- Player
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
@ -21,13 +21,13 @@ EditorUserSettings:
|
||||
value: 37434103
|
||||
flags: 0
|
||||
UnityEditor.ShaderGraph.Blackboard:
|
||||
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd3c3e302a07a37e0901373ae01e0008f707250d171df81a53a546435f934e934c90484c9a484b9f954a84af97dbebc2d7f9eec2d1d1b4f3f8dfe8fee6f4b1b9f0fdae8efcf9a8e7f9959e979998e49698948585b7ede2daa4d69089c2949d9483d5888b97ddeccfbbd2fdf0c3f1eac688b8
|
||||
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4bac5e4042964b964f90484a9f4f4896994e88af97dbebc2d7f9eec2d1d1b4f3f8dfe8fee6f4b1b9f0fdae8efcf9a8e7f9959e979998e49698948585b7ede2daa4d69089c2949d9483d5888b97ddeccfbbd2fdf0c3f1eac688b8
|
||||
flags: 0
|
||||
UnityEditor.ShaderGraph.FloatingWindowsLayout2:
|
||||
value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b9859884ba88bbb4888b8ef7a7a3a8bfaaa0bde7f69580f3d2a3b5f1bfbbc3cbebc7cca4c1d8849397f4829d91b3ece1dac3d3c78cc2c5c09983dff7dcecc3f4f7c0f6f0c6c7f6cdf8cacbd0f079f1f532313626e9efebe5d4eeec3dd62a25dddc6f6a9b
|
||||
flags: 0
|
||||
UnityEditor.ShaderGraph.InspectorWindow:
|
||||
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd3c3e302a07a37e0901373ae01e0008f707250d171df81a53a5405d41895ac825e0100ec20313c0d91cddccd3d0c7efcca9bd8a8888eea1a7a3bdaca6a4f5aef2fda594e6edf38e9ccbddc18390ac86d4849393e2829f85e88584868f82dc8288d3888d95cfb9cff8c6f3f5ddf2f7c5c6f2cdfbcfcdc8e137e6b27d
|
||||
value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd3c3e302a07a37e0901373ae01e0008f707250d171df81a53a5405d419548954e99464a9a4f4a97944f80bb828398a8d5d4cfd7ccd6bafdfae4eff4daf7a3e8afbcbe9af8f9a9fffc9194979599e294999e9c9eee9e93de81e0dbc9dc94dfcd9b9f9a818dd5f0c3f4c6f1f2c6f7f0cfc1f4cdfbcbd2deab22e9f93437293be9efebe7d2e4e135d12a21d7956f
|
||||
flags: 0
|
||||
vcSharedLogLevel:
|
||||
value: 0d5e400f0650
|
||||
|
||||
Loading…
Reference in New Issue
Block a user