- 서버에서 다운받는 데이터를 아직 서버가 마련되지 않아 파일형식으로 유니티에 포함시킬때 사용.
- Assets/StreamingAssets/ 폴더에 넣어두면 된다.
- 위치
Standalone
- path = = Application.dataPath + "/StreamingAssets";
iOS
- path = Application.dataPath + "/Raw";
Android
- path = "jar:file://" + Application.dataPath + "!/assets/";
- WWW 는 사용하지 못한다..jar 를 열수 있는 다른 것을 사용한 후에 사용가능.
'Dev > Unity3D' 카테고리의 다른 글
리워드광고 보기 후 유니티 화면 멈춤 (0) | 2021.11.08 |
---|---|
E/Unity: AndroidVideoMedia::VideoDecoder::Blit failed. Decode shader probably unsupported. (0) | 2021.11.06 |
Texture, Resource.... and Memory!! (1) | 2012.06.05 |
GameObject active 여부와 Coroutine / Invoke... (1) | 2012.06.05 |
Unity, Audio, and Memory (0) | 2012.01.25 |
* Memory 해제 관련...
*. Prefab 을 public GameObject variable 로 연결하면 1개가 살아있다...
- Resource 로 옮기고 Resource.Load 후 Instantiate 해준다음 Resource.UnloadUnusedAsset으로 로드했던 prefab을 해제시키자.
* Texture
- WWW 혹은 다른곳에서 load 한 texture 들은 사용하지 않을때 DestroyImmediate 로 꼭 해제시켜줘야 한다. DestroyImmediate 해주면 바로 memory 에서 해제된다.
*. GameObject Destroy 는 memory 를 바로 해제시키지 않는다.
- Resource.UnloadUnusedAssets 를 해야 memory 에서 해제된다.
- GameObject 를 DestroyImmediate 해도 포함되있는 Texture, material, 등은 memory에서 해제되지 않는다.
*. Load 한 Texture 들을 Member 로 가지고 있으면 GameObject Destroy 시 memory 해제 안된다.
- Texture 는 개별 DestroyImmediate 하여 바로바로 해제하자.
'Dev > Unity3D' 카테고리의 다른 글
E/Unity: AndroidVideoMedia::VideoDecoder::Blit failed. Decode shader probably unsupported. (0) | 2021.11.06 |
---|---|
StreamingAsset 활용하기. (0) | 2012.06.18 |
GameObject active 여부와 Coroutine / Invoke... (1) | 2012.06.05 |
Unity, Audio, and Memory (0) | 2012.01.25 |
unity3d data path! (0) | 2011.12.14 |
GameObject.active = true;
- StartCoroutine : OK
- Coroutine Method : OK
- StopAllCoroutine : OK
- Invoke : OK
- InvokeRepeating : OK
- CancelInvoke : OK
GameObject.active = false;
- StartCoroutine : Error
- Coroutine Method : Stop (active 상태에서 돌고 있는 상태였다면 정지된다.)
- StopAllCoroutine : OK
- Invoke : OK
- InvokeRepeating : OK
- CancelInvoke : OK
** 결론
- StartCoroutine 으로 코루틴 메소드를 열심히 돌리다가 해당 GameObject 의 active 가 꺼지면 돌던 코루틴 메소드는 정지되고 다시 active 가 켜지더라도 재실행되지 않는다.....
- 코루틴을 많이 사용하는 로직(Async 로 돌리는 함수들..(WWW, ... 같은...))에서는 꼭 염두해 두어야 한다..
- OnDisable() {} 에서 관련 처리를 해 주는게 좋다.
- Invoke 관련은 GameObject 의 active 유무랑 관계없이 돌아간다..
'Dev > Unity3D' 카테고리의 다른 글
StreamingAsset 활용하기. (0) | 2012.06.18 |
---|---|
Texture, Resource.... and Memory!! (1) | 2012.06.05 |
Unity, Audio, and Memory (0) | 2012.01.25 |
unity3d data path! (0) | 2011.12.14 |
Unity3D Mesh Create Code (0) | 2011.10.20 |