public void Setup() { Scene scene = EditorSceneManager.OpenScene("Assets/TestAssets/EditModeTestScene.unity"); GameObject[] gameObjects = scene.GetRootGameObjects(); mHlodGameObject = gameObjects[0].transform.Find("HLOD").gameObject; hlod = mHlodGameObject.GetComponent <HLOD>() as HLOD; var coroutine = CoroutineRunner.RunCoroutine(HLODCreator.Create(hlod)); while (coroutine.MoveNext()) { //Wait until coroutine is finished } }
public void Setup() { GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(m_prefabName); m_hlodGameObject = (GameObject)PrefabUtility.InstantiatePrefab(prefab); PrefabUtility.UnpackPrefabInstance(m_hlodGameObject, PrefabUnpackMode.OutermostRoot, InteractionMode.AutomatedAction); m_hlod = m_hlodGameObject.GetComponentInChildren <HLOD>(); var coroutine = CoroutineRunner.RunCoroutine(HLODCreator.Create(m_hlod)); while (coroutine.MoveNext()) { //Wait until coroutine is finished } }