add scripts from post-scale attempt
This commit is contained in:
parent
96dcfa9064
commit
87383d5b8c
18 changed files with 362 additions and 148 deletions
|
|
@ -8,7 +8,6 @@ public class Enemy : Entity
|
|||
{
|
||||
private Ability abilitySelected;
|
||||
public SpriteRenderer sprite;
|
||||
private float currentState = 1;
|
||||
public float colorChangeSpeed;
|
||||
[Header("Movement")]
|
||||
public float moveSpeed;
|
||||
|
|
@ -66,9 +65,8 @@ public class Enemy : Entity
|
|||
abilitySelected = freeAbilities[Random.Range(0, freeAbilities.Count)];
|
||||
}
|
||||
bool success = abilitySelected.TryAbility();
|
||||
if (!success && abilitySelected.currentCooldown <= 0.5f && currentState >= 1f)
|
||||
if (!success && abilitySelected.currentCooldown <= 0.5f)
|
||||
{
|
||||
currentState = 0f;
|
||||
StartCoroutine(ImminentAttackAnim());
|
||||
}
|
||||
else
|
||||
|
|
@ -108,6 +106,7 @@ public class Enemy : Entity
|
|||
|
||||
private IEnumerator ImminentAttackAnim()
|
||||
{
|
||||
float currentState = 0;
|
||||
while (currentState < 1)
|
||||
{
|
||||
currentState += Time.deltaTime * colorChangeSpeed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue