Search Unity

[HELP] Including "Editor Default Resources" for Asset Publishing

Discussion in 'Editor & General Support' started by PrisonerOfLies, Jul 20, 2014.

  1. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105


    as you can see, only 1 folder can be selected from the Asset folder menu.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    What does your app need from editor default resources? I think the assumption is that every editor has these resources available to them.
     
  3. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
    textures that i used in the editor scripts have to be in the special folder "Editor Default Resources"
     
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Well, any textures that are meant to be in Editor Default Resources will be there by default when Unity is installed. You're not meant to modify/change that.
     
  5. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
    I am sorry, your reply doesn't make any sense to me..
    I am using a custom texture, drawn by myself to be used in my custom editor inspector script. Unity only allows textures that are to be used in the editor to be in that special folder. My problem is : Shipping an asset to the asset store can only take in 1 folder. Due to the fact that this special folder have to be in the root folder of "Assets", there is only 2 options to submit my asset to the store.

    1) I export the 2 folder as unity package, and submit the package
    2) I submit the "Assets" folder.
     
  6. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    @graham I think PrisonerOfLies is talking about the folder that has to be added in order to use your own stuff with http://docs.unity3d.com/ScriptReference/EditorGUIUtility.Load.html. The documentation says that it has to be in Assets/Editor Default Resources; he wants to make a package for the Asset Store that uses this folder, but he can only submit one top-level folder. (I haven't used the Asset Store tools myself, is it not possible to just submit the entire Assets directory, just making sure you have no extra stuff other than what should be in your package?)

    I'm not sure if there's any other safe way to get access to a texture in the editor that wouldn't require the Editor Default Resources folder, but you could try http://docs.unity3d.com/ScriptReference/AssetDatabase.LoadAssetAtPath.html. Since your top-level folder has to have some particular name you can just make the assumption about what the path will be. It's just potentially problematic since the user could move the folder around after importing the package, and then it would no longer work.
     
  7. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Ah, okay, so you're talking about a *folder* called Editor Default Resources. Just include it inside the folder you package up, and include a read me that explains that folder needs to be moved. Or have some editor script that runs and looks for the texture in the Editor Default Resources folder, and copy it from your folder if it isn't found.
     
  8. PrisonerOfLies

    PrisonerOfLies

    Joined:
    Dec 6, 2013
    Posts:
    105
    ok i will give your suggestion a shot.
     
  9. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    Graham's approach above is terrible. If you are copying resources OUT of Editor Default Resources, then there is no poiint in using it in the first place. Or ..if your asset DOES NOT WORK out of the box because the user has to manually move folders ... that is simply inexcusable.

    Instead, ignore "Editor Default Resources" (until someone at Unity fixes the 5+ years old bug that this folder doesn't work properly; docs say you can use Editor/Resources instead, but that has never worked if I remember correctly), and manually load your assets using: AssetDatabase.LoadAssetAtPath<..>( ... ). Works fine.

    ...and, unlike Editor Default Resources, it's compatible with Unity's own AssetStore :).
     
    zwcloud, SDriver and Pecek like this.
  10. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    137
    zwcloud and Pecek like this.