コード例 #1
0
ファイル: TestRes.cs プロジェクト: GITHUB243884919/COCSLG
    IEnumerator TestAll()
    {
        AssetGetter ag1 = ResourceManager.GetInstance().LoadAllAssets(
            "textures/unitylogo");

        Object[] objs = ag1.GetAll(gameObject) as Object[];
        Debug.LogError(objs.Length);

        GameObjectGetter gg1 = ResourceManager.GetInstance().LoadGameObject(
            "prefabs/mycube");
        GameObject go1 = gg1.Get();

        AssetGetter ag2 = ResourceManager.GetInstance().LoadAsset(
            "materials/mymaterial");
        Material m = ag2.Get <Material>(gameObject);

        GameObjectGetter gg2 = ResourceManager.GetInstance().LoadGameObject(
            "prefabs/mycube-parent");
        GameObject go2 = gg2.Get();

        //ag1.Release(gameObject);
        //gg1.Release(go1);
        //ag2.Release(gameObject);
        //gg2.Release(go2);
        yield return(new WaitForSeconds(5));

        ResourceManager.GetInstance().DestroyGameObject(go1);
        ResourceManager.GetInstance().DestroyGameObject(go2);
        ResourceManager.GetInstance().RealseAsset(gameObject);
        ResourceManager.GetInstance().RealseAllUnUse();

        yield return(new WaitForSeconds(10));

        yield return(null);
    }
コード例 #2
0
 void TestDatbase()
 {
     GameObjectGetter gogetter    = ResourceManager.GetInstance().LoadGameObject("prefabs/cube");
     GameObject       go          = gogetter.Get();
     AssetGetter      assetgetter = ResourceManager.GetInstance().LoadAsset("materials/mymaterial");
     Material         m           = assetgetter.Get <Material>(gameObject);
 }
コード例 #3
0
ファイル: TestRes.cs プロジェクト: GITHUB243884919/COCSLG
    void TestDatbase()
    {
        GameObjectGetter gogetter        = ResHelper.LoadGameObject("prefabs/cube");
        GameObject       cubeGo          = gogetter.Get();
        AssetGetter      assetgetterBlue = ResHelper.LoadAsset("materials/blue");
        Material         mBlue           = assetgetterBlue.Get(cubeGo) as Material;

        cubeGo.GetComponent <Renderer>().material = mBlue;


        AssetGetter assetgetter = ResHelper.LoadAsset("materials/mymaterial");
        Material    m           = assetgetter.Get <Material>(gameObject);



        var getter = ResHelper.LoadGameObject("prefabs/ui/ui_login");

        getter.Get();
    }