static void Gizmos_EditNone_Sphere(Transform t, ProxyVolume d, ProxyVolumeUI s, Object o)
        {
            var mat = Gizmos.matrix;

            Gizmos.matrix = t.localToWorldMatrix;

            Gizmos.color = k_GizmoThemeColorProjection;
            Gizmos.DrawWireSphere(d.sphereOffset, d.sphereRadius);

            Gizmos.matrix = mat;
        }
        static void Gizmos_EditNone_Box(Transform t, ProxyVolume d, ProxyVolumeUI s, Object o)
        {
            var mat = Gizmos.matrix;

            Gizmos.matrix = t.localToWorldMatrix;

            Gizmos.color = k_GizmoThemeColorProjection;
            Gizmos.DrawWireCube(d.boxOffset, d.boxSize);

            Gizmos.matrix = mat;
        }
        static void Gizmos_EditNone_Box(Transform t, ProxyVolume d, ProxyVolumeUI s, Object o)
        {
            var mat = Gizmos.matrix;

            Gizmos.matrix = Matrix4x4.TRS(t.position, t.rotation, Vector3.one);

            Gizmos.color = k_GizmoThemeColorProjection;
            Gizmos.DrawWireCube(Vector3.zero, d.boxSize);

            Gizmos.matrix = mat;
        }
Esempio n. 4
0
        static void Handles_EditBase_Box(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI s, Object sourceAsset)
        {
            s.boxProjectionHandle.center = Vector3.zero;
            s.boxProjectionHandle.size   = proxyVolume.boxSize;

            Matrix4x4 mat = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);

            EditorGUI.BeginChangeCheck();
            using (new Handles.DrawingScope(k_GizmoThemeColorProjection, mat))
            {
                s.boxProjectionHandle.DrawHandle();
            }
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Projection Volume AABB");

                proxyVolume.boxSize = s.boxProjectionHandle.size;

                //the gizmo is not an object of the scene. Flag it as dirty
                EditorUtility.SetDirty(sourceAsset);
            }
        }
Esempio n. 5
0
        public static void DrawHandles_EditBase(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI ui, Object sourceAsset)
        {
            switch (proxyVolume.shape)
            {
            case ProxyShape.Box:
                Handles_EditBase_Box(transform, proxyVolume, ui, sourceAsset);
                break;

            case ProxyShape.Sphere:
                Handles_EditBase_Sphere(transform, proxyVolume, ui, sourceAsset);
                break;
            }
        }
Esempio n. 6
0
 static void Drawer_SectionShapeSphere(ProxyVolumeUI s, SerializedProxyVolume d, Editor o)
 {
     EditorGUILayout.PropertyField(d.sphereRadius, sphereRadiusContent);
 }
Esempio n. 7
0
 static void Drawer_SectionShapeBox(ProxyVolumeUI s, SerializedProxyVolume d, Editor o)
 {
     EditorGUILayout.PropertyField(d.boxSize, boxSizeContent);
 }
Esempio n. 8
0
 static void Drawer_FieldShapeType(ProxyVolumeUI s, SerializedProxyVolume d, Editor o)
 {
     EditorGUILayout.PropertyField(d.shape, shapeContent);
 }
 static void Drawer_SectionShapeSphere(ProxyVolumeUI s, SerializedProxyVolume d, Editor o)
 {
     EditorGUILayout.PropertyField(d.sphereRadius, _.GetContent("Sphere Radius"));
     EditorGUILayout.PropertyField(d.sphereOffset, _.GetContent("Sphere Offset"));
     EditorGUILayout.PropertyField(d.sphereInfiniteProjection, _.GetContent("Infinite Projection"));
 }
 static void Drawer_SectionShapeBox(ProxyVolumeUI s, SerializedProxyVolume d, Editor o)
 {
     EditorGUILayout.PropertyField(d.boxSize, _.GetContent("Box Size"));
     EditorGUILayout.PropertyField(d.boxOffset, _.GetContent("Box Offset"));
     EditorGUILayout.PropertyField(d.boxInfiniteProjection, _.GetContent("Infinite Projection"));
 }
        public static void DrawGizmos_EditNone(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI ui, Object sourceAsset)
        {
            switch (proxyVolume.shapeType)
            {
            case ShapeType.Box:
                Gizmos_EditNone_Box(transform, proxyVolume, ui, sourceAsset);
                break;

            case ShapeType.Sphere:
                Gizmos_EditNone_Sphere(transform, proxyVolume, ui, sourceAsset);
                break;
            }
        }
        static void Handles_EditBase_Box(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI s, Object sourceAsset)
        {
            s.boxProjectionHandle.center = proxyVolume.boxOffset;
            s.boxProjectionHandle.size   = proxyVolume.boxSize;

            var mat = Handles.matrix;

            Handles.matrix = transform.localToWorldMatrix;

            Handles.color = k_GizmoThemeColorProjection;
            EditorGUI.BeginChangeCheck();
            s.boxProjectionHandle.DrawHandle();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Projection Volume AABB");

                proxyVolume.boxOffset = s.boxProjectionHandle.center;
                proxyVolume.boxSize   = s.boxProjectionHandle.size;

                EditorUtility.SetDirty(sourceAsset);
            }

            Handles.matrix = mat;
        }
 public static void DrawHandles_EditNone(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI ui, Object sourceAsset)
 {
 }
 public static void DrawGizmos_EditNone(ReflectionProxyVolumeComponentUI ui, ReflectionProxyVolumeComponent target)
 {
     ProxyVolumeUI.DrawGizmos_EditNone(target.transform, target.proxyVolume, ui.proxyVolume, target);
 }
        static void Handles_EditBase_Box(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI s, Object sourceAsset)
        {
            s.boxProjectionHandle.center = Vector3.zero;
            s.boxProjectionHandle.size   = proxyVolume.boxSize;

            var mat = Handles.matrix;

            Handles.matrix = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);

            Handles.color = k_GizmoThemeColorProjection;
            EditorGUI.BeginChangeCheck();
            s.boxProjectionHandle.DrawHandle();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Projection Volume AABB");

                proxyVolume.boxSize = s.boxProjectionHandle.size;

                EditorUtility.SetDirty(sourceAsset);
            }

            Handles.matrix = mat;
        }
Esempio n. 16
0
        static void Handles_EditBase_Sphere(Transform transform, ProxyVolume proxyVolume, ProxyVolumeUI s, Object sourceAsset)
        {
            s.sphereProjectionHandle.center = Vector3.zero;
            s.sphereProjectionHandle.radius = proxyVolume.sphereRadius;

            var mat = Handles.matrix;

            Handles.matrix = transform.localToWorldMatrix;
            Handles.color  = k_GizmoThemeColorProjection;
            EditorGUI.BeginChangeCheck();
            s.sphereProjectionHandle.DrawHandle();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Projection Volume");

                proxyVolume.sphereRadius = s.sphereProjectionHandle.radius;

                EditorUtility.SetDirty(sourceAsset);
            }
            Handles.matrix = mat;
        }