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,21 +1,39 @@
|
|||
using Core.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnemyAbility : Ability
|
||||
{
|
||||
[SerializeField] private float cooldownDelta;
|
||||
[SerializeField] private bool willLookAtPlayer;
|
||||
protected virtual void Start()
|
||||
{
|
||||
cooldown += Random.Range(-cooldownDelta, cooldownDelta);
|
||||
currentCooldown = Random.Range(0, cooldown);
|
||||
}
|
||||
[SerializeField] private float cooldownDelta;
|
||||
[SerializeField] private bool willLookAtPlayer;
|
||||
protected virtual void Start()
|
||||
{
|
||||
cooldown += Random.Range(-cooldownDelta, cooldownDelta);
|
||||
currentCooldown = Random.Range(0, cooldown);
|
||||
}
|
||||
|
||||
public override bool TryAbility()
|
||||
{
|
||||
if (willLookAtPlayer)
|
||||
{
|
||||
direction = WaveManager.instance.GetRandomPlayerPoint();
|
||||
}
|
||||
return base.TryAbility();
|
||||
}
|
||||
}
|
||||
public override bool TryAbility()
|
||||
{
|
||||
if (willLookAtPlayer)
|
||||
{
|
||||
direction = WaveManager.instance.GetRandomPlayerPoint();
|
||||
transform.Lookat2D(direction);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue