怪物的近战和远程攻击方式脚本:
public enum Type { Melee, Range, Boss }//设置敌人的类型 {近程怪,远程怪,BOSS}
public Type enemyType;
public Transform target;//获取要攻击的对象
public BoxCollider meleeArea;//盒碰撞器,可以设置触发机制
public GameObject bullet;//远程怪使用攻击的物体
protected Rigidbody _rigidbody;//刚体组件
protected NavMeshAgent _navMeshAgent;//导航网络代理组件
protected Animator _animator;//动画组件
protected Health _health;//敌人状态脚本
private float _targetRadius;//半径
private float _targetRange;//范围
private bool _isChase;//是否在寻找玩家
private bool _isAttack;//是否攻击
private