private void CheckAndAddGotoNextSceneBehavior(string[] levels) { for (int i = 0; i < levels.Length; ++i) { string levelPath = levels[i]; var scene = EditorSceneManager.OpenScene(levelPath); GameObject[] objects = scene.GetRootGameObjects(); bool componentFound = false; foreach (GameObject go in objects) { GotoNextScene component = go.GetComponent <GotoNextScene>(); if (component != null) { component.m_NextSceneIndex = (i + 1) % levels.Length; componentFound = true; break; } } if (!componentFound) { GameObject gotoNextScene = new GameObject("GotoNextScene"); GotoNextScene component = gotoNextScene.AddComponent <GotoNextScene>(); component.m_NextSceneIndex = (i + 1) % levels.Length; } EditorSceneManager.SaveScene(scene); EditorSceneManager.UnloadSceneAsync(scene); } }
void OnCancelledCalibrationHold() { if (NextSceneIfShortAppButtonPress) { GotoNextScene.LoadNextScene(); } }