예제 #1
0
파일: Resources.cs 프로젝트: nanze81/bsf
        /// <summary>
        /// Returns the loading progress of a resource that's being asynchronously loaded.
        /// </summary>
        /// <param name="resource">Resource whose load progress to check.</param>
        /// <param name="includeDependencies">If false the progress will reflect the load progress only for this individual
        ///                                   resource. If true the progress will reflect load progress of this resource
        ///                                   and all of its dependencies.</param>
        /// <returns>Load progress in range [0, 1].</returns>
        public static float GetLoadProgress(RRefBase resource, bool includeDependencies = true)
        {
            if (resource == null)
            {
                return(0.0f);
            }

            return(Internal_GetLoadProgress(resource.GetCachedPtr(), includeDependencies));
        }
예제 #2
0
파일: Resources.cs 프로젝트: nanze81/bsf
        /// <summary>
        /// Releases an internal reference to the resource held by the resources system. This allows the resource
        ///	to be unloaded when it goes out of scope, if the resource was loaded with "keepLoaded" parameter.
        ///
        /// Alternatively you can also skip manually calling <see cref="Release(RRefBase)"/> and call <see cref="UnloadUnused"/>
        /// which will unload all resources that do not have any external references, but you lose the fine grained control
        /// of what will be unloaded.
        /// </summary>
        /// <param name="resource">Resource to release</param>
        public static void Release(RRefBase resource)
        {
            if (resource == null)
            {
                return;
            }

            Internal_ReleaseRef(resource.GetCachedPtr());
        }