Created
October 23, 2019 14:59
-
-
Save lindsaygcox/7a9ea2e09e515d4c11b78ea987cf4d2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.AI; | |
public enum EnemyState | |
{ | |
Chase, | |
Attack | |
} | |
public sealed class EnemyData : MonoBehaviour | |
{ | |
public Vector3 Position => transform.position; | |
public float Speed; | |
public float Health; | |
public NavMeshAgent NavMeshAgent; | |
public EnemyState EnemyState { private set; get; } = EnemyState.Chase; | |
public void SetState(EnemyState enemyState) | |
{ | |
EnemyState = enemyState; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment