static T GetResInBundle <T>(BundleBase bundle, string resName) where T : Object
    {
        var        obj    = bundle.m_bundle.LoadAsset(resName);
        GameObject insObj = (GameObject)GameObject.Instantiate(obj);

        bundle.m_refList.Add(insObj);
        return(insObj.GetComponent <T>());
    }
Beispiel #2
0
 public static T WithConfiguration <T>(this BundleBase <T> bundle) where T : BundleBase <T>
 {
     if (Config.Mvc.Debug.IgnoreMinification)
     {
         return(bundle.ForceDebug());
     }
     return(bundle.ForceRelease());
 }
Beispiel #3
0
 /// <summary>
 /// Add a list of file paths to the bundle.
 /// For some reason this was removed in SquishIt 0.9.
 /// </summary>
 public static T Add <T>(this BundleBase <T> bundle, string[] paths) where T : BundleBase <T>
 {
     foreach (string path in paths)
     {
         bundle.Add(path);
     }
     return((T)bundle);
 }
        /// <summary>
        /// This will parse a loaded bundle and mount everything to the VFS
        /// </summary>
        /// <param name="p_Bundle">Bundle to be mounted</param>
        private void MountBundleToVFS(BundleBase p_Bundle)
        {
            FileSystem.Mount("/bundles", p_Bundle);

            foreach (var s_Chunk in p_Bundle.ChunkEntries)
            {
                FileSystem.Mount("/chunks", s_Chunk);
            }

            foreach (var s_Resource in p_Bundle.ResourceEntries)
            {
                FileSystem.Mount("/res", s_Resource);
            }

            foreach (var s_Ebx in p_Bundle.PartitionEntries)
            {
                FileSystem.Mount("/ebx", s_Ebx);
            }
        }
 /// <summary>Creates service definition that can be registered with a server</summary>
 public static ServerServiceDefinition BindService(BundleBase serviceImpl)
 {
     return(ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_GetBundle, serviceImpl.GetBundle).Build());
 }