Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
        }