【发布时间】:2021-12-05 03:33:03
【问题描述】:
我在制作一串字符数组以在 Unity 引擎中打印到屏幕时遇到问题。
这里是代码
{
public string[] wordGoDownString = new string[12];
public void Start()
{
char[] chwordGoDownString = wordGoDownString.ToCharArray();
foreach (char ch in wordGoDownString)
{
}
//char[]wordGoDownString[0] = 'O';
//char[]wordGoDownString[1] = 'U';
//char[]wordGoDownString[2] = 'R';
//char[]wordGoDownString[3] = " ";
//char[]wordGoDownString[4] = 'P';
//char[]wordGoDownString[5] = 'R';
//
//Print.ToScreen(chars);
//Print.ToScreen(' ');
//wordGoDownString[6] =
//wordGoDownString[7] =
//wordGoDownString[8] =
//wordGoDownString[9] =
//wordGoDownString[10] =
//wordGoDownString[11] =
}
}
// [SerializeField] private string thatString = "b";
// string yellTheString;
//
// public void Start()
// {
// foreach (char chars in thatString)
// {
// char higherChars = char.ToUpper(chars);
// yellTheString += higherChars;
// }
// Print.ToScreen(yellTheString);
// }
// // YellTheString
// }
//SerializeField] private char charLettersDown1 = 'O';
//
//rivate char string [] thatString = new string[12];
//
//ublic void Start()
//
//thatString[0] = 'O';
//thatString[1] = 'U';
//thatString[2] = 'R';
//thatString[3] = ' ';
//thatString[4] = 'P';
//thatString[5] = 'R';
//thatString[6] = 'I';
//thatString[7] = 'N';
//thatString[8] = 'C';
//thatString[9] = 'E';
//thatString[10] = 'S';
//thatString[11] = 'S';
//
//
//
/// Borrowing this from the school's code documents.
//
//
//SerializeField] private char charLettersDown1 = 'O';
//
//rivate char string [] thatString = new string[12];
//
//ublic void Start()
//
//thatString[0] = 'O';
//thatString[1] = 'U';
//thatString[2] = 'R';
//thatString[3] = ' ';
//thatString[4] = 'P';
//thatString[5] = 'R';
//thatString[6] = 'I';
//thatString[7] = 'N';
//thatString[8] = 'C';
//thatString[9] = 'E';
//thatString[10] = 'S';
//thatString[11] = 'S';
//
//
//
/// Borrowing this from the school's code documents.
//
//
//}
【问题讨论】:
-
不要发布代码链接。而是在这里粘贴代码。
-
请使用正确的标签!请注意,
unityscript是或更好地曾经是一种 JavaScript 风格,类似于早期 Unity 版本中使用的自定义语言,并且现在已经不推荐使用了!这也是不是C++!您的代码显然是c#...也仅仅因为您使用某个 IDE 并不意味着您的问题是关于特定的 IDE ...您应该使用unity3d虽然这是您的主要框架/API在这里使用... -
你的大部分代码都被注释掉了..那么你到底想做什么,因为目前你的代码什么都不做......而不是分配多个字符......为什么不使用字符串@首先是987654328@?
标签: c# arrays unity3d char screen