コード例 #1
0
ファイル: Minion.AI.cs プロジェクト: robin1392/robin
        public override void StartAI()
        {
            ActorProxy.lastRecieved = null;
            ActorProxy.EnablePathfinding(true);
            ActorProxy._aiPath.isStopped = true;
            if (_ai != null)
            {
                return;
            }

            _ai = StartCoroutine(Root());
        }
コード例 #2
0
ファイル: Minion.AI.cs プロジェクト: robin1392/robin
        public override void StopAI()
        {
            ActorProxy.EnablePathfinding(false);

            base.StopAI();

            if (_ai == null)
            {
                return;
            }

            StopCoroutine(_ai);
            _ai = null;
        }
コード例 #3
0
ファイル: Minion.AI.cs プロジェクト: robin1392/robin
        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;
        }