protected override void UpdateTarget() { base.UpdateTarget(); if (NPCinfo.target == null) { if (CompareTag("Ally")) { TryNewTarget(NPCList.NearestAllEnemy(center)); } if (CompareTag("Enemy")) { TryNewTarget(NPCList.NearestAllAlly(center)); } } else if (NPCinfo.target.target != NPCinfo) { if (CompareTag("Ally")) { TryNewTarget(NPCList.NearestFreeEnemy(center)); } if (CompareTag("Enemy")) { TryNewTarget(NPCList.NearestFreeAlly(center)); } } }
protected override void UpdateTarget() { if (NPCinfo.target == null) { if (CompareTag("Ally")) { TryNewTarget(NPCList.NearestFreeEnemy(transform)); } if (CompareTag("Enemy")) { TryNewTarget(NPCList.NearestFreeAlly(transform)); } } base.UpdateTarget(); }