脚本编译包含4步:
1. All scripts in "Standard Assets", "Pro Standard Assets" or "Plugins" are compiled first.
所有"Standard Assets", "Pro Standard Assets"或"Plugins"文件夹里的脚本会被首先编译
Scripts in one of these folders can't directly access scripts outside these folders.
这些文件夹里的脚本不能直接访问文件夹之外的脚本。
It is not possible to reference the class or its variables directly, but it is possible to communicate with them using GameObject.SendMessage .
不能直接引用类或它们的变量,但是可以通过使用 GameObject.SendMessage 与他们进行通信。
2.All scripts in "Standard Assets/Editor", "Pro Standard Assets/Editor" or "Plugins/Editor" are compiled next.
所有"Standard Assets/Editor", "Pro Standard Assets/Editor"或"Plugins/Editor"文件夹里的脚本会紧接着编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,你必须把你的脚本放到这些文件夹里。例如你想添加菜单项或自定义向导,那么你必须把你的脚本放到那些文件夹里。
These scripts can access scripts from the previous group.
这些脚本可以访问之前第一条里说的那些脚本.
3.All other scripts outside "Editor" are compiled next.
所有在"Editor"外的脚本将紧接着被编译
All scripts that are not in the folders above or in "Editor" are compiled next.
所有脚本不在以上文件夹或Editor中紧接着被编译。
All scripts that are compiled in this step have access to all scripts in the first group ("Standard Assets", "Pro Standard Assets" or "Plugins"). This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the "Standard Assets" folder and the Javascript outside of the "Standard Assets" folder. The Javascript can now reference the C# script directly.
在这步所有脚本被编译,在第一组已访问的所有脚本。这允许你让不同的脚本语言交互操作。例如,如果你想使用C#脚本来创建Javascript脚本:把C#脚本放在Standard Assets文件夹,Javascript文件在Standard Assets文件夹外。现在Javascript可以直接引用C#脚本了。
Scripts that are placed in the first group, will take longer to compile, since when they are compiled the third group needs to be recompiled too. Thus if you want to reduce compile times, put scripts that seldom change into group 1 and scripts that change a lot into group 3.
脚本被放在第一组,将需要更长的时间来编译,因为当它们被编译的第三组也需要重新编译,因此,如果你想减少编译时间,将在第1组的脚本要较少修改,把较多修改的脚本放在第3组。
4. All scripts in "Editor" are compiled last.
所有在Editor文件夹的的脚本最后编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,必须把脚本放到这个文件夹中。例如,添加菜单项或写个自定义向导,就比较把脚本放到这个文件夹。
These scripts can access all scripts in all previous groups.
这些脚本可以访问所有以前的组中的所有脚本。
Additionally, any scripts in a folder called WebPlayerTemplates will not be compiled at all.
此外,任意在名为WebPlayerTemplates文件夹将不会被编译。
1. All scripts in "Standard Assets", "Pro Standard Assets" or "Plugins" are compiled first.
所有"Standard Assets", "Pro Standard Assets"或"Plugins"文件夹里的脚本会被首先编译
Scripts in one of these folders can't directly access scripts outside these folders.
这些文件夹里的脚本不能直接访问文件夹之外的脚本。
It is not possible to reference the class or its variables directly, but it is possible to communicate with them using GameObject.SendMessage .
不能直接引用类或它们的变量,但是可以通过使用 GameObject.SendMessage 与他们进行通信。
2.All scripts in "Standard Assets/Editor", "Pro Standard Assets/Editor" or "Plugins/Editor" are compiled next.
所有"Standard Assets/Editor", "Pro Standard Assets/Editor"或"Plugins/Editor"文件夹里的脚本会紧接着编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,你必须把你的脚本放到这些文件夹里。例如你想添加菜单项或自定义向导,那么你必须把你的脚本放到那些文件夹里。
These scripts can access scripts from the previous group.
这些脚本可以访问之前第一条里说的那些脚本.
3.All other scripts outside "Editor" are compiled next.
所有在"Editor"外的脚本将紧接着被编译
All scripts that are not in the folders above or in "Editor" are compiled next.
所有脚本不在以上文件夹或Editor中紧接着被编译。
All scripts that are compiled in this step have access to all scripts in the first group ("Standard Assets", "Pro Standard Assets" or "Plugins"). This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the "Standard Assets" folder and the Javascript outside of the "Standard Assets" folder. The Javascript can now reference the C# script directly.
在这步所有脚本被编译,在第一组已访问的所有脚本。这允许你让不同的脚本语言交互操作。例如,如果你想使用C#脚本来创建Javascript脚本:把C#脚本放在Standard Assets文件夹,Javascript文件在Standard Assets文件夹外。现在Javascript可以直接引用C#脚本了。
Scripts that are placed in the first group, will take longer to compile, since when they are compiled the third group needs to be recompiled too. Thus if you want to reduce compile times, put scripts that seldom change into group 1 and scripts that change a lot into group 3.
脚本被放在第一组,将需要更长的时间来编译,因为当它们被编译的第三组也需要重新编译,因此,如果你想减少编译时间,将在第1组的脚本要较少修改,把较多修改的脚本放在第3组。
4. All scripts in "Editor" are compiled last.
所有在Editor文件夹的的脚本最后编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,必须把脚本放到这个文件夹中。例如,添加菜单项或写个自定义向导,就比较把脚本放到这个文件夹。
These scripts can access all scripts in all previous groups.
这些脚本可以访问所有以前的组中的所有脚本。
Additionally, any scripts in a folder called WebPlayerTemplates will not be compiled at all.
此外,任意在名为WebPlayerTemplates文件夹将不会被编译。