简体   繁体   中英

Converting Unityscript to c#

Can anyone help me convert this Unityscript code to C# in Unity3d. I am having trouble understanding variable text and transform (ie var text: Transform;)

#pragma strict


var text: Transform;

Based on the code you've posted thus far, the C# equivalent would be:

Transform text;

Transform is the type. text is the name of the variable being declared.

Unity actually provides a beginner video that explains the syntax differences between JS and C#:

Unity - C# vs JS syntax

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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