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>

    md
[<Drive>:]<Path>

  //
参数:

  //
参数:

    

    [<Drive:>] : 钦点要在其上开改正目录的驱动器。

  //
说明:

    <Path>   :   钦定新目录的称谓和职分。
任何单个路线的最大尺寸由文件系统显明。

    –>
内定要重命名的文件或文件集的地点和称号。文件名可以包含通配符(*和?)。

    /?      :   接济音讯。

    –> 重命名文件时,无法钦赐新驱动器或路线。  

  //
注意事项:

    –> 文件名必得是必须要经过的路的文本名。 

  // 实例:

  //
实例:    

    乐百家loo777 1

 
  乐百家loo777 2

 

    乐百家loo777 3

  

 

相关文章