Exemple #1
0
    public void Initialize()
    {
        _IAP.Initialize();
        _FCM.Initialize();

        // 화면 꺼짐 방지
#if UNITY_ANDROID
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
#if UNITY_IOS
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
        if (CONFIG.IsRunningAndroid())
        {
            PlatformAndroid.I.Initialize();
            curPlatform = PlatformAndroid.I;
        }
        else if (CONFIG.IsRunningiOS())
        {
            PlatformIOS.I.Initialize();
            curPlatform = PlatformIOS.I;
        }
#if UNITY_EDITOR  // test
        else
        {
            PlatformAndroid.I.Initialize();
            curPlatform = PlatformAndroid.I;
        }
#endif
    }
Exemple #2
0
 void Update()
 {
     if (CONFIG.IsRunningAndroid() || CONFIG.IsRunningiOS())
     {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             UI.I.ShowMsgBox("Are you sure you want to quit the game?", (id, args) => {
                 if (args[0].ToString() == "ok")
                 {
                     Main.I.OnQuit();
                 }
             });
         }
     }
 }
Exemple #3
0
    public void SendReqPurchase(Action <string, string> response, Action <string> timeout, string productUrl,
                                GooglePlayReceipt google, AppleInAppPurchaseReceipt apple)
    {
        if (CONFIG.IsRunningAndroid())
        {
            PK.Purchase.SendDataAndroid data = new PK.Purchase.SendDataAndroid();
            data.status        = "completed";
            data.currency      = "USD";
            data.quantity      = "1";
            data.amount        = 1.0;
            data.purchase_type = "coin";
            data.product_url   = productUrl;
            data.packageName   = google.packageName;
            data.productId     = google.productID;
            data.transactionID = google.transactionID;
            data.purchaseTime  = (double)google.purchaseDate.Ticks;
            data.purchaseState = (int)google.purchaseState;
            data.purchaseToken = google.purchaseToken;

            PK.Purchase.SENDAndroid command = new PK.Purchase.SENDAndroid(PKID.PurchaseAndroid, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.PurchaseAndroid, response, timeout);
        }
        else if (CONFIG.IsRunningiOS())
        {
            PK.Purchase.SendDataIOS data = new PK.Purchase.SendDataIOS();
            data.status        = "completed";
            data.currency      = "USD";
            data.quantity      = "1";
            data.product_url   = productUrl;
            data.purchase_type = "coin";
            data.amount        = 1.0;
            data.purchaseToken = apple.originalTransactionIdentifier;

            PK.Purchase.SENDIOS command = new PK.Purchase.SENDIOS(PKID.PurchaseIOS, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.PurchaseIOS, response, timeout);
        }
    }
Exemple #4
0
    protected override void virAwake()
    {
        if (IsScreenLow() == false)
        {
            float size = 0.6f;
            int   x    = (int)(Screen.width * size);
            int   y    = 0;

            if (Camera.main.aspect >= 2.1)// 19.5:9
            {
                y = (int)((int)(Screen.width * size) / 19.5) * 9;
            }
            else if (Camera.main.aspect > 2)// 18.5:9
            {
                y = (int)((int)(Screen.width * size) / 18.5) * 9;
            }
            else if (Camera.main.aspect == 2)// 18:9
            {
                y = ((int)(Screen.width * size) / 18) * 9;
            }
            else if (Camera.main.aspect >= 1.7)// 16:9
            {
                y = ((int)(Screen.width * size) / 16) * 9;
            }
            else if (Camera.main.aspect > 1.6)// 5:3
            {
                y = ((int)(Screen.width * size) / 5) * 3;
            }
            else if (Camera.main.aspect == 1.6)// 16:10
            {
                y = ((int)(Screen.width * size) / 16) * 10;
            }
            else if (Camera.main.aspect >= 1.5)// 3:2
            {
                y = ((int)(Screen.width * size) / 3) * 2;
            }
            else// 4:3
            {
                y = ((int)(Screen.width * size) / 4) * 3;
            }

            Debug.Log("Screen " + Screen.width + " / " + Screen.height + " / " + x + " / " + y + " / " + Camera.main.aspect);
            Screen.SetResolution(x, y, true);
        }

        // 빌드버젼 정의 및 Config File Download 절대주소 정의
        if (CONFIG.IsRunningAndroid())
        {
#if LOCAL_DEBUG
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 3, 34), "http://arthyun.asuscomm.com/SloticaMobile/");
#else
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 3, 34), "https://d3kjdk8bsa0don.cloudfront.net/mobile/");
#endif
        }
        else if (CONFIG.IsRunningiOS())
        {
            CONFIG.BuildSetting(new CONFIG.STVersion(1, 0, 0), "http://arthyun.asuscomm.com/SloticaMobileHD/");
        }

#if LOCAL_DEBUG
        this.gameObject.AddComponent <FPS>();
#endif

        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = 60;
    }