20 lines
564 B
C#
20 lines
564 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Saltosion.OneWeapon.AI {
|
|
[Obsolete]
|
|
[RequireComponent(typeof(AI.Behaviours.Follow), typeof(AI.Triggers.EnemySighted))]
|
|
public class EnemyFollower : MonoBehaviour {
|
|
public AI.Behaviours.Follow Follow;
|
|
public AI.Triggers.EnemySighted EnemySighted;
|
|
|
|
private void Update() {
|
|
if (EnemySighted.ClosestEnemy == null) {
|
|
Follow.Target = null;
|
|
} else {
|
|
Follow.Target = EnemySighted.ClosestEnemy.transform;
|
|
}
|
|
}
|
|
}
|
|
}
|