Skip to content

Instantly share code, notes, and snippets.

@lindsaygcox
Created October 23, 2019 14:59
Show Gist options
  • Save lindsaygcox/7a9ea2e09e515d4c11b78ea987cf4d2f to your computer and use it in GitHub Desktop.
Save lindsaygcox/7a9ea2e09e515d4c11b78ea987cf4d2f to your computer and use it in GitHub Desktop.
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