Exemplo n.º 1
0
 /// <summary>
 /// Asynchronously unloads the scene.
 /// </summary>
 /// <param name="scene">The scene to unload.</param>
 /// <param name="location">key of the scene to unload.</param>
 /// <returns>Async operation for the scene unload.</returns>
 public static IAsyncOperation <Scene> ReleaseScene(Scene scene, IResourceLocation location)
 {
     if (SceneProvider == null)
     {
         throw new NullReferenceException("ResourceManager.SceneProvider is null.  Assign a valid ISceneProvider object before using.");
     }
     if (location == null)
     {
         return(new CompletedOperation <Scene>().Start(null, null, default(Scene), new ArgumentNullException("location")));
     }
     return(SceneProvider.ReleaseSceneAsync(location, scene).Retain());
 }
Exemplo n.º 2
0
        /// <summary>
        /// Asynchronously loads the scene a the given <paramref name="location"/>.
        /// </summary>
        /// <returns>Async operation for the scene.</returns>
        /// <param name="location">location of the scene to load.</param>
        /// <param name="loadMode">Scene Load mode.</param>
        public static IAsyncOperation <Scene> ProvideScene(IResourceLocation location, LoadSceneMode loadMode = LoadSceneMode.Single)
        {
            if (SceneProvider == null)
            {
                throw new NullReferenceException("ResourceManager.SceneProvider is null.  Assign a valid ISceneProvider object before using.");
            }
            if (location == null)
            {
                return(new CompletedOperation <Scene>().Start(null, null, default(Scene), new ArgumentNullException("location")));
            }

            ResourceManagerEventCollector.PostEvent(ResourceManagerEventCollector.EventType.LoadSceneAsyncRequest, location, 1);
            ResourceManagerEventCollector.PostEvent(ResourceManagerEventCollector.EventType.CacheEntryLoadPercent, location, 0);

            return(SceneProvider.ProvideSceneAsync(location, LoadDependencies(location), loadMode).Retain());
        }
Exemplo n.º 3
0
 public ResourceManagerImpl()
 {
     sceneProvider    = new SceneProvider();
     instanceProvider = new InstanceProvider();
 }