// Use this for initialization void Start() { foreach (GameObject VRGameObject in VRGameObjects) { VRGameObject.SetActive(false); } }
// Update is called once per frame void Update() { if ((SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.VR_A]) && !VRGameObjectsActive) { foreach (GameObject VRGameObject in VRGameObjects) { VRGameObject.SetActive(true); } VRGameObjectsActive = true; } else if ((SceneManager.GetActiveScene().name != ID.SceneNames[(int)ID.Scenes.VR_A]) && VRGameObjectsActive) { foreach (GameObject VRGameObject in VRGameObjects) { VRGameObject.SetActive(false); } VRGameObjectsActive = false; } }