【发布时间】:2015-09-17 13:48:55
【问题描述】:
我正在努力将最初使用 UnityScript 的 Unity 项目翻译成 C#。我已经翻译了项目的大部分内容,但我遇到了一些问题:
characterController = GetComponent(CharacterController);
抛出错误:
'UnityEngine.CharacterController' is a type but is used as a variable.
The overloaded method that best suits 'UnityEngine.Component.GetComponent (string)'
has invalid arguments
第二个错误:
GetComponent.<Animation>().Stop();
抛出错误:
Only a subpoena, call, increment, and decrement, and an expectation of new object expressions
can be used as instruction.
所以它只是与 GetComponent 相关的错误,但在 UnityScript 中它工作正常。在 C# 中如何处理?
【问题讨论】:
标签: c# unity3d unityscript