简体   繁体   English

将Unityscript转换为C#

[英]Converting Unityscript to c#

Can anyone help me convert this Unityscript code to C# in Unity3d. 谁能帮助我在Unity3d中将此Unityscript代码转换为C#。 I am having trouble understanding variable text and transform (ie var text: Transform;) 我在理解可变文本和转换时遇到麻烦(即var text:Transform;)

#pragma strict


var text: Transform;

Based on the code you've posted thus far, the C# equivalent would be: 根据您到目前为止发布的代码,C#等效项将是:

Transform text;

Transform is the type. Transform是类型。 text is the name of the variable being declared. text是要声明的变量的名称。

Unity actually provides a beginner video that explains the syntax differences between JS and C#: Unity实际上提供了一个初学者视频,解释了JS和C#之间的语法差异:

Unity - C# vs JS syntax Unity-C#与JS语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM