Axiom.Core.ResourceManager.Unload C# (CSharp) Method

Unload() public method

Unloads a Resource from the managed resources list, calling it's Unload() method.
This method removes a resource from the list maintained by this manager, and unloads it from memory. It does NOT destroy the resource itself, although the memory used by it will be largely freed up. This would allow you to reload the resource again if you wished.
public Unload ( Resource resource ) : void
resource Resource
return void
		public virtual void Unload( Resource resource )
		{
			// unload the resource
			resource.Unload();

			// remove the resource
			_resources.Remove( resource.Name );

			// update memory usage
			_memoryUsage -= resource.Size;
		}

Same methods

ResourceManager::Unload ( System.UInt64 handle ) : void
ResourceManager::Unload ( string name ) : void

Usage Example

Beispiel #1
0
        public virtual RequestID Unload(string resType, ResourceHandle handle, OnOperationCompleted listener)
#endif
        {
#if AXIOM_THREAD_SUPPORT
            // queue a request
            ResourceRequest req = new ResourceRequest();
            req.Type           = RequestType.UnloadResource;
            req.ResourceType   = resType;
            req.ResourceHandle = handle;
            req.Listener       = listener;
            return(AddRequest(req));
#else
            // synchronous
            ResourceManager rm = ResourceGroupManager.Instance.ResourceManagers[resType];
            rm.Unload(handle);
            return(0);
#endif
        }
All Usage Examples Of Axiom.Core.ResourceManager::Unload