Ejemplo n.º 1
0
 public static void UnLoad(string name)
 {
     if (m_gameLoadType == ResLoadLocation.Resource)
     {
     }
     else
     {
         AssetsBundleManager.UnLoadBundle(name);
     }
 }
Ejemplo n.º 2
0
 public static void UnLoadRes(List <string> resList)
 {
     if (ResourceManager.m_gameLoadType != ResLoadLocation.Resource)
     {
         for (int i = 0; i < resList.Count; i++)
         {
             AssetsBundleManager.UnLoadBundle(resList[i]);
         }
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.A))
        {
            GameObject testTmp = (GameObject)ResourceManager.Load("GameObject");

            Instantiate(testTmp);
        }

        if (Input.GetKey(KeyCode.B))
        {
            GameObject testTmp = (GameObject)ResourceManager.Load("UItest");

            Instantiate(testTmp);
        }

        if (Input.GetKey(KeyCode.U))
        {
            UIManager.OpenUIWindow("MianMenu");
        }

        if (Input.GetKey(KeyCode.I))
        {
            UIManager.CloseUIWindow("MianMenu");
        }

        if (Input.GetKey(KeyCode.C))
        {
            AssetsBundleManager.UnLoadBundle("UItest");
        }



        if (Input.GetKey(KeyCode.D))
        {
            loadCount++;
            ResourceManager.LoadAsync("UItest", (LoadState state, object obj) =>
            {
                if (state.isDone)
                {
                    callbackCount++;
                    Debug.Log(state.progress);
                    GameObject go = (GameObject)obj;

                    Instantiate(go);

                    Debug.Log(loadCount + "  " + callbackCount);
                }
                else
                {
                    Debug.Log(state.progress);
                }
            });
        }
    }
Ejemplo n.º 4
0
    public static void UnLoad(string name)
    {
        string path = ResourcesConfigManager.GetResourcePath(name);

        if (m_gameLoadType == ResLoadLocation.Resource)
        {
        }
        else
        {
            AssetsBundleManager.UnLoadBundle(path);
        }
    }
    public static void UnLoad(string name)
    {
        if (name == null)
        {
            throw new Exception("ResourceManager UnLoad -> name is null !");
        }
        //Debug.Log("UnLoad ==>>" + name);
        string path = ResourcesConfigManager.GetResourcePath(name);

        if (m_gameLoadType == ResLoadLocation.Resource)
        {
        }
        else
        {
            AssetsBundleManager.UnLoadBundle(path);
        }
    }