add scripts from post-scale attempt
This commit is contained in:
parent
96dcfa9064
commit
87383d5b8c
18 changed files with 362 additions and 148 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="UserContentModel">
|
|
||||||
<attachedFolders />
|
|
||||||
<explicitIncludes />
|
|
||||||
<explicitExcludes />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1004,6 +1004,81 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 260785838}
|
m_GameObject: {fileID: 260785838}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &281948449
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 281948450}
|
||||||
|
- component: {fileID: 281948452}
|
||||||
|
- component: {fileID: 281948451}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: BG
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &281948450
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 281948449}
|
||||||
|
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: 809625460}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &281948451
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 281948449}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: -7443756053782179069, guid: d0da55660b73232fcb2171dc7b78c64f, type: 3}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!222 &281948452
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 281948449}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1 &300987186
|
--- !u!1 &300987186
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -4261,6 +4336,108 @@ MonoBehaviour:
|
||||||
livesText: {fileID: 594537357}
|
livesText: {fileID: 594537357}
|
||||||
hurtSound: {fileID: 8300000, guid: 31ceec34062edf012b9c9b29e9e3c583, type: 3}
|
hurtSound: {fileID: 8300000, guid: 31ceec34062edf012b9c9b29e9e3c583, type: 3}
|
||||||
hurtVolume: 1
|
hurtVolume: 1
|
||||||
|
--- !u!1 &809625456
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 809625460}
|
||||||
|
- component: {fileID: 809625459}
|
||||||
|
- component: {fileID: 809625458}
|
||||||
|
- component: {fileID: 809625457}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: BGCANVAS
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &809625457
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 809625456}
|
||||||
|
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!114 &809625458
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 809625456}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_UiScaleMode: 1
|
||||||
|
m_ReferencePixelsPerUnit: 100
|
||||||
|
m_ScaleFactor: 1
|
||||||
|
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||||
|
m_ScreenMatchMode: 0
|
||||||
|
m_MatchWidthOrHeight: 0
|
||||||
|
m_PhysicalUnit: 3
|
||||||
|
m_FallbackScreenDPI: 96
|
||||||
|
m_DefaultSpriteDPI: 96
|
||||||
|
m_DynamicPixelsPerUnit: 1
|
||||||
|
m_PresetInfoIsWorld: 0
|
||||||
|
--- !u!223 &809625459
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 809625456}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 1
|
||||||
|
m_Camera: {fileID: 519420031}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 0
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_VertexColorAlwaysGammaSpace: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_UpdateRectTransformForStandalone: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: -10
|
||||||
|
m_TargetDisplay: 0
|
||||||
|
--- !u!224 &809625460
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 809625456}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 281948450}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
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: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0, y: 0}
|
||||||
--- !u!1 &870930953
|
--- !u!1 &870930953
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -8929,93 +9106,6 @@ MonoBehaviour:
|
||||||
m_hasFontAssetChanged: 0
|
m_hasFontAssetChanged: 0
|
||||||
m_baseMaterial: {fileID: 0}
|
m_baseMaterial: {fileID: 0}
|
||||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||||
--- !u!1 &2067192759
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 2067192761}
|
|
||||||
- component: {fileID: 2067192760}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: BG
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!212 &2067192760
|
|
||||||
SpriteRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2067192759}
|
|
||||||
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: -10
|
|
||||||
m_Sprite: {fileID: -7443756053782179069, guid: d0da55660b73232fcb2171dc7b78c64f, type: 3}
|
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
||||||
m_FlipX: 0
|
|
||||||
m_FlipY: 0
|
|
||||||
m_DrawMode: 0
|
|
||||||
m_Size: {x: 19.2, y: 10.8}
|
|
||||||
m_AdaptiveModeThreshold: 0.5
|
|
||||||
m_SpriteTileMode: 0
|
|
||||||
m_WasSpriteAssigned: 1
|
|
||||||
m_MaskInteraction: 0
|
|
||||||
m_SpriteSortPoint: 0
|
|
||||||
--- !u!4 &2067192761
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2067192759}
|
|
||||||
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!1 &2118842021
|
--- !u!1 &2118842021
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -9327,7 +9417,7 @@ SceneRoots:
|
||||||
- {fileID: 703943384}
|
- {fileID: 703943384}
|
||||||
- {fileID: 1824360583}
|
- {fileID: 1824360583}
|
||||||
- {fileID: 110796960}
|
- {fileID: 110796960}
|
||||||
- {fileID: 2067192761}
|
|
||||||
- {fileID: 1586737003}
|
- {fileID: 1586737003}
|
||||||
- {fileID: 1848761516}
|
- {fileID: 1848761516}
|
||||||
- {fileID: 2145483546}
|
- {fileID: 2145483546}
|
||||||
|
- {fileID: 809625460}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class CirnoFreezeDeflect : EnemyAbility
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void DeflectProjectiles()
|
protected void DeflectProjectiles()
|
||||||
{
|
{
|
||||||
GameManager.instance.deflections += projectilesInRange.Count;
|
GameManager.instance.deflections += projectilesInRange.Count;
|
||||||
foreach (Projectile projectile in projectilesAffected.ToArray())
|
foreach (Projectile projectile in projectilesAffected.ToArray())
|
||||||
|
|
|
||||||
64
Assets/Scripts/Abilities/CirnoIceBall.cs
Normal file
64
Assets/Scripts/Abilities/CirnoIceBall.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
using Core.Extensions;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class CirnoIceBall : EnemyAbility
|
||||||
|
{
|
||||||
|
[Header("Ice Ball")]
|
||||||
|
[SerializeField] private IceBall iceBall;
|
||||||
|
|
||||||
|
private IceBall iceballInstance;
|
||||||
|
[SerializeField] private float timeUntilShatter;
|
||||||
|
private float currentTimeOnSpawn;
|
||||||
|
[Header("Effects")]
|
||||||
|
[SerializeField] private float sweepDissipationTime;
|
||||||
|
private float currentDissipationTime;
|
||||||
|
[SerializeField] private GameObject swordSweepEffect;
|
||||||
|
protected override void AbilityEffects()
|
||||||
|
{
|
||||||
|
iceballInstance = ShootProjectile(iceBall, WaveManager.instance.GetRandomPlayerPoint(), iceBall.speed, false);
|
||||||
|
currentTimeOnSpawn = timeUntilShatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
if (currentTimeOnSpawn > 0)
|
||||||
|
{
|
||||||
|
currentTimeOnSpawn -= Time.deltaTime;
|
||||||
|
if (currentTimeOnSpawn <= 0)
|
||||||
|
{
|
||||||
|
transform.Lookat2D(WaveManager.instance.GetRandomPlayerPoint());
|
||||||
|
swordSweepEffect.SetActive(true);
|
||||||
|
currentDissipationTime = sweepDissipationTime;
|
||||||
|
iceballInstance.Shatter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentDissipationTime > 0)
|
||||||
|
{
|
||||||
|
currentDissipationTime -= Time.deltaTime;
|
||||||
|
if (currentDissipationTime <= 0)
|
||||||
|
{
|
||||||
|
swordSweepEffect.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private IceBall ShootProjectile(IceBall projectile, Vector3 location, float speed, bool aimed)
|
||||||
|
{
|
||||||
|
IceBall newProjectile = Instantiate(projectile, origin.position, Quaternion.identity);
|
||||||
|
Vector3 projectileDirection = location;
|
||||||
|
if (aimed)
|
||||||
|
{
|
||||||
|
projectileDirection = WaveManager.instance.GetRandomPlayerPoint();
|
||||||
|
}
|
||||||
|
newProjectile.transform.Lookat2D(projectileDirection);
|
||||||
|
newProjectile.damage = power;
|
||||||
|
newProjectile.tag = tag;
|
||||||
|
if (speed > 0f)
|
||||||
|
{
|
||||||
|
newProjectile.speed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newProjectile;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Abilities/CirnoIceBall.cs.meta
Normal file
2
Assets/Scripts/Abilities/CirnoIceBall.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fff9dc9791c039bc6b167721faff21d5
|
||||||
|
|
@ -1,21 +1,39 @@
|
||||||
|
using Core.Extensions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class EnemyAbility : Ability
|
public class EnemyAbility : Ability
|
||||||
{
|
{
|
||||||
[SerializeField] private float cooldownDelta;
|
[SerializeField] private float cooldownDelta;
|
||||||
[SerializeField] private bool willLookAtPlayer;
|
[SerializeField] private bool willLookAtPlayer;
|
||||||
protected virtual void Start()
|
protected virtual void Start()
|
||||||
{
|
{
|
||||||
cooldown += Random.Range(-cooldownDelta, cooldownDelta);
|
cooldown += Random.Range(-cooldownDelta, cooldownDelta);
|
||||||
currentCooldown = Random.Range(0, cooldown);
|
currentCooldown = Random.Range(0, cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TryAbility()
|
public override bool TryAbility()
|
||||||
{
|
{
|
||||||
if (willLookAtPlayer)
|
if (willLookAtPlayer)
|
||||||
{
|
{
|
||||||
direction = WaveManager.instance.GetRandomPlayerPoint();
|
direction = WaveManager.instance.GetRandomPlayerPoint();
|
||||||
}
|
transform.Lookat2D(direction);
|
||||||
return base.TryAbility();
|
}
|
||||||
}
|
return base.TryAbility();
|
||||||
|
}
|
||||||
|
public void ShootProjectile(Projectile projectile, Vector3 location, float speed, bool aimed)
|
||||||
|
{
|
||||||
|
Projectile newProjectile = Instantiate(projectile, origin.position, Quaternion.identity);
|
||||||
|
Vector3 projectileDirection = location;
|
||||||
|
if (aimed)
|
||||||
|
{
|
||||||
|
projectileDirection = WaveManager.instance.GetRandomPlayerPoint();
|
||||||
|
}
|
||||||
|
newProjectile.transform.Lookat2D(projectileDirection);
|
||||||
|
newProjectile.damage = power;
|
||||||
|
newProjectile.tag = tag;
|
||||||
|
if (speed > 0f)
|
||||||
|
{
|
||||||
|
newProjectile.speed = speed;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -46,23 +46,6 @@ public class EnemyBulletPattern : EnemyAbility
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShootProjectile(Projectile projectile, Vector3 location, float speed, bool aimed)
|
|
||||||
{
|
|
||||||
Projectile newProjectile = Instantiate(projectile, origin.position, Quaternion.identity);
|
|
||||||
Vector3 projectileDirection = location;
|
|
||||||
if (aimed)
|
|
||||||
{
|
|
||||||
projectileDirection = WaveManager.instance.GetRandomPlayerPoint();
|
|
||||||
}
|
|
||||||
newProjectile.transform.Lookat2D(projectileDirection);
|
|
||||||
newProjectile.damage = power;
|
|
||||||
newProjectile.tag = tag;
|
|
||||||
if (speed > 0f)
|
|
||||||
{
|
|
||||||
newProjectile.speed = speed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private IEnumerator BurstFire(ProjectileDirection projectile, int burstCount, float burstDelay)
|
private IEnumerator BurstFire(ProjectileDirection projectile, int burstCount, float burstDelay)
|
||||||
{
|
{
|
||||||
int currentCount = 0;
|
int currentCount = 0;
|
||||||
|
|
|
||||||
52
Assets/Scripts/Abilities/OrinMoveAndSpawn.cs
Normal file
52
Assets/Scripts/Abilities/OrinMoveAndSpawn.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
using System.Collections;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class OrinMoveAndSpawn : EnemyAbility
|
||||||
|
{
|
||||||
|
[SerializeField] private Enemy ghostFairy;
|
||||||
|
[SerializeField] private int fairiesToSpawn;
|
||||||
|
private int currentFairiesLeft;
|
||||||
|
[SerializeField] private int variance;
|
||||||
|
[SerializeField] private Enemy thisEnemy;
|
||||||
|
[SerializeField] private float moveSpeed;
|
||||||
|
protected override void AbilityEffects()
|
||||||
|
{
|
||||||
|
base.AbilityEffects();
|
||||||
|
currentFairiesLeft = fairiesToSpawn + Random.Range(-variance, variance);
|
||||||
|
thisEnemy.preventWobble = true;
|
||||||
|
thisEnemy.isStalled = true;
|
||||||
|
StartCoroutine(MoveToPosition(transform.position, WaveManager.instance.GetRandomEnemyPoint(), moveSpeed));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator MoveToPosition(Vector3 enemyOrigin, Vector3 moveDirection, float lerpSpeed)
|
||||||
|
{
|
||||||
|
float currentMovement = 0;
|
||||||
|
while (currentMovement < 1)
|
||||||
|
{
|
||||||
|
currentMovement += Time.deltaTime * lerpSpeed;
|
||||||
|
if (currentMovement >= 1)
|
||||||
|
{
|
||||||
|
SpawnGhostFairy();
|
||||||
|
}
|
||||||
|
thisEnemy.transform.position = Vector3.Lerp(enemyOrigin, moveDirection, currentMovement);
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SpawnGhostFairy()
|
||||||
|
{
|
||||||
|
Enemy newEnemy = Instantiate(ghostFairy, WaveManager.instance.enemyFolder);
|
||||||
|
newEnemy.originalPosition = transform.position;
|
||||||
|
WaveManager.instance.enemiesInPlay.Add(newEnemy);
|
||||||
|
if (currentFairiesLeft > 0)
|
||||||
|
{
|
||||||
|
currentFairiesLeft--;
|
||||||
|
StartCoroutine(MoveToPosition(transform.position, WaveManager.instance.GetRandomEnemyPoint(), moveSpeed));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thisEnemy.preventWobble = false;
|
||||||
|
thisEnemy.isStalled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Abilities/OrinMoveAndSpawn.cs.meta
Normal file
2
Assets/Scripts/Abilities/OrinMoveAndSpawn.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49a49f9644919e6ebb5aa8f30adbd9e4
|
||||||
|
|
@ -73,6 +73,7 @@ public class DialogueManager : MonoBehaviour
|
||||||
dialogueActive = false;
|
dialogueActive = false;
|
||||||
dialogueUI.SetActive(false);
|
dialogueUI.SetActive(false);
|
||||||
WaveManager.instance.player.isStalled = false;
|
WaveManager.instance.player.isStalled = false;
|
||||||
|
WaveManager.instance.player.invulnerable = false;
|
||||||
WaveManager.instance.bossInstance.isStalled = false;
|
WaveManager.instance.bossInstance.isStalled = false;
|
||||||
//GameManager.instance.SetPause(false);
|
//GameManager.instance.SetPause(false);
|
||||||
reisenAnimator.SetTrigger(switchToIdleTrigger);
|
reisenAnimator.SetTrigger(switchToIdleTrigger);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ public class Enemy : Entity
|
||||||
{
|
{
|
||||||
private Ability abilitySelected;
|
private Ability abilitySelected;
|
||||||
public SpriteRenderer sprite;
|
public SpriteRenderer sprite;
|
||||||
private float currentState = 1;
|
|
||||||
public float colorChangeSpeed;
|
public float colorChangeSpeed;
|
||||||
[Header("Movement")]
|
[Header("Movement")]
|
||||||
public float moveSpeed;
|
public float moveSpeed;
|
||||||
|
|
@ -66,9 +65,8 @@ public class Enemy : Entity
|
||||||
abilitySelected = freeAbilities[Random.Range(0, freeAbilities.Count)];
|
abilitySelected = freeAbilities[Random.Range(0, freeAbilities.Count)];
|
||||||
}
|
}
|
||||||
bool success = abilitySelected.TryAbility();
|
bool success = abilitySelected.TryAbility();
|
||||||
if (!success && abilitySelected.currentCooldown <= 0.5f && currentState >= 1f)
|
if (!success && abilitySelected.currentCooldown <= 0.5f)
|
||||||
{
|
{
|
||||||
currentState = 0f;
|
|
||||||
StartCoroutine(ImminentAttackAnim());
|
StartCoroutine(ImminentAttackAnim());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -108,6 +106,7 @@ public class Enemy : Entity
|
||||||
|
|
||||||
private IEnumerator ImminentAttackAnim()
|
private IEnumerator ImminentAttackAnim()
|
||||||
{
|
{
|
||||||
|
float currentState = 0;
|
||||||
while (currentState < 1)
|
while (currentState < 1)
|
||||||
{
|
{
|
||||||
currentState += Time.deltaTime * colorChangeSpeed;
|
currentState += Time.deltaTime * colorChangeSpeed;
|
||||||
|
|
|
||||||
11
Assets/Scripts/Projectiles/IceBall.cs
Normal file
11
Assets/Scripts/Projectiles/IceBall.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class IceBall : Projectile
|
||||||
|
{
|
||||||
|
[SerializeField] private EnemyBulletPattern pattern;
|
||||||
|
public void Shatter()
|
||||||
|
{
|
||||||
|
pattern.TryAbility();
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Projectiles/IceBall.cs.meta
Normal file
2
Assets/Scripts/Projectiles/IceBall.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 79ca09c8408e601d7ba18c2cb6204375
|
||||||
|
|
@ -2,15 +2,9 @@ using UnityEngine;
|
||||||
|
|
||||||
public class SpinEffect : MonoBehaviour
|
public class SpinEffect : MonoBehaviour
|
||||||
{
|
{
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
[SerializeField] private float rotationSpeed;
|
||||||
void Start()
|
void Update()
|
||||||
{
|
{
|
||||||
|
transform.Rotate(Vector3.forward, rotationSpeed * Time.deltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +126,7 @@ public class WaveManager : MonoBehaviour
|
||||||
bossDescriptionUI.text = waveList[wave - 1].bossDescription;
|
bossDescriptionUI.text = waveList[wave - 1].bossDescription;
|
||||||
UpdateBossUI();
|
UpdateBossUI();
|
||||||
player.isStalled = true; //wait for boss to enter then start dialogue
|
player.isStalled = true; //wait for boss to enter then start dialogue
|
||||||
|
player.invulnerable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Enemy SpawnEnemy(Enemy enemy)
|
public Enemy SpawnEnemy(Enemy enemy)
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable:
|
||||||
|
GRReisenPort_0: 4468062175109948465
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable:
|
||||||
|
Th105Youmu_0: 8559990530630230403
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,8 @@ TextureImporter:
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
spriteCustomMetadata:
|
spriteCustomMetadata:
|
||||||
entries: []
|
entries: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable:
|
||||||
|
reallybadswordslash_0: 227286115079703930
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue