Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Asset store item has "Resources" folder containing UI buttons for inspector GUIs

Discussion in 'Editor & General Support' started by ArachnidAnimal, Jan 6, 2018.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    I'm using one asset that a class which generates an inspector GUI.

    public class Generator_Inspector: Editor {
    ...
    Texture _saveIcon = Resources.Load("UI/save@0.5x", typeof (Texture)) as Texture;
    }

    Am I wrong in thinking that these UI button images should not be in a folder called "Resources"?
    They would be included in the build, wouldn't they?
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,504
    I think if it's under an Editor folder as well (can't tell from that code alone) then it won't be included in a build. Still, I'm 99% certain that there's a documented way to load icons in the Editor, and that isn't it, and the documented best practices are pretty clear about not using Resources folders, so I agree this stuff shouldn't be let through to the Asset Store.
     
    zombiegorilla likes this.
  3. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,956
    Resources folder for editor stuff is just fine, really the most practical way to do it. As the penguin said, it should be Editor/Resources to exclude from build. If it’s not you can move it there.
     
    ArachnidAnimal and angrypenguin like this.
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,504
    zombiegorilla and ArachnidAnimal like this.