/// <summary> /// Creates an instance of the scene specified by the scene index. /// </summary> /// <param name="sceneIndex">Index of the scene to be instantiated</param> /// <param name="instantiator">Receives scene construction calls</param> /// <returns>True if instantiation was successful.</returns> protected bool InstantiateScene(int sceneIndex, GameObjectInstantiator instantiator) { if (importer == null) { return(false); } var success = importer.InstantiateScene(instantiator, sceneIndex); PostInstantiation(instantiator, success); return(success); }
/// <summary> /// Creates an instance of the scene specified by the scene index. /// </summary> /// <param name="sceneIndex">Index of the scene to be instantiated</param> /// <param name="instantiator">Receives scene construction calls</param> /// <returns>True if instantiation was successful.</returns> protected bool InstantiateScene(int sceneIndex, GameObjectInstantiator instantiator) { if (importer == null) { return(false); } var success = importer.InstantiateScene(instantiator, sceneIndex); sceneInstance = instantiator.sceneInstance; currentSceneId = success ? sceneIndex : (int?)null; return(success); }