Search Unity

About these special folders in unity3d ! Assets Editor Resources Plugins and so on

Discussion in 'Editor & General Support' started by noflyzone, Jul 18, 2011.

  1. noflyzone

    noflyzone

    Joined:
    Nov 22, 2010
    Posts:
    43
    In unity3d,there are some Special folders, Example,
    Assets Resources Plugins Textures Materials Editor Models Prefab Shaders Scripts Sounds Gizmos.....


    Currently, Ask what I know through some of the information from http://answers.unity3d.com/question...l-folders-and-what-do-they.html#answer-145225

    --------------------------------------------------------------
    Resources
    The Resources folder is a special folder which allows you to access resources by name in your scripts, rather than by the usual (and recommended) method of direct references. For this reason, caution is advised when using it, because all items you put in the resources are included in your build (even unused assets), because Unity has no way of determining which assets may be used by your project.

    Editor
    The Editor folder name is a special name which allows your scripts access to the Unity Editor Scripting API. If your script uses any classes or functionality from the UnityEditor namespace, it has to be placed in a folder called Editor (or a subfolder).

    Plugins
    The "Plugins" folder is where you must put any C, C++ or Objective-C based Plugins which should be included with your project. Plugins are a pro-only feature.

    Compilation Order
    These special names (and a few others) also determine the compilation order, which is useful to know if you are mixing languages in your project (i.e. using C# and Javascript scripts in the same project), so sometimes you might see the suggestion to put a script in a folder called "plugins" just for this purpose.

    As for mixing these folders, eg "Editor/Resources"... I'm not sure - it doesn't really make a lot of sense to do that. I think it's generally better to just understand what each special folder's purpose is and use them individually!

    Gizmos
    The gizmos folder holds all the texture/icon assets for use with Gizmos.DrawIcon(). Texture assets placed inside this folder can be called by name, and drawn on-screen as a gizmo in the editor.
    ===============================================
    However, there are no other special folder? For example,"Textures Materials Models Prefab Shaders Scripts Sounds", they are not specific documents?They have no special function? Do they only facilitate the identification of resources? Hope someone can give more accurate and comprehensive reply, thank you
     
  2. Deleted User

    Deleted User

    Guest

    WebPlayerTemplates
    is used to override the default html page used when creating web player builds
     
  3. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    StreamingAssets
    copied to build folder, accessable via Application.streamingAssetsPath (http://docs.unity3d.com/Documentation/ScriptReference/Application-streamingAssetsPath.html)

    Standard Assets
    compiled similarly to a 'Plugins' when it doesnt reside inside of a folder named editor. scripts are output to either Assembly-CSharp-firstpass , Assembly-UnityScript-firstpass, or Assembly-boo-firstpass

    I think we've listed most of the special folder names in unity. The awkward setup of compile order that is unity only benefits CSharp when .js files are in standard assets or plugins, csharp assemblies seem to always load prior to unityscript ones so if you ever plan on using js classes in csharp code they have to be in plugins or standard assets and the csharp code must be outside of those two special folders. If your using unity script though its somewhat pointless since csharp assemblies are always loaded prior ( i'm pretty sure but it would be good to get confirmation )

    Editor folders are compiled last, and you can access js in csharp that way but keep in mind anything in a editor folder doesnt make it out to the final build.
    But yea similar to non editor folders the same setup exists, so if the Editor resides in a folder named Standard Assets or Plugins its compiled before the secondary assembly for editor use.

    Beyond these folders theres a few other folders specific to mobile platforms. like IOS ( if i remember right ) which lets you place files in that get a symbolic link int he xcode project.

    But i don't doubt that there are other special name folders. would be interested in hearing about them
     
  4. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    Thanks for this guys. I'd just like to add a few things.


    According to the user docs, any scripts placed in WebPlayerTemplates will not be compiled at all. This can be useful if you want some scripts to be temporarily unavailable while testing.


    Pro Standard Assets
    Same with Standard Assets only files here are meant for the Pro version


    A little more explanation for the Plugins folder:

    Plugins
    The "Plugins" folder is where you must put any native (C/C++) dlls, which you want to be accessible by your scripts. They will also be included with your build.

    Plugins/Android
    Place here any Java .jar files you want included in your Android build, used for Java-based plugins. See http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

    Plugins/iOS
    A limited, simple way to automatically add (as symbolic links) any .a, .m, .mm, .c, or .cpp files into the generated Xcode project. See http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html

    If you need more control how to automatically add files to the Xcode project, you should make use of the PostprocessBuildPlayer feature. Doing so does not require you to place your files in the Plugins/iOS folder. See http://docs.unity3d.com/Documentation/Manual/BuildPlayerPipeline.html



    And yes, most people have folders named Models, Textures, Scripts, etc. simply for organizational purposes, no special properties on those names AFAIK.
     
  5. d_nepotrebny

    d_nepotrebny

    Joined:
    Nov 9, 2017
    Posts:
    2
    Guys, who can advice, if create "Resources/Editor/SomeAsset.asset" will it be included in build?
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
  7. d_nepotrebny

    d_nepotrebny

    Joined:
    Nov 9, 2017
    Posts:
    2
    Oh! Thanks a lot! :)
     
  8. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    Based on the docs page that @karl_jones posted (version 2021.1 shown below) upload_2021-2-10_22-24-45.png

    Examples:
    Assets/Resources/Editor/SomeAsset.asset WILL be included in builds, while
    Assets/Editor/Resources/SomeAsset.asset WILL NOT be included in builds.