기본 콘텐츠로 건너뛰기

2D 모바일 게임 최적화 팁

스크랩 2D 모바일 게임 최적화 팁 https://divillysausages.com/2016/01/21/performance-tips-for-unity-2d-mobile/
최근 글

[Unity3D] 모바일에서 스크롤바 안에 있는 버튼 클릭 문제

해당 씬 이벤트시스템에 아래 코드를 적용하면 된다. using UnityEngine; using UnityEngine.EventSystems; /// /// Sets the drag threshold for an EventSystem as a physical size based on DPI. /// public class PhysicalDragThreshold : MonoBehaviour {  private const float inchToCm = 2.54f;  [SerializeField]  private EventSystem eventSystem = null;  [SerializeField]  private float dragThresholdCM = 0.5f;  void Start ()  {   if (eventSystem == null)   {    eventSystem = GetComponent();   }   SetDragThreshold();  }  private void SetDragThreshold()  {   if (eventSystem != null)   {    eventSystem.pixelDragThreshold = (int)(_dragThresholdCM * Screen .DPI / inchToCm);   }  } }

[UNITY3D] iOS Xcode로 archive를 하는데 먹통이 되는 현상

Too slow to compile archive in xcode (IL2CPP) 오늘 하루종일 한 일이 배포용 버전 만드는 일이었다. ㅎㅎ 개발 버전으로 빌드 테스트 잘 되어서 외부 테스터들을 위해서  배포 버전을 만드는데 계속 archiving  에서 먹통..ㅠㅠ 30분을 기다려보고 재부팅하고 다시 한시간을 기다려봐도 깜깜 무소식이다. 활성 상태 보기로 체크 해보니 clang 이란 놈이 메모리 16G 중에 15G를 잡아 먹고 있었다. 이건 기다려서 해결될 일이 아니다. ㅎㅎㅎ 구글신의 도움으로  프로젝트 중에  Hashtable 쓰는 곳이 있으면   clang 컴파일러가  Hashtable가 사용된  코드를 미친듯이 풀어헤쳐 버리는 듯 한 것같다. 그래서 Unity에서 사용하는 구조체 중에 Hashtable 사용하는 구조는 폐기해버렸나 보다 (이제야 이해가 되는듯 ㅋㅋ) WWW 클래스 에서 쿠키 값 저장하는데 Hashtable 폐기되고  Dictionary 구조체를 사용하게 바뀌어 있었는데  하여튼 지금 상으로 해결 방법은 Unity Project에서 사용되는 코드를 바꾸던가 아니면  Xcode setting 에서 optimization level 을 0으로 설정하면 된다. 어떤 날은 미친듯이 진도 나가는 날이 있지만, 어떤 날은 미친듯이 한 문제만 푸는 날도 있네.. ^^; 그래도 감사하게도 해결했으니 편히 잠을 자는구다. 참고한 링크  http://fogbugz.unity3d.com/default.asp?721062_n482bt9n4qm7ejgb IOS IL2CPP Freeze in xCODE on default optimization level There's nothing with my system that's the problem. I don't have any code to attach. Basically, whenever we built our game for

[InAppBilling] Error checking for billing v3 support. (response: 3: Billing Unavailable)

오랫만에 인앱결제를 붙이는 작업을 진행하는데 무조건   Error checking for billing v3 support. (response: 3: Billing Unavailable)  이런 에러를 계속해서 쏟아내서 반나절 이상 고생했다. 결론은 구글 개발자 콘솔에서  정보를 전부 다 올리고 알파테스트나 베타테스트로 설정하고 출시까지 해야  정상적인 상품리스트를 읽어 오기 시작하였다.  ㅠㅠ 이 글이 많은 사람들의 시간을 아꼈으면 합니다. ㅎㅎㅎ

[Unity3D] 유니티 내장 로컬 푸쉬 기능

 유니티 내장 로컬 푸쉬 기능  - iOS에서만 가능, Android는 직접 개발하던가 Plugin 사용  먼저 등록을 해주고 ( 등록 안하면 작동 안함 ) public void InitNotification() { #if UNITY_ANDROID #elif UNITY_IOS UnityEngine.iOS.NotificationServices.RegisterForNotifications( UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Sound ); #endif } 시간을 정해서 등록해준다.( 3일동안 접속 안할 경우 알림이 오게 한다면 ) public void ScheduleNotification() { //Affer 3 Day string _body01 = "다시 시작해볼까요?"; #if UNITY_IOS UnityEngine.iOS.LocalNotification notiWake = new UnityEngine.iOS.LocalNotification(); DateTime theTime_Wake = DateTime.Now; theTime_Wake = theTime_Wake.AddHours(24*3); Debug.Log("theTime_Wake:"+theTime_Wake); notiWake.fireDate = theTime_Wake; notiWake.alertAction = "타이틀"; notiWake.alertBody = _body01; notiWake.soundName = UnityEngine.iOS.LocalNotification.defaultSoundName; UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(notiWake); #elif UNITY_ANDROID #endif } 취소 함수를