Пример #1
0
    // draws shapes on screen inside the Unity Editor
    private void OnDrawGizmos()
    {
        if (_navigation != null)
        {
            _navigation.DrawGizmos();
        }

        // draw center of mass
        Gizmos.color = Color.Lerp(Color.yellow, Color.clear, 0.25f);
        if (Application.isPlaying)
        {
            Gizmos.DrawSphere(rigidbody.worldCenterOfMass, 0.05f);
        }
        else
        {
            Gizmos.DrawSphere(rigidbody.worldCenterOfMass + centerOfMassOffset, 0.05f);
        }
    }