Esempio n. 1
0
 private void DrawLinkSettings(Rect rect, Event e)
 {
     if (GuiHelper.Button(rect, Styles.icon_style_linked, Styles.COLOR_ICON_ACTIVE_CYAN, MaterialLinker.IsLinked(ShaderEditor.active.currentProperty.materialProperty)))
     {
         ShaderEditor.input.Use();
         List <Material> linked_materials = MaterialLinker.GetLinked(ShaderEditor.active.currentProperty.materialProperty);
         MaterialLinker.Popup(rect, linked_materials, ShaderEditor.active.currentProperty.materialProperty);
     }
 }
        private void DrawLinkSettings(Rect rect, Event e)
        {
            Rect buttonRect = new Rect(rect);

            buttonRect.width   = 20;
            buttonRect.x      += rect.width - 45;
            buttonRect.y      += 1;
            buttonRect.height -= 4;
            List <Material> linked_materials = MaterialLinker.GetLinked(ThryEditor.currentlyDrawing.currentProperty.materialProperty);
            Texture2D       icon             = Styles.inactive_link_icon;

            if (linked_materials != null)
            {
                icon = Styles.active_link_icon;
            }
            if (GUI.Button(buttonRect, icon, EditorStyles.largeLabel))
            {
                MaterialLinker.Popup(buttonRect, linked_materials, ThryEditor.currentlyDrawing.currentProperty.materialProperty);
                e.Use();
            }
        }