카테고리 없음

에셋번들 메모리 관리..

빨강꼬마 2017. 5. 23. 23:15

ㅇ1년 정도 더된 글이지만..

http://qiita.com/Dorobou/items/9b71e6621095466083c4


핵심은 


 void Update () {
        if (Input.GetKeyDown (KeyCode.A)) {
            GameObject.Find("Plane").renderer.material.mainTexture = null;
        }
        else if (Input.GetKeyDown (KeyCode.B)) {
            DestroyObject(GameObject.Find("Plane"));
        }
        else if (Input.GetKeyDown (KeyCode.C)) {
            tex = null;
        }
        else if (Input.GetKeyDown (KeyCode.D)) {
            Resources.UnloadAsset(tex);
        }
        else if (Input.GetKeyDown (KeyCode.E)) {
            Resources.UnloadUnusedAssets();
        }
    }



일때


B > C > E 순서로 처리해야 객체의 참조가 전혀 없어지므로 메모리를 해제할 수 있음.




에셋번들 워크플로.