[Unity3D]씬이 바뀌어도 유지할 수 있는 오브젝트 생성하기 2월 27, 2011 다른 씬을 로드하여도 유지할 수 있는 오브젝트를 가지고 있으면 게임 스테이지가 끝날 때마다 파일을 저장하고 부를 필요가 없어진다. 키워드 DontDestroyOnLoad() function Awake () { DontDestroyOnLoad (transform.gameObject); } 공유 공유 링크 만들기 Facebook X Pinterest 이메일 기타 앱 태그 Unity Unity3D Unity프로그래밍 공유 공유 링크 만들기 Facebook X Pinterest 이메일 기타 앱 댓글
[Unity3D] 유니티 내장 로컬 푸쉬 기능 2월 20, 2017 유니티 내장 로컬 푸쉬 기능 - 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 } 취소 함수를... 자세한 내용 보기
[InAppBilling] Error checking for billing v3 support. (response: 3: Billing Unavailable) 2월 20, 2017 오랫만에 인앱결제를 붙이는 작업을 진행하는데 무조건 Error checking for billing v3 support. (response: 3: Billing Unavailable) 이런 에러를 계속해서 쏟아내서 반나절 이상 고생했다. 결론은 구글 개발자 콘솔에서 정보를 전부 다 올리고 알파테스트나 베타테스트로 설정하고 출시까지 해야 정상적인 상품리스트를 읽어 오기 시작하였다. ㅠㅠ 이 글이 많은 사람들의 시간을 아꼈으면 합니다. ㅎㅎㅎ 자세한 내용 보기
[Unity3D] 모바일에서 스크롤바 안에 있는 버튼 클릭 문제 6월 22, 2017 해당 씬 이벤트시스템에 아래 코드를 적용하면 된다. 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); } } } 자세한 내용 보기
댓글