在 GameController 中。不知道为什么教程还要去设置spawnRotation。
不是已经写过RandomRotator了么?已经是随机的了。
//Quaternion spawnRotation = Quaternion.identity;
Quaternion spawnRotation = new Quaternion ();
注释掉的是教程的代码。
在写发射子弹的音效播放的时候,audio跟rigidbody一样。需要GetComponent。
然后才能使用 audio.Play()。
但是并没有弄明白为什么要在类前面加个[RequireComponent(typeof(AudioSource))],所以我就没有加上。
在添加GUIText的时候没有这个选项。需要自己添加一个Empty。
然后Add Component 选择Rect Transform 和 GUI Text。
其他的没有遇到什么问题了。完成。