카테고리 : 메모리 Neo Land | 2018. 8. 16. 04:00
이미지 압축은 APK의 빌드 용량을 줄여줄 뿐만 아니라게임 내 메모리 사용량에서도 큰 이점이 됩니다. 아래의 맵의 경우 그냥 넣었는데RGBA ETC2 8bit로 체크해도 되지 않았습니다. 자세히 보니 가로 세로의 픽셀이 4로 나눠 떨어지는 이미지만 ETC2로 압축된다고 합니다.아틀라스로 묶어서 쓰는 경우에는 상관없지만 이미지를 바로 쓰는 경우에는 미리 이미지를 반드시 체크해줘야 합니다! 가로 세로를 4의 배수로 맞추자 자동으로 ETC2 방식으로 압축되서 용량이 축소된 모습니다.이는 실제로 인 게임에서도 메모리를 13.5MB 차지하다가5MB만 차지하는 놀라운 효율을 보여주었습니다.
카테고리 : 메모리 Neo Land | 2018. 8. 15. 03:55
유니티 에셋중의 하나인 투디툴킷을 사용하다보면 놓칠 수 있는게 메모리 사용량 관리이다. 스프라이트 콜렉션의 Settings에서 Texture Settings의 Compression이 기본적으로 uncompression으로 되어있는데 이렇게 해서 게임을 실행하면 게임 내에서 먹는 메모리가 상당하게 된다. 다행히 투디툴킷에서 옵션을 제공하고 있어서 Texture Settings의 옵션을 Compression으로 바꿔주면 게임 내 용량이 확연하게 줄어드는 것을 볼 수 있다.
카테고리 : 유니티 Neo Land | 2018. 8. 13. 05:51
void ResizeSpriteToScreen(GameObject theSprite, tk2dCamera theCamera, int fitToScreenWidth, int fitToScreenHeight) { MeshRenderer sr = theSprite.GetComponent(); theSprite.transform.localScale = new Vector3(1, 1, 1); float width = sr.bounds.size.x; float height = sr.bounds.size.y; float worldScreenHeight = (float)(theCamera.CameraSettings.orthographicSize * 2.0); float worldScreenWidth = (float)(..
카테고리 : 유니티 Neo Land | 2018. 8. 8. 00:12
StartCoroutine("AttackEnemy"); StopCoroutine("AttackEnemy"); 또는 Coroutine lastRoutine = null; lastRoutine = StartCoroutine(YourCoroutine()); StopCoroutine(lastRoutine); 참조 : https://answers.unity.com/questions/934490/stopcoroutine-is-not-stopping-my-coroutines.html
카테고리 : 유니티 Neo Land | 2018. 8. 5. 01:55
Vector3 vpos2 = new Vector3(2.28f, 0.56f, ArPoint4.transform.position.z); 이런식으로 x와 y 값을 지정해줘도 게임 상에선 이상한 숫자로 표기될 때가 있다. 원인은 변수.transform.position = vpos2; 이런식으로 주었기 때문이다. LocalPostion을 사용해야 한다. 변수.transform.localPosition = vpos2; 해결.