- 165 名前:弟子 mailto:sage [2018/07/04(水) 18:21:48.52 ID:+Bj9nh1d.net]
- >>153
ソース見ました 弾を打つ処理って無限ループの中で行っているのですね なのでループの中に撃たない処理をいれないとダメですね それと「Manager.cs」で既に title = GameObject.Find("Title");されていて成功しているので 他で使う場合は、まず宣言で // タイトル public static GameObject title; の様に「public」な「static」の変数にします で「Enemy.cs」の無限ループ中で while (true) { // 子要素を全て取得する for (int i = 0; i < transform.childCount; i++) { Transform shotPosition = transform.GetChild(i); //弾を撃たせる //ShotPositionの位置/角度で弾を撃つ if (Manager.title.activeSelf == false) spaceship.Shot(shotPosition); } // shotDelay秒待つ yield return new WaitForSeconds(spaceship.shotDelay); } これで行けるかと思います 一応、インスペクタでタイトルを操作した画面です ttps://imgur.com/a/qEZk4ej
|

|