public static void ShowPreloader()
    {
        if (TimeOutTask != null)
        {
            return;
        }

        TimeOutTask = MultiplayerPreloaderTimeoutTask.Create();


        if (Application.platform == RuntimePlatform.Android)
        {
            AndroidNativeUtility.ShowPreloader("", "");
        }

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            IOSNativeUtility.ShowPreloader();
        }
    }
Ejemplo n.º 2
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------


    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Native Pop-ups", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Rate Pop-up with events"))
        {
            IOSRateUsPopUp rate = IOSRateUsPopUp.Create("Like this game?", "Please rate to support future updates!");
            rate.OnComplete += onRatePopUpClose;
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog Pop-up"))
        {
            IOSDialog dialog = IOSDialog.Create("Dialog Title", "Dialog message");
            dialog.OnComplete += onDialogClose;
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message Pop-up"))
        {
            IOSMessage msg = IOSMessage.Create("Message Title", "Message body");
            msg.OnComplete += onMessageClose;
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dismissed Pop-up"))
        {
            Invoke("dismissAlert", 2f);
            IOSMessage.Create("Hello", "I will die in 2 sec");
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Open App Store"))
        {
            IOSNativeUtility.RedirectToAppStoreRatingPage();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Preloader "))
        {
            IOSNativeUtility.ShowPreloader();
            Invoke("HidePreloader", 3f);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Preloader"))
        {
            HidePreloader();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Locale"))
        {
            IOSNativeUtility.OnLocaleLoaded += GetLocale;
            IOSNativeUtility.Instance.GetLocale();
        }
    }