Exemplo n.º 1
0
        public void Update()
        {
            if (Path != null)
            {
                if (Vector3.Distance(transform.position, m_target) < TargetAcceptDistance)
                {
                    Path?.GetNextTarget(ref m_target, out Path);
                }
            }
            Vector3 velocity = m_rigidBody.velocity;

            Vector3.SmoothDamp(transform.position, m_target, ref velocity, MoveSmoothTime, MaxSpeed);
            m_rigidBody.velocity = velocity;
        }