Exemple #1
0
        public override void DrawDefault()
        {
            Rect pos = GUILayoutUtility.GetRect(content, Styles.vectorPropertyStyle);

            GuiHelper.drawConfigTextureProperty(pos, materialProperty, content, ShaderEditor.currentlyDrawing.editor, hasFoldoutProperties);
            DrawingData.lastGuiObjectHeaderRect = pos;
        }
Exemple #2
0
        public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
        {
            ShaderProperty shaderProperty = (ShaderProperty)ShaderEditor.currentlyDrawing.currentProperty;

            GuiHelper.drawConfigTextureProperty(position, prop, label, editor, true, true);

            string n = "";

            if (prop.textureValue != null)
            {
                n = prop.textureValue.name;
            }
            if ((ShaderEditor.input.is_drag_drop_event) && position.Contains(ShaderEditor.input.mouse_position))
            {
                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
                if (ShaderEditor.input.is_drop_event)
                {
                    DragAndDrop.AcceptDrag();
                    HanldeDropEvent(prop, shaderProperty);
                }
            }
            if (ShaderEditor.currentlyDrawing.firstCall)
            {
                ShaderEditor.currentlyDrawing.textureArrayProperties.Add(shaderProperty);
            }
        }
        public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
        {
            GuiHelper.drawConfigTextureProperty(position, prop, label, editor, true);

            string n = "";

            if (prop.textureValue != null)
            {
                n = prop.textureValue.name;
            }
            if (Event.current.type == EventType.DragExited && position.Contains(ThryEditor.lastDragPosition))
            {
                string[] paths = DragAndDrop.paths;
                if (AssetDatabase.GetMainAssetTypeAtPath(paths[0]) != typeof(Texture2DArray))
                {
                    Texture2DArray tex = Converter.PathsToTexture2DArray(paths);
                    Helper.UpdateTargetsValue(prop, tex);
                    if (ThryEditor.currentlyDrawing.currentProperty.options.reference_property != null)
                    {
                        ThryEditor.ShaderProperty p;
                        ThryEditor.currentlyDrawing.propertyDictionary.TryGetValue(ThryEditor.currentlyDrawing.currentProperty.options.reference_property, out p);
                        if (p != null)
                        {
                            Helper.UpdateTargetsValue(p.materialProperty, tex.depth);
                        }
                    }
                    prop.textureValue = tex;
                }
            }
            if (ThryEditor.currentlyDrawing.firstCall)
            {
                ThryEditor.currentlyDrawing.textureArrayProperties.Add((ThryEditor.ShaderProperty)ThryEditor.currentlyDrawing.currentProperty);
            }
        }
Exemple #4
0
 public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
 {
     GuiHelper.drawConfigTextureProperty(position, prop, label, editor, ((TextureProperty)ShaderEditor.active.currentProperty).hasScaleOffset);
     GuiHelper.sRGBWarning(prop);
 }