myCapsule = GameObject.FindGameObjectWithTag (“MyCapsule”);

// 親のGameObjectからTransform.Find
// 非アクティブでも取得可能
mainCamera = myCapsule.transform.Find(“Camera”).gameObject;
diveCamera = myCapsule.transform.Find(“Dive_Camera”).gameObject;

if (mainCamera != null) {
mainCamera.SetActive (true);
}
if (diveCamera != null) {
diveCamera.SetActive (false);
}

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha