public override void StartAI() { ActorProxy.lastRecieved = null; ActorProxy.EnablePathfinding(true); ActorProxy._aiPath.isStopped = true; if (_ai != null) { return; } _ai = StartCoroutine(Root()); }
public override void StopAI() { ActorProxy.EnablePathfinding(false); base.StopAI(); if (_ai == null) { return; } StopCoroutine(_ai); _ai = null; }
protected void ApproachToTarget() { if (target == null) { return; } if (target.ActorProxy == null) { return; } if (ActorProxy == null) { return; } ActorProxy.EnablePathfinding(true); Vector3 targetPos = target.ActorProxy.transform.position + (ActorProxy.transform.position - target.ActorProxy.transform.position).normalized * target.Radius; ActorProxy._aiPath.destination = targetPos; }