public static string GetNetworkState()
    {
#if UNITY_ANDROID
        return(WebMediator.GetNetworkType());
#else
        int state = Application.platform == RuntimePlatform.IPhonePlayer ? _getNetworkState() : 3;

        if (state <= 0)
        {
            return("disconnect");
        }
        else if (state == 1)
        {
            return("wwlan");
        }
        else if (state == 2)
        {
            return("wifi");
        }
        else
        {
            return("unknown");
        }
#endif
    }
Exemple #2
0
    void OnEnable()
    {
#if UNITY_ANDROID
        int level = 20;
        if (Obj_MyselfPlayer.GetMe().level >= level || WebMediator.GetNetworkType().Equals("3g"))
        {
            Debug.Log("open other billing button");
            otherPurchaseBtn.SetActive(true);
        }
        else
        {
            Debug.Log("close other billing button");
            otherPurchaseBtn.SetActive(false);
        }
#elif UNITY_IPHONE
        otherPurchaseBtn.SetActive(false);
#endif
        RefreshUI(true);
        if (mainLogic == null)
        {
            mainLogic = GameObject.Find("MainUILogic").GetComponent <MainUILogic>();
        }
        mainLogic.mainController.GetComponent <MainController>().showBottomBar();
    }