示例#1
0
        public bool IsDeviceRegisterNeeded()
        {
            GamedoniaPushNotifications   pushScript  = this.GetComponent <GamedoniaPushNotifications>();
            GamedoniaStoreInAppPurchases inappScript = this.GetComponent <GamedoniaStoreInAppPurchases>();

            return(pushScript != null || inappScript != null);
        }
        void Awake()
        {
            //make sure we only have one object with this Gamedonia script at any time
            if (_instance != null)
            {
                Destroy(gameObject);
                return;
            }

            _instance     = this;
            notifications = new List <Dictionary <string, object> >();
            DontDestroyOnLoad(this);

                        #if UNITY_EDITOR
                        #elif UNITY_IOS
                                #if UNITY_5
            if ((notificationType & UnityEngine.iOS.NotificationType.Badge) != 0 && clearBadgeOnActivate)
            {
                ClearBadge();
            }
                                #else
            if ((notificationType & RemoteNotificationType.Badge) != 0 && clearBadgeOnActivate)
            {
                ClearBadge();
            }
                                #endif
                        #endif

            /*
             * GDService service = new GDService();
             * service.ProfileEvent += new ProfilerEventHandler(Profile);
             * GamedoniaDevices.services.Add(service);
             */


            if (!Application.isEditor)
            {
                RegisterForRemoteNotifications();
            }
        }