前提・実現したいこと
Unityの、Vuforiaを使って色んな建物を平面に表示したいのですが、Ground Planeの子オブジェクトをボタンを押したら、Ground Planeのスクリプトで表示、非表示にしたりして色んなオブジェクトを表示させたいのですが、エラーは出てないけど一種類のオブジェクトしか表示できませんでしたどうしたらいいですか?お願いします。
↓参考にしたサイト
https://tm8r.hateblo.jp/entry/2017/12/27/144632
発生している問題・エラーメッセージ
エラーは出てない
該当のソースコード
C#
1```**ボタンのスクリプト↓** 2 3 using UnityEngine; 4 5 6public class Buttonscript : MonoBehaviour 7{ 8 public GameObject oioi; 9 public GameObject gameObject; 10 void Start() 11 { 12 13 } 14 15 // Update is called once per frame 16 void Update() 17 { 18 } 19 public void OnClick() 20 { 21 gameObject.GetComponent<uuu>().ReturnAccess(); 22 oioi.SetActive(true); 23 } 24 25} 26 27**Ground Planeのスクリプト↓** 28 29using System.Collections; 30using System.Collections.Generic; 31using UnityEngine; 32 33public class uuu : MonoBehaviour 34{ 35 // Start is called before the first frame update 36 void Start() 37 { 38 39 } 40 41 // Update is called once per frame 42 void Update() 43 { 44 45 } 46 public void ReturnAccess() 47 { 48 foreach (Transform child in transform) 49 { 50 child.gameObject.SetActive(false); 51 } 52 } 53 54} 55### 試したこと 56 57ここに問題に対して試したことを記載してください。 58 59### 補足情報(FW/ツールのバージョンなど) 60**unity** 612018.4.16f1 62**Vuforia** 637
あなたの回答
tips
プレビュー