Пример #1
0
    public void UpdateInternal(List <FlockEntity> nearby, Vector3 target)
    {
        Vector3 steer = m_Steering.Calc(this, nearby, target);

        Vector3 accel = steer / m_Mass;

        m_Velocity += accel * Time.deltaTime;

        Vector3.ClampMagnitude(m_Velocity, m_MaxSpeed);

        RotateHeadingToFacePosition(transform.position + m_Velocity);
        transform.position += m_Velocity.magnitude * Heading * Time.deltaTime;
    }