重命名文件时,  指定新目录的名称和位置

时间:2019-11-12 04:59来源:美高梅集团手机版
MD命令: Rename 命令: 美高梅集团手机版,可以在UnityAssets目录下创建smcs.rsp文件,并向其中添加预编译命令,其会在unity启动时执行,比如新建一个smcs.rsp文件,向其中添加内容: -defin

MD命令:

Rename 命令:  

美高梅集团手机版,可以在Unity Assets目录下创建smcs.rsp文件,并向其中添加预编译命令,其会在unity启动时执行,比如新建一个smcs.rsp文件,向其中添加内容:
-define:MYDEF
然后就可以在脚本中加入宏判断:
#if MYDEF
....
#endif
其原理是启动Unity时会执行unity目录下的smcs.exe文件并添加预编译命令,也可以通过cmd运行smcs.exe逐个添加预编译命令。
另外还有可以创建gmcs.rsp文件,对应Editor脚本中的预编译命令。
澳门美高梅游戏,详细:

  // 描述:

  // 描述:  

Custom Preprocessor Directives

It is also possible to define your own preprocessor directives to control which code gets included when compiling. To do this you must add in the "Assets/" folder a text file with the extra directives. The name of the file depends on the language you are using :

C#
<Project Path>/Assets/smcs.rsp

C# - Editor Scripts
<Project Path>/Assets/gmcs.rsp

UnityScript
<Project Path>/Assets/us.rsp

Boo
<Project Path>/Assets/boo.rsp

As an example, if you include the single line '-define:UNITY_DEBUG' in your smcs.rsp file the define UNITY_DEBUG will exist as a global define for C# scripts, except for Editor scripts.
Every time you make make changes to the .rsp files a recompilation needs to be done for them to be effective. You can do this by updating or reimporting a single script (.js, .cs or .boo) file.
The usage of the .rsp files is described in the help of the smcs application, included in the Editor installation folder. You can get more information by running : "smcs -help".

比如如果想要在C#语言中使用指针,必须标记为unsafe的,默认情况下unity中使用unsafe标记会报错,可以在项目中添加smcs.rsp文件并加入-unsafe预编译命令,就可以编译通过。

    (Make Directory)

    重命名文件或目录。

    创建一个目录或子目录。

  // 语法:

  // 语法:

    rename [<Drive>:][<Path>]<FileName1> <FileName2>

编辑:美高梅集团手机版 本文来源: 重命名文件时,  指定新目录的名称和位置

关键词: