MoveTo() private method

private MoveTo ( Vector2 endLocation ) : IEnumerator
endLocation Vector2
return IEnumerator
示例#1
0
        private void Seek()
        {
            var target = radar.Contacts.OfType <Resource>()
                         .Where(r => r.Value > 0)
                         .MinBy(r => (transform.position - r.transform.position).sqrMagnitude);

            if (target != null)
            {
                mover.MoveTo(target);
            }
            else
            {
                Transition(State.Idle);
            }
        }