Special Folder Names in your Assets Folder

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
Line 20: Line 20:
  
 
== Plugins ==
 
== 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 automatically included in your build.
+
The "Plugins" folder is where you must put any native plugins, which you want to be accessible by your scripts. They will also be automatically included in your build. Take note that this folder may not be in any subfolder (it has to reside within the top-level Assets folder).
 +
 
 +
In Windows, native plugins exist as .dll files, in Mac OS X, they are .bundle files, and in Linux, they are .so files.
 +
 
 +
 
 +
=== Plugins/x86 ===
 +
If you are building for 32-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.
 +
 
 +
 
 +
=== Plugins/x86_64 ===
 +
If you are building for 64-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.
 +
 
 +
 
 +
If you are making a universal build, it's recommended you make both the x86 and x86_64 subfolders. Then have the 32-bit and 64-bit versions of your native plugins in the proper subfolder correspondingly.
  
  
 
=== Plugins/Android ===
 
=== Plugins/Android ===
Place here any Java .jar files you want included in your Android project, used for Java-based plugins. See http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html
+
Place here any Java .jar files you want included in your Android project, used for Java-based plugins. Any .so file (when having Android NDK-based plugins) will also be included. See http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html
  
  
Line 35: Line 48:
  
 
== Resources ==
 
== 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. You can have multiple Resources folders throughout your project.
+
The Resources folder is a special folder which allows you to access assets by file path and name in your scripts, rather than by the usual (and recommended) method of direct references (as variables in scripts). For this reason, caution is advised when using it, because all assets you put in the Resources folder are always included in your build (even unused ones), because Unity has no way of determining which Resources-based assets are used or not. You can have multiple Resources folders throughout your project.
  
  
Line 50: Line 63:
  
 
== StreamingAssets ==
 
== StreamingAssets ==
Copied to build folder, accessable via Application.streamingAssetsPath (http://docs.unity3d.com/Documentation/ScriptReference/Application-streamingAssetsPath.html)
+
Any files in here are copied to the build folder as is, without any changes (except for mobile and web builds). The path where they are can vary per platform but is accessible via Application.streamingAssetsPath (http://docs.unity3d.com/Documentation/ScriptReference/Application-streamingAssetsPath.html)

Revision as of 11:39, 19 May 2013

Some names for folders have special properties in Unity. Until the official docs creates a page for this information, hopefully this page will help developers.


Contents

Standard Assets

Scripts in here are always compiled first. Scripts are output to either Assembly-CSharp-firstpass, Assembly-UnityScript-firstpass, or Assembly-Boo-firstpass. See http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

Placing scripts in Standard Assets is one way for C# scripts to be able to access .js scripts or vice-versa.


Pro Standard Assets

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


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. You can have multiple Editor folders throughout your project.


Plugins

The "Plugins" folder is where you must put any native plugins, which you want to be accessible by your scripts. They will also be automatically included in your build. Take note that this folder may not be in any subfolder (it has to reside within the top-level Assets folder).

In Windows, native plugins exist as .dll files, in Mac OS X, they are .bundle files, and in Linux, they are .so files.


Plugins/x86

If you are building for 32-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.


Plugins/x86_64

If you are building for 64-bit or a universal (both 32 and 64 bit) platform, and if this subfolder exists, any native plugin files in this folder will automatically be included in your build. If this folder does not exist, Unity will look for native plugins inside the parent Plugins folder instead.


If you are making a universal build, it's recommended you make both the x86 and x86_64 subfolders. Then have the 32-bit and 64-bit versions of your native plugins in the proper subfolder correspondingly.


Plugins/Android

Place here any Java .jar files you want included in your Android project, used for Java-based plugins. Any .so file (when having Android NDK-based plugins) will also be included. 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


Resources

The Resources folder is a special folder which allows you to access assets by file path and name in your scripts, rather than by the usual (and recommended) method of direct references (as variables in scripts). For this reason, caution is advised when using it, because all assets you put in the Resources folder are always included in your build (even unused ones), because Unity has no way of determining which Resources-based assets are used or not. You can have multiple Resources folders throughout your project.


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.


WebPlayerTemplates

Used to replace the default web page used for web builds. Any scripts placed here will not be compiled at all.


StreamingAssets

Any files in here are copied to the build folder as is, without any changes (except for mobile and web builds). The path where they are can vary per platform but is accessible via Application.streamingAssetsPath (http://docs.unity3d.com/Documentation/ScriptReference/Application-streamingAssetsPath.html)

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox