static void Gizmos_Influence(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, bool isEdit)
        {
            var col = Gizmos.color;
            var mat = Gizmos.matrix;

            Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p);
            switch (a.influenceShape)
            {
            case ShapeType.Box:
            {
                Gizmos.color = k_GizmoThemeColorExtentFace;
                e.m_UIState.alternativeBoxInfluenceHandle.DrawHull(isEdit);
                break;
            }

            case ShapeType.Sphere:
            {
                Gizmos.color = k_GizmoThemeColorExtentFace;
                if (isEdit)
                {
                    Gizmos.DrawSphere(p.center, a.influenceSphereRadius);
                }
                else
                {
                    Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius);
                }
                break;
            }
            }

            Gizmos.matrix = mat;
            Gizmos.color  = col;
        }
Esempio n. 2
0
 static void PerformOperations(HDReflectionProbeUI s, SerializedHDReflectionProbe p, HDReflectionProbeEditor o)
 {
 }
        static void Gizmos_InfluenceFade(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, InfluenceType type, bool isEdit)
        {
            var col = Gizmos.color;
            var mat = Gizmos.matrix;

            Gizmo6FacesBoxContained box;
            Vector3 boxCenterOffset;
            Vector3 boxSizeOffset;
            float   sphereRadiusOffset;
            Color   color;

            switch (type)
            {
            default:
            case InfluenceType.Standard:
            {
                box                = e != null ? e.m_UIState.alternativeBoxBlendHandle : null;
                boxCenterOffset    = a.boxBlendCenterOffset;
                boxSizeOffset      = a.boxBlendSizeOffset;
                sphereRadiusOffset = a.sphereBlendRadiusOffset;
                color              = isEdit ? k_GizmoThemeColorInfluenceBlendFace : k_GizmoThemeColorInfluenceBlend;
                break;
            }

            case InfluenceType.Normal:
            {
                box                = e != null ? e.m_UIState.alternativeBoxBlendNormalHandle : null;
                boxCenterOffset    = a.boxBlendNormalCenterOffset;
                boxSizeOffset      = a.boxBlendNormalSizeOffset;
                sphereRadiusOffset = a.sphereBlendNormalRadiusOffset;
                color              = isEdit ? k_GizmoThemeColorInfluenceNormalBlendFace : k_GizmoThemeColorInfluenceNormalBlend;
                break;
            }
            }

            Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p);
            switch (a.influenceShape)
            {
            case ShapeType.Box:
            {
                Gizmos.color = color;
                if (e != null)        // e == null may occure when editor have still not been created at selection while the tool is not used for this part
                {
                    box.DrawHull(isEdit);
                }
                else
                {
                    if (isEdit)
                    {
                        Gizmos.DrawCube(p.center + boxCenterOffset, p.size + boxSizeOffset);
                    }
                    else
                    {
                        Gizmos.DrawWireCube(p.center + boxCenterOffset, p.size + boxSizeOffset);
                    }
                }
                break;
            }

            case ShapeType.Sphere:
            {
                Gizmos.color = color;
                if (isEdit)
                {
                    Gizmos.DrawSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset);
                }
                else
                {
                    Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset);
                }
                break;
            }
            }

            Gizmos.matrix = mat;
            Gizmos.color  = col;
        }