this idiot forgot to commit an entire month's worth of code
This commit is contained in:
parent
c67146ea1a
commit
a3321d361c
51 changed files with 3644 additions and 84 deletions
File diff suppressed because one or more lines are too long
49
Assets/Prefabs/EffectInstance.prefab
Normal file
49
Assets/Prefabs/EffectInstance.prefab
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1745302604900373105
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8654205050049429055}
|
||||
- component: {fileID: 4045387074111111271}
|
||||
m_Layer: 0
|
||||
m_Name: EffectInstance
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8654205050049429055
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1745302604900373105}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4045387074111111271
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1745302604900373105}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d9461c5d5a30726ac8395e724c006d73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
thisEffect: {fileID: 0}
|
||||
affectedEntity: {fileID: 0}
|
||||
timeElapsed: 0
|
||||
7
Assets/Prefabs/EffectInstance.prefab.meta
Normal file
7
Assets/Prefabs/EffectInstance.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c9820929d84d30d4a8281155b8f4c5a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -14,6 +14,8 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
cooldown: 2
|
||||
power: 10
|
||||
maxRange: 5
|
||||
minRange: 0
|
||||
fireMode: 1
|
||||
offset: {x: 0, y: 0}
|
||||
angle: 0
|
||||
|
|
|
|||
18
Assets/Prefabs/EnemyMelee.asset
Normal file
18
Assets/Prefabs/EnemyMelee.asset
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
%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: 5766cdfd69614633494a3b73de96271a, type: 3}
|
||||
m_Name: EnemyMelee
|
||||
m_EditorClassIdentifier:
|
||||
cooldown: 2
|
||||
power: 20
|
||||
maxRange: 2
|
||||
minRange: 0
|
||||
8
Assets/Prefabs/EnemyMelee.asset.meta
Normal file
8
Assets/Prefabs/EnemyMelee.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ec13bfc95f128a91a66d9ae8c820783
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
Assets/Prefabs/EnemyRushAbility.asset
Normal file
19
Assets/Prefabs/EnemyRushAbility.asset
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
%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: 489701e947dc0bf818f370f0fa7734aa, type: 3}
|
||||
m_Name: EnemyRushAbility
|
||||
m_EditorClassIdentifier:
|
||||
cooldown: 8
|
||||
power: 0
|
||||
maxRange: 1000
|
||||
minRange: 5
|
||||
speedEffect: {fileID: 11400000, guid: 581ad042424a7f6e4baeda583e321e25, type: 2}
|
||||
8
Assets/Prefabs/EnemyRushAbility.asset.meta
Normal file
8
Assets/Prefabs/EnemyRushAbility.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 787c13b06a48bb9488bf95736cf56e2d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/Prefabs/RushEffect.asset
Normal file
18
Assets/Prefabs/RushEffect.asset
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
%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: c42a268529acb9c14b00a019f63603b8, type: 3}
|
||||
m_Name: RushEffect
|
||||
m_EditorClassIdentifier:
|
||||
effectInstanceObject: {fileID: 4045387074111111271, guid: 0c9820929d84d30d4a8281155b8f4c5a, type: 3}
|
||||
duration: 10
|
||||
isConstant: 0
|
||||
speedAmount: 4
|
||||
8
Assets/Prefabs/RushEffect.asset.meta
Normal file
8
Assets/Prefabs/RushEffect.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 581ad042424a7f6e4baeda583e321e25
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
601
Assets/Prefabs/RusherEnemy.prefab
Normal file
601
Assets/Prefabs/RusherEnemy.prefab
Normal file
|
|
@ -0,0 +1,601 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7594636906142583336
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4116324020464465292}
|
||||
- component: {fileID: 7566451613608811173}
|
||||
- component: {fileID: 7366552715507504308}
|
||||
- component: {fileID: 2422293541233266944}
|
||||
m_Layer: 6
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &4116324020464465292
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7594636906142583336}
|
||||
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: 9042558635392984853}
|
||||
m_Father: {fileID: 8365993665657711315}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &7566451613608811173
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7594636906142583336}
|
||||
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: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &7366552715507504308
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7594636906142583336}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &2422293541233266944
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7594636906142583336}
|
||||
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: 4294967295
|
||||
--- !u!1 &7987017199152692169
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8365993665657711315}
|
||||
- component: {fileID: 2925441294215993266}
|
||||
- component: {fileID: 4212479499813186278}
|
||||
- component: {fileID: 3678290925386274447}
|
||||
- component: {fileID: 3967664051888947817}
|
||||
m_Layer: 6
|
||||
m_Name: RusherEnemy
|
||||
m_TagString: Enemy
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8365993665657711315
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7987017199152692169}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 385188295323136109}
|
||||
- {fileID: 4116324020464465292}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &2925441294215993266
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7987017199152692169}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 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: 9
|
||||
m_Sprite: {fileID: 2038449967503034895, guid: 4276a09caef75140e8d88b4f29a9681b, type: 3}
|
||||
m_Color: {r: 1, g: 0, b: 0, 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 &4212479499813186278
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7987017199152692169}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 0.8125, y: 1.705}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!50 &3678290925386274447
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7987017199152692169}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
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!114 &3967664051888947817
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7987017199152692169}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8f7666f7f9e3cad958069b3b00bd6879, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
entityName: Rusher Enemy (PLACEHOLDER NAME)
|
||||
sprite: {fileID: 2925441294215993266}
|
||||
stalled: 0
|
||||
invincible: 0
|
||||
health: 100
|
||||
maxHealth: 100
|
||||
isFacingRight: 0
|
||||
rb: {fileID: 3678290925386274447}
|
||||
speed: 3
|
||||
speedMultiplier: 1
|
||||
closestTarget: {fileID: 0}
|
||||
engagementRange: 2
|
||||
detectedPlayer: 0
|
||||
acceleration: 1000
|
||||
possibleDirections:
|
||||
- {fileID: 6161020943054912188}
|
||||
- {fileID: 7476752259126708225}
|
||||
- {fileID: 469761835014840321}
|
||||
- {fileID: 1565982449756658792}
|
||||
- {fileID: 8393752127008465115}
|
||||
- {fileID: 4008917414401149616}
|
||||
- {fileID: 1084514918818936304}
|
||||
- {fileID: 7431150240289454321}
|
||||
- {fileID: 3501791494904136953}
|
||||
- {fileID: 6818693323712537871}
|
||||
- {fileID: 3265185485914967355}
|
||||
- {fileID: 7697949338947779667}
|
||||
- {fileID: 1574959089745002471}
|
||||
- {fileID: 5382070844028718038}
|
||||
- {fileID: 1261620358221650041}
|
||||
- {fileID: 2490025746165144143}
|
||||
forwardPercent: 60
|
||||
strafePercent: 40
|
||||
possibleDrops: []
|
||||
pickupObject: {fileID: 862999616518891837, guid: a61100612a8d074668a1c7407caeb226, type: 3}
|
||||
allAbilities:
|
||||
- ability: {fileID: 11400000, guid: 787c13b06a48bb9488bf95736cf56e2d, type: 2}
|
||||
currentCooldown: 2
|
||||
- ability: {fileID: 11400000, guid: 8ec13bfc95f128a91a66d9ae8c820783, type: 2}
|
||||
currentCooldown: 2
|
||||
lastTargetLocation: {x: 0, y: 0}
|
||||
lastTargetDirection: {x: 0, y: 0}
|
||||
--- !u!1 &7992963443241331386
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9042558635392984853}
|
||||
- component: {fileID: 5797718322639082070}
|
||||
- component: {fileID: 6464997185456802114}
|
||||
m_Layer: 6
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9042558635392984853
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7992963443241331386}
|
||||
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: 4116324020464465292}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1, y: 1}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5797718322639082070
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7992963443241331386}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6464997185456802114
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7992963443241331386}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: ENEMY!!!
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278190335
|
||||
m_fontColor: {r: 1, g: 0, b: 0, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 0.2
|
||||
m_fontSizeBase: 0.2
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1001 &5265084976451855392
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8365993665657711315}
|
||||
m_Modifications:
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9079747590522285494, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AllDirections
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
--- !u!4 &385188295323136109 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5496960370968302669, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &469761835014840321 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5734695333304255521, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &1084514918818936304 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5052386159153959376, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &1261620358221650041 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6382581350332595289, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &1565982449756658792 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6677195982080669768, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &1574959089745002471 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 6686216045267344327, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &2490025746165144143 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7754934515627769455, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &3265185485914967355 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7224075092648634651, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &3501791494904136953 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 8757682873166094553, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &4008917414401149616 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 9129886911222689424, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &5382070844028718038 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 261668413908791286, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &6161020943054912188 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2058427622604349084, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &6818693323712537871 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1707299186583404847, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &7431150240289454321 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3328697951113075921, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &7476752259126708225 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 3374203767933135905, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &7697949338947779667 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2577689290192967795, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &8393752127008465115 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4426422662409766139, guid: e980566cdd85bba29802c42872c9dbb9, type: 3}
|
||||
m_PrefabInstance: {fileID: 5265084976451855392}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
7
Assets/Prefabs/RusherEnemy.prefab.meta
Normal file
7
Assets/Prefabs/RusherEnemy.prefab.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dca3334ce8d502431a2ec8584bd4573d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -21615,7 +21615,6 @@ Transform:
|
|||
m_Children:
|
||||
- {fileID: 1972076835}
|
||||
- {fileID: 1483226599}
|
||||
- {fileID: 1432589379}
|
||||
- {fileID: 382827739}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -25787,6 +25786,7 @@ MonoBehaviour:
|
|||
allUpgrades:
|
||||
- {fileID: 11400000, guid: 6fe34d7ec95c2ce1fac0727c553b5f0b, type: 2}
|
||||
- {fileID: 11400000, guid: 8ba5b877541778773b0434cf7e36cebb, type: 2}
|
||||
- {fileID: 11400000, guid: f8b8bce9dd3b28a8fa56648bcb036480, type: 2}
|
||||
allAbilities:
|
||||
- {fileID: 8579369158027197764, guid: d695e39a8ed83e67aa09d75b33cf7bb3, type: 3}
|
||||
- {fileID: 8579369158027197764, guid: fc8f0e7853997c463b72085306621f40, type: 3}
|
||||
|
|
@ -25800,12 +25800,12 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1432589377}
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 439163859}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1483226596
|
||||
GameObject:
|
||||
|
|
@ -25940,7 +25940,6 @@ MonoBehaviour:
|
|||
- {fileID: 1568300954}
|
||||
- {fileID: 122444051}
|
||||
- {fileID: 748451018}
|
||||
playerAbilityHandler: {fileID: 394036756}
|
||||
abilityUI: {fileID: 1676793499}
|
||||
upgradeGrid: {fileID: 1982511464}
|
||||
templateStoredUpgradeUI: {fileID: 7904669694422582500, guid: 4af6aa94cacc76b58b61e239461992e0, type: 3}
|
||||
|
|
@ -27937,7 +27936,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
canSpawn: 1
|
||||
enemiesToSpawn:
|
||||
- {fileID: 2525771944862034798, guid: 063e01ce3891d882e88d10b67e7f9f7b, type: 3}
|
||||
- {fileID: 3967664051888947817, guid: dca3334ce8d502431a2ec8584bd4573d, type: 3}
|
||||
spawnPoints:
|
||||
- {fileID: 1606209485}
|
||||
- {fileID: 2000423408}
|
||||
|
|
@ -52538,6 +52537,7 @@ SceneRoots:
|
|||
- {fileID: 583397146}
|
||||
- {fileID: 994553009}
|
||||
- {fileID: 1516594163}
|
||||
- {fileID: 1432589379}
|
||||
- {fileID: 439163859}
|
||||
- {fileID: 394036755}
|
||||
- {fileID: 1683661728}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,7 @@ using UnityEngine.EventSystems;
|
|||
|
||||
public class AbilityHotbarIcon : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
[SerializeField] private Transform cooldownBar;
|
||||
public Transform cooldownBar;
|
||||
[SerializeField] private TextMeshProUGUI text;
|
||||
private bool onCooldown;
|
||||
private PlayerAbility thisAbility;
|
||||
|
|
@ -34,6 +34,7 @@ public class AbilityHotbarIcon : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
|||
public void UpdateAbility(PlayerAbility ability)
|
||||
{
|
||||
thisAbility = ability;
|
||||
ability.thisHotbarIcon = this;
|
||||
text.text = thisAbility.abilityName;
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public class AbilityManager : MonoBehaviour
|
|||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -26,12 +27,23 @@ public class AbilityManager : MonoBehaviour
|
|||
public Button upgradeButton;
|
||||
[Header("Upgrades")]
|
||||
public AbilityUpgrade[] allUpgrades;
|
||||
public PlayerAbility[] allAbilities;
|
||||
[SerializeField] private PlayerAbility[] allAbilities;
|
||||
public Dictionary<String, PlayerAbility> abilityLookup = new();
|
||||
public Dictionary<String, AbilityUpgrade> upgradeLookup = new();
|
||||
public Dictionary<AbilityUpgrade, int> upgradesInventory = new();
|
||||
private void Start()
|
||||
{
|
||||
// upgradeButton.onClick.AddListener((() => AddUpgrade(upgradeToAdd, player.mainAttackInstance)));
|
||||
StoreUpgrade(upgradeToAdd);
|
||||
foreach (PlayerAbility ability in allAbilities)
|
||||
{
|
||||
abilityLookup[ability.abilityName] = ability;
|
||||
}
|
||||
|
||||
foreach (AbilityUpgrade upgrade in allUpgrades)
|
||||
{
|
||||
upgradeLookup[upgrade.upgradeName] = upgrade;
|
||||
}
|
||||
}
|
||||
|
||||
public void StoreUpgrade(AbilityUpgrade upgradeToStore)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ public class EnemyAbility : ScriptableObject
|
|||
{
|
||||
public float cooldown;
|
||||
public float power;
|
||||
public float range;
|
||||
public float maxRange;
|
||||
public float minRange; //usually zero but might be needed in some cases
|
||||
public virtual void UseAbility(Entity target, Enemy owner)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ public class PlayerAbility : MonoBehaviour
|
|||
public string abilityName;
|
||||
public Sprite abilityIcon;
|
||||
public Marisa thisPlayer;
|
||||
public AbilityHotbarIcon thisHotbarIcon;
|
||||
[Header("Cooldown")]
|
||||
public bool canCooldown = true;
|
||||
public float baseCooldown;
|
||||
|
|
@ -16,6 +17,7 @@ public class PlayerAbility : MonoBehaviour
|
|||
[Header("Stats")]
|
||||
public float basePower;
|
||||
public float power;
|
||||
public float powerMultiplier; // you need to figure out power.
|
||||
public int baseProjectileCount;
|
||||
public int projectileCount;
|
||||
public Dictionary<AbilityUpgrade, int> attachedUpgrades = new();
|
||||
|
|
|
|||
|
|
@ -5,15 +5,17 @@ public class AbilityUpgrade : ScriptableObject
|
|||
[Header("Identification")]
|
||||
public string upgradeName;
|
||||
public Sprite upgradeIcon;
|
||||
public int rarity; //higher is rarer
|
||||
public int cost;
|
||||
[Header("Stats")]
|
||||
[SerializeField] private string hi; //never use this lol it's just for the header
|
||||
|
||||
public void ApplyUpgrade(PlayerAbility abilityToUpgrade)
|
||||
public void ApplyUpgrade(PlayerAbility abilityToUpgrade, float optionalInput = 0)
|
||||
{
|
||||
UpgradeEffects(abilityToUpgrade);
|
||||
UpgradeEffects(abilityToUpgrade, optionalInput);
|
||||
}
|
||||
|
||||
protected virtual void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
protected virtual void UpgradeEffects(PlayerAbility abilityToUpgrade, float optionalInput)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ public class CooldownUpgrade : AbilityUpgrade
|
|||
{
|
||||
[SerializeField] private float cooldownDifference;
|
||||
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade, float optionalInput)
|
||||
{
|
||||
abilityToUpgrade.cooldown = abilityToUpgrade.baseCooldown * ((float)Math.Pow(cooldownDifference, abilityToUpgrade.attachedUpgrades[this])); //almost forgot my math there...
|
||||
}
|
||||
|
|
|
|||
19
Assets/Scripts/Abilities/Upgrades/Enemy Count Upgrade.asset
Normal file
19
Assets/Scripts/Abilities/Upgrades/Enemy Count Upgrade.asset
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
%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: ce6ef1d1ae7df5849b3fdee8fc8fcbba, type: 3}
|
||||
m_Name: Enemy Count Upgrade
|
||||
m_EditorClassIdentifier:
|
||||
upgradeName: A name
|
||||
upgradeIcon: {fileID: 0}
|
||||
hi:
|
||||
damageIncreasePercentage: 0.15
|
||||
runtimeObject: {fileID: 7716994186307467207, guid: 6d10c59bff13032f287e544b4c3c19cf, type: 3}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f8b8bce9dd3b28a8fa56648bcb036480
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
48
Assets/Scripts/Abilities/Upgrades/EnemyCountInstance.prefab
Normal file
48
Assets/Scripts/Abilities/Upgrades/EnemyCountInstance.prefab
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6018690837818724447
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2133486229549973065}
|
||||
- component: {fileID: 7716994186307467207}
|
||||
m_Layer: 0
|
||||
m_Name: EnemyCountInstance
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2133486229549973065
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6018690837818724447}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7716994186307467207
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6018690837818724447}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 54d7053b10fbdd0329fb509aa84129fb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
baseSO: {fileID: 0}
|
||||
thisAbility: {fileID: 0}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d10c59bff13032f287e544b4c3c19cf
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/Scripts/Abilities/Upgrades/EnemyCountPowerup.cs
Normal file
16
Assets/Scripts/Abilities/Upgrades/EnemyCountPowerup.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "Enemy Count Upgrade", menuName = "AbilityUpgrades/EnemyCountUpgrade")]
|
||||
public class EnemyCountPowerup : AbilityUpgrade
|
||||
{
|
||||
public float damageIncreasePercentage;
|
||||
[SerializeField] private EnemyCountRuntime runtimeObject;
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade, float optionalInput)
|
||||
{
|
||||
EnemyCountRuntime newRuntimeObject = Instantiate(runtimeObject, abilityToUpgrade.transform);
|
||||
newRuntimeObject.baseSO = this;
|
||||
newRuntimeObject.thisAbility = abilityToUpgrade;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ce6ef1d1ae7df5849b3fdee8fc8fcbba
|
||||
26
Assets/Scripts/Abilities/Upgrades/EnemyCountRuntime.cs
Normal file
26
Assets/Scripts/Abilities/Upgrades/EnemyCountRuntime.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnemyCountRuntime : MonoBehaviour
|
||||
{
|
||||
private List<Collider2D> enemiesInRange = new(); //was supposed to be entity list but trygetcomponent isn't needed because we aren't using the actual entity values
|
||||
public EnemyCountPowerup baseSO;
|
||||
public PlayerAbility thisAbility;
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (!other.CompareTag(tag))
|
||||
{
|
||||
enemiesInRange.Add(other);
|
||||
}
|
||||
thisAbility.powerMultiplier = 1 + baseSO.damageIncreasePercentage * enemiesInRange.Count; //does not stack with other multipliers and must be fixed
|
||||
}
|
||||
|
||||
private void OnTriggerExit2D(Collider2D other)
|
||||
{
|
||||
if (!other.CompareTag(tag) && enemiesInRange.Contains(other))
|
||||
{
|
||||
enemiesInRange.Remove(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 54d7053b10fbdd0329fb509aa84129fb
|
||||
18
Assets/Scripts/Abilities/Upgrades/KillCooldown.cs
Normal file
18
Assets/Scripts/Abilities/Upgrades/KillCooldown.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class KillCooldown : AbilityUpgrade
|
||||
{
|
||||
public float damageIncrease;
|
||||
public float cooldownChange;
|
||||
[SerializeField] private KillCooldownRuntimeObject runtimeObject;
|
||||
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade, float optionalInput)
|
||||
{
|
||||
base.UpgradeEffects(abilityToUpgrade, optionalInput);
|
||||
abilityToUpgrade.canCooldown = false;
|
||||
abilityToUpgrade.cooldown = abilityToUpgrade.baseCooldown * cooldownChange;
|
||||
KillCooldownRuntimeObject newRuntimeObject = Instantiate(runtimeObject, abilityToUpgrade.transform);
|
||||
newRuntimeObject.ability = abilityToUpgrade;
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Abilities/Upgrades/KillCooldown.cs.meta
Normal file
2
Assets/Scripts/Abilities/Upgrades/KillCooldown.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 70c8f2392635dc77da8d3f4bf9d656c7
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class KillCooldownRuntimeObject : MonoBehaviour
|
||||
{
|
||||
public PlayerAbility ability;
|
||||
private void Start()
|
||||
{
|
||||
Enemy.OnKill += UpdateKills;
|
||||
}
|
||||
|
||||
public void UpdateKills()
|
||||
{
|
||||
ability.currentCooldown -= 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c4e5e6da9766bf54d8c2aa3b49966213
|
||||
|
|
@ -3,7 +3,7 @@ using UnityEngine;
|
|||
[CreateAssetMenu(fileName = "Projectile Count Upgrade", menuName = "AbilityUpgrades/ProjectileCountUpgrade")]
|
||||
public class ProjectileCountUpgrade : AbilityUpgrade
|
||||
{
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade)
|
||||
protected override void UpgradeEffects(PlayerAbility abilityToUpgrade, float optionalInput)
|
||||
{
|
||||
abilityToUpgrade.projectileCount =
|
||||
abilityToUpgrade.baseProjectileCount + abilityToUpgrade.attachedUpgrades[this];
|
||||
|
|
|
|||
|
|
@ -68,16 +68,7 @@ public class AbilitySceneTransfer : MonoBehaviour
|
|||
abilityHandler.abilities.Clear();
|
||||
foreach (SavedAbility savedAbility in savedAbilities)
|
||||
{
|
||||
PlayerAbility foundAbility = null;
|
||||
foreach (PlayerAbility ability in AbilityManager.instance.allAbilities)
|
||||
{
|
||||
if (savedAbility.abilityName == ability.abilityName) //shit code
|
||||
{
|
||||
foundAbility = ability;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PlayerAbility foundAbility = AbilityManager.instance.abilityLookup[savedAbility.abilityName];
|
||||
if (!foundAbility)
|
||||
{
|
||||
Debug.LogWarning($"{savedAbility.abilityName} was not found.");
|
||||
|
|
@ -85,20 +76,13 @@ public class AbilitySceneTransfer : MonoBehaviour
|
|||
abilityHandler.abilities.Add(foundAbility);
|
||||
}
|
||||
abilityHandler.SetupAbilities();
|
||||
foreach (PlayerAbility abilityInstance in abilityHandler.abilityInstances)
|
||||
foreach (SavedAbility savedAbility in savedAbilities)
|
||||
{
|
||||
foreach (SavedAbility savedAbility in savedAbilities)
|
||||
foreach (KeyValuePair<string, int> equippedUpgrade in savedAbility.equippedUpgrades)
|
||||
{
|
||||
if (savedAbility.abilityName == abilityInstance.abilityName) //shit code
|
||||
if (AbilityManager.instance.upgradeLookup[equippedUpgrade.Key] != null)
|
||||
{
|
||||
foreach (AbilityUpgrade upgrade in AbilityManager.instance.allUpgrades)
|
||||
{
|
||||
if (savedAbility.equippedUpgrades[upgrade.upgradeName] > 0)
|
||||
{
|
||||
abilityInstance.AddUpgrade(upgrade, savedAbility.equippedUpgrades[upgrade.upgradeName]);
|
||||
}
|
||||
} //this is REALLY BAD.
|
||||
break;
|
||||
abilityHandler.instantiatedAbilityLookup[savedAbility.abilityName].AddUpgrade(AbilityManager.instance.upgradeLookup[equippedUpgrade.Key], equippedUpgrade.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ public class Effect : ScriptableObject
|
|||
{
|
||||
EffectInstance newEffectInstance = Instantiate(effectInstanceObject, affectedEntity.transform);
|
||||
newEffectInstance.affectedEntity = affectedEntity;
|
||||
|
||||
newEffectInstance.thisEffect = this;
|
||||
|
||||
}
|
||||
|
||||
public virtual void EffectTick(Entity affectedEntity)
|
||||
|
|
|
|||
16
Assets/Scripts/Effects/SpeedEffect.cs
Normal file
16
Assets/Scripts/Effects/SpeedEffect.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "New Speed Effect", menuName = "Effects/Speed")]
|
||||
public class SpeedEffect : Effect
|
||||
{
|
||||
[SerializeField] private float speedAmount;
|
||||
public override void ApplyEffect(Entity affectedEntity)
|
||||
{
|
||||
base.ApplyEffect(affectedEntity);
|
||||
affectedEntity.speedMultiplier += speedAmount;
|
||||
}
|
||||
public override void RemoveEffect(Entity affectedEntity)
|
||||
{
|
||||
affectedEntity.speedMultiplier = 1f; //supposed to be -= speedAmount but it's fucked.
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Effects/SpeedEffect.cs.meta
Normal file
2
Assets/Scripts/Effects/SpeedEffect.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c42a268529acb9c14b00a019f63603b8
|
||||
|
|
@ -13,6 +13,7 @@ public class Enemy : Entity
|
|||
public float currentCooldown;
|
||||
}
|
||||
public static event Action OnDamaged;
|
||||
public static event Action OnKill;
|
||||
[Header("Targetting")]
|
||||
public Entity closestTarget;
|
||||
public float engagementRange;
|
||||
|
|
@ -22,8 +23,8 @@ public class Enemy : Entity
|
|||
public Transform[] possibleDirections;
|
||||
public float forwardPercent;
|
||||
public float strafePercent;
|
||||
private float xSign = -1f;
|
||||
private float ySign = 1f;
|
||||
protected float xSign = -1f;
|
||||
protected float ySign = 1f;
|
||||
|
||||
[System.Serializable]
|
||||
public class UpgradeDrop
|
||||
|
|
@ -37,6 +38,11 @@ public class Enemy : Entity
|
|||
|
||||
[Header("Abilities")]
|
||||
[SerializeField] private Ability[] allAbilities;
|
||||
|
||||
[Header("Levels")]
|
||||
[SerializeField] private float levelHealthBuff;
|
||||
[SerializeField] private float levelPowerBuff;
|
||||
public float powerBuffAmount;
|
||||
private void Start()
|
||||
{
|
||||
if (Random.Range(0f, 2f) > 1f)
|
||||
|
|
@ -44,16 +50,21 @@ public class Enemy : Entity
|
|||
xSign = -xSign;
|
||||
ySign = -ySign;
|
||||
}
|
||||
//set hp and dmg values
|
||||
maxHealth = baseMaxHealth * (EnemySpawner.instance.enemyLevel * levelHealthBuff);
|
||||
health = maxHealth;
|
||||
powerBuffAmount = EnemySpawner.instance.enemyLevel * levelPowerBuff;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (detectedPlayer)
|
||||
{
|
||||
Ability foundAbility = null;
|
||||
foreach (Ability availableAbility in allAbilities)
|
||||
{
|
||||
if (foundAbility == null && availableAbility.currentCooldown <= 0 && availableAbility.ability.range < Vector3.Distance(closestTarget.transform.position, transform.position))
|
||||
float targetDistance = Vector3.Distance(closestTarget.transform.position, transform.position);
|
||||
if (foundAbility == null && availableAbility.currentCooldown <= 0 && availableAbility.ability.maxRange > targetDistance && availableAbility.ability.minRange < targetDistance)
|
||||
{
|
||||
foundAbility = availableAbility;
|
||||
}
|
||||
|
|
@ -100,7 +111,7 @@ public class Enemy : Entity
|
|||
directionToMove = directionToPoint;
|
||||
}
|
||||
}
|
||||
rb.VelocityTowards(directionToMove.ScaleToMagnitude(speed), acceleration);
|
||||
rb.VelocityTowards(directionToMove.ScaleToMagnitude(speed * speedMultiplier), acceleration);
|
||||
FlipSprite(directionToMove);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class EnemyFireBullet : EnemyAbility
|
|||
|
||||
newProjectile.owner = owner;
|
||||
newProjectile.pierceAmount = pierceAmount;
|
||||
newProjectile.damage = power;
|
||||
newProjectile.damage = power * owner.powerBuffAmount;
|
||||
newProjectile.speed = projectileSpeed;
|
||||
newProjectile.lifetime = bulletLifetime;
|
||||
newProjectile.transform.Rotate(0, 0, Random.Range(-accuracy, accuracy));
|
||||
|
|
|
|||
17
Assets/Scripts/Entities/Enemy/EnemyRushAbility.cs
Normal file
17
Assets/Scripts/Entities/Enemy/EnemyRushAbility.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "New Enemy Rush Ability", menuName = "EnemyAbilities/Rush")]
|
||||
public class EnemyRushAbility : EnemyAbility
|
||||
{
|
||||
[SerializeField] private Effect speedEffect;
|
||||
public override void UseAbility(Entity target, Enemy owner)
|
||||
{
|
||||
Debug.Log("ability activated");
|
||||
if (owner.speedMultiplier < 1.10f)
|
||||
{
|
||||
Debug.Log("affect applied");
|
||||
speedEffect.ApplyEffect(owner);
|
||||
}
|
||||
//owner.closestTarget =
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Entities/Enemy/EnemyRushAbility.cs.meta
Normal file
2
Assets/Scripts/Entities/Enemy/EnemyRushAbility.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 489701e947dc0bf818f370f0fa7734aa
|
||||
|
|
@ -36,9 +36,12 @@ public class EnemySpawner : MonoBehaviour
|
|||
[SerializeField] private Transform bossHealthBar;
|
||||
[SerializeField] private TextMeshProUGUI bossHealthText;
|
||||
[SerializeField] private TextMeshProUGUI bossNameText;
|
||||
[Header("Difficulty Scaling")]
|
||||
public float levelUpIntervals;
|
||||
public int enemyLevel;
|
||||
[Header("Cache")]
|
||||
[SerializeField] private Transform enemyFolder;
|
||||
[SerializeField] private Marisa player;
|
||||
public Marisa player;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
|
@ -51,13 +54,14 @@ public class EnemySpawner : MonoBehaviour
|
|||
SpawnEnemy(enemiesToSpawn[Random.Range(0, enemiesToSpawn.Length)], spawnPoints[Random.Range(0, spawnPoints.Count)].position);
|
||||
}
|
||||
}
|
||||
else if (!canSpawn && bossEnemy)
|
||||
else if (!canSpawn && bossEnemy.health < 0)
|
||||
{
|
||||
if (Input.GetKey(KeyCode.E))
|
||||
{
|
||||
LevelSwitcher.instance.LoadShop();
|
||||
}
|
||||
}
|
||||
enemyLevel = (int)(Time.time / levelUpIntervals); //figure out the time.time thing because that's not gonna work here
|
||||
}
|
||||
|
||||
public Enemy SpawnEnemy(Enemy enemy, Vector3 location)
|
||||
|
|
|
|||
58
Assets/Scripts/Entities/Enemy/RusherEnemy.cs
Normal file
58
Assets/Scripts/Entities/Enemy/RusherEnemy.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using Core.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
public class RusherEnemy : Enemy
|
||||
{
|
||||
private bool isRushing;
|
||||
public Vector2 lastTargetLocation;
|
||||
public Vector2 lastTargetDirection;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (speedMultiplier <= 1.10f && closestTarget)
|
||||
{
|
||||
lastTargetLocation = closestTarget.transform.position;
|
||||
lastTargetDirection = (lastTargetLocation - (Vector2)transform.position).normalized;
|
||||
}
|
||||
|
||||
}
|
||||
protected override void FixedUpdate() //this is really bad.
|
||||
{
|
||||
if (!detectedPlayer && Vector3.Distance(transform.position, lastTargetLocation) < engagementRange)
|
||||
{
|
||||
detectedPlayer = true;
|
||||
}
|
||||
if (stalled || !closestTarget || !detectedPlayer)
|
||||
{
|
||||
rb.VelocityTowards(Vector2.zero.ScaleToMagnitude(speed), acceleration);
|
||||
}
|
||||
else if (speed > 1.10f && closestTarget)
|
||||
{
|
||||
rb.VelocityTowards(lastTargetDirection.ScaleToMagnitude(speed * speedMultiplier), acceleration);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 directionToTarget = (lastTargetLocation - (Vector2)transform.position).normalized;
|
||||
Vector2 directionToMove = directionToTarget;
|
||||
float currentHighestScore = float.NegativeInfinity;
|
||||
Vector2 strafeDirection = new Vector3(directionToTarget.y * ySign, directionToTarget.x * xSign);
|
||||
foreach (Transform direction in possibleDirections)
|
||||
{
|
||||
Vector3 directionToPoint = (direction.position - transform.position).normalized;
|
||||
float forwardScore = Vector3.Dot(directionToPoint, directionToTarget);
|
||||
float strafeScore = Vector3.Dot(directionToPoint, strafeDirection);
|
||||
float finalScore = (forwardScore * forwardPercent) + (strafeScore * strafePercent);
|
||||
//Debug.Log($"Forward: {forwardScore} Strafe: {strafeScore} Final: {finalScore}");
|
||||
if (finalScore > currentHighestScore)
|
||||
{
|
||||
//Debug.Log($"{finalScore} is higher than current score: {currentHighestScore}");
|
||||
currentHighestScore = finalScore;
|
||||
directionToMove = directionToPoint;
|
||||
}
|
||||
}
|
||||
rb.VelocityTowards(directionToMove.ScaleToMagnitude(speed * speedMultiplier), acceleration);
|
||||
FlipSprite(directionToMove);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Entities/Enemy/RusherEnemy.cs.meta
Normal file
2
Assets/Scripts/Entities/Enemy/RusherEnemy.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8f7666f7f9e3cad958069b3b00bd6879
|
||||
|
|
@ -11,6 +11,7 @@ public class Entity : MonoBehaviour
|
|||
public bool invincible;
|
||||
[Header("Stats")]
|
||||
public float health;
|
||||
public float baseMaxHealth; //for enemies, mostly.
|
||||
public float maxHealth;
|
||||
|
||||
[Header("Movement")]
|
||||
|
|
@ -18,6 +19,7 @@ public class Entity : MonoBehaviour
|
|||
[SerializeField] protected Rigidbody2D rb;
|
||||
protected Vector2 moveDirection;
|
||||
public float speed;
|
||||
public float speedMultiplier = 1f;
|
||||
|
||||
protected void FlipSprite(Vector2 lookDirection)
|
||||
{
|
||||
|
|
@ -36,7 +38,7 @@ public class Entity : MonoBehaviour
|
|||
{
|
||||
if (!stalled)
|
||||
{
|
||||
rb.linearVelocity = moveDirection * speed;
|
||||
rb.linearVelocity = moveDirection * (speed * speedMultiplier);
|
||||
FlipSprite(moveDirection);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class MarisaAbilityHandler : MonoBehaviour
|
|||
|
||||
[Header("Ability Instances")]
|
||||
public List<PlayerAbility> abilityInstances = new();
|
||||
|
||||
public Dictionary<String, PlayerAbility> instantiatedAbilityLookup = new();
|
||||
[Header("UI")]
|
||||
public AbilityHotbarIcon[] hotbarIcons;
|
||||
//this is getting ridiculous
|
||||
|
|
@ -23,6 +23,15 @@ public class MarisaAbilityHandler : MonoBehaviour
|
|||
SetupAbilities();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
hotbarIcons = FindObjectsByType<AbilityHotbarIcon>(FindObjectsSortMode.InstanceID);
|
||||
if (AbilitySceneTransfer.instance.savedAbilities.Count > 0)
|
||||
{
|
||||
LevelSwitcher.instance.SetupScene();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupAbilities()
|
||||
{
|
||||
foreach (PlayerAbility oldAbility in abilityInstances)
|
||||
|
|
@ -37,6 +46,7 @@ public class MarisaAbilityHandler : MonoBehaviour
|
|||
abilityInstances.Add(newAbility);
|
||||
newAbility.thisPlayer = thisPlayer;
|
||||
hotbarIcons[currentAbilityCount].UpdateAbility(newAbility);
|
||||
instantiatedAbilityLookup[ability.abilityName] = ability;
|
||||
currentAbilityCount++;
|
||||
Debug.Log(ability.abilityName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public class LevelSwitcher : MonoBehaviour
|
|||
AbilitySceneTransfer.instance.SaveAllAbilities();
|
||||
SceneManager.LoadScene(shopStage);
|
||||
SceneManager.LoadScene(uiStage, LoadSceneMode.Additive);
|
||||
SetupScene();
|
||||
}
|
||||
public void ChangeLevel()
|
||||
{
|
||||
|
|
@ -39,12 +38,13 @@ public class LevelSwitcher : MonoBehaviour
|
|||
AbilitySceneTransfer.instance.SaveAllAbilities();
|
||||
SceneManager.LoadScene(stages[currentStage]);
|
||||
SceneManager.LoadScene(uiStage, LoadSceneMode.Additive);
|
||||
SetupScene();
|
||||
}
|
||||
|
||||
public void SetupScene()
|
||||
{
|
||||
AbilitySceneTransfer.instance.abilityHandler = FindFirstObjectByType<MarisaAbilityHandler>();
|
||||
MarisaAbilityHandler abilityHandler = FindFirstObjectByType<MarisaAbilityHandler>();
|
||||
AbilityManager.instance.player = abilityHandler;
|
||||
AbilitySceneTransfer.instance.abilityHandler = abilityHandler;
|
||||
AbilitySceneTransfer.instance.LoadAbilities();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
27
Assets/Scripts/ShopKeeperInteractionRadius.cs
Normal file
27
Assets/Scripts/ShopKeeperInteractionRadius.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class ShopKeeperInteractionRadius : MonoBehaviour
|
||||
{
|
||||
private bool playerNearby;
|
||||
[SerializeField] private GameObject interactionIcon;
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
playerNearby = true;
|
||||
interactionIcon.SetActive(true);
|
||||
}
|
||||
|
||||
private void OnTriggerExit2D(Collider2D other)
|
||||
{
|
||||
playerNearby = false;
|
||||
interactionIcon.SetActive(false);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (playerNearby && Input.GetKeyDown(KeyCode.E))
|
||||
{
|
||||
ShopManager.instance.OpenShopUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/ShopKeeperInteractionRadius.cs.meta
Normal file
2
Assets/Scripts/ShopKeeperInteractionRadius.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0bdd5df04b73a1d49895790a09b14f5d
|
||||
58
Assets/Scripts/ShopManager.cs
Normal file
58
Assets/Scripts/ShopManager.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ShopManager : MonoBehaviour
|
||||
{
|
||||
#region Statication
|
||||
|
||||
public static ShopManager instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
public List<AbilityUpgrade> buyableUpgrades;
|
||||
public int currency; //uh. we need to figure out this one lol
|
||||
public GameObject shopUIObject;
|
||||
[SerializeField] private Marisa player;
|
||||
public void GenerateUpgradeList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void BuyUpgrade(AbilityUpgrade abilityToBuy)
|
||||
{
|
||||
if (currency >= abilityToBuy.cost)
|
||||
{
|
||||
AbilityManager.instance.upgradesInventory[abilityToBuy]++;
|
||||
currency -= abilityToBuy.cost;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SellUpgrade(AbilityUpgrade abilityToSell)
|
||||
{
|
||||
AbilityManager.instance.upgradesInventory[abilityToSell]--;
|
||||
currency += abilityToSell.cost/2;
|
||||
}
|
||||
|
||||
public void OpenShopUI()
|
||||
{
|
||||
shopUIObject.SetActive(true);
|
||||
player.stalled = true;
|
||||
}
|
||||
|
||||
public void CloseShopUI()
|
||||
{
|
||||
shopUIObject.SetActive(false);
|
||||
player.stalled = false;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/ShopManager.cs.meta
Normal file
2
Assets/Scripts/ShopManager.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 608f31ca71d83048b93bab7cbc0d4d92
|
||||
Loading…
Add table
Add a link
Reference in a new issue