You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
484 B
28 lines
484 B
using System; |
|
using Enemies.States; |
|
|
|
namespace Enemies |
|
{ |
|
public class BaseEnemy :Enemy |
|
{ |
|
private void Awake() |
|
{ |
|
state = new IdleState(this); |
|
} |
|
|
|
private void Update() |
|
{ |
|
HandleStates(); |
|
state.Execute(); |
|
} |
|
|
|
private void HandleStates() |
|
{ |
|
if (health <= 0) |
|
{ |
|
state = new DieState(this); |
|
return; |
|
} |
|
} |
|
} |
|
} |