コード例 #1
0
ファイル: StarGame.cs プロジェクト: minh3d/TestCB
	void Update() {
		if (Input.GetKeyDown(KeyCode.Escape)) {
			MobileNativeDialog dialog = new MobileNativeDialog("Info", "Do you want to quit this game ?");
			dialog.addEventListener(BaseEvent.COMPLETE, OnDialogClose);
			
		}
	}
コード例 #2
0
    void ShowUpdatePopup(string url)
    {
        if (string.IsNullOrEmpty(url))
        {
            return;
        }
        _storeUrl = url;
#if !UNITY_EDITOR
        if (Application.systemLanguage == SystemLanguage.Japanese)
        {
            string             title   = "「合戦-戦国絵巻-」の最新バージョンがあります";
            string             message = "更新しますか?";
            string             yes     = "はい";
            string             no      = "いいえ";
            MobileNativeDialog dialog  = new MobileNativeDialog(title, message, yes, no);
            dialog.OnComplete += OnPopUpClose;
        }
        else
        {
            string             title   = "There is an update of the application";
            string             message = "Do you want to update the application?";
            string             yes     = "Yes";
            string             no      = "No";
            MobileNativeDialog dialog  = new MobileNativeDialog(title, message, yes, no);

            dialog.OnComplete += OnPopUpClose;
        }
#endif
    }
コード例 #3
0
     void Update()
     {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             MobileNativeDialog dialog = new MobileNativeDialog("Dialog Title", "Dialog message");
             //   Application.Quit();
             dialog.OnComplete += OnDialogClose;
         }
 #endif
     }
コード例 #4
0
ファイル: GamePlay.cs プロジェクト: PeyTy/InVitro
    void UpdateEscape()
    {
#if UNITY_ANDROID
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            MobileNativeDialog dialog = new MobileNativeDialog("Quit Game", "Do you want to quit?");
            dialog.OnComplete += OnDialogClose;
        }
#endif
    }
コード例 #5
0
    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 PopUp with events"))
        {
            MobileNativeRateUs ratePopUp = new MobileNativeRateUs("Like this game?", "Please rate to support future updates!");
            ratePopUp.SetAppleId(appleId);
            ratePopUp.SetAndroidAppUrl(androidAppUrl);
            ratePopUp.OnComplete += OnRatePopUpClose;

            ratePopUp.Start();
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog PopUp"))
        {
            MobileNativeDialog dialog = new MobileNativeDialog("Dialog Titile", "Dialog message");
            dialog.OnComplete += OnDialogClose;

            Invoke("Dismiss", 2.0f);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message PopUp"))
        {
            MobileNativeMessage msg = new MobileNativeMessage("Message Titile", "Message message");
            msg.OnComplete += OnMessageClose;
        }

        StartY += YButtonStep;
        StartX  = XStartPos;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Prealoder"))
        {
            MNP.ShowPreloader("Title", "Message");
            Invoke("OnPreloaderTimeOut", 3f);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Prealoder"))
        {
            MNP.HidePreloader();
        }
    }
コード例 #6
0
ファイル: MNUseExample.cs プロジェクト: sonxoans2/Tap-Rotate
	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 PopUp with events")) {
			MobileNativeRateUs ratePopUp =  new MobileNativeRateUs("Like this game?", "Please rate to support future updates!");
			ratePopUp.SetAppleId(appleId);
			ratePopUp.SetAndroidAppUrl(apdroidAppUrl);
			ratePopUp.OnComplete += OnRatePopUpClose;

			ratePopUp.Start();


		}
		
		
		StartX += XButtonStep;
		if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog PopUp")) {
			MobileNativeDialog dialog = new MobileNativeDialog("Dialog Titile", "Dialog message");
			dialog.OnComplete += OnDialogClose;

		}
		
		
		StartX += XButtonStep;
		if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message PopUp")) {
			MobileNativeMessage msg = new MobileNativeMessage("Message Titile", "Message message");
			msg.OnComplete += OnMessageClose;
		}

		StartY += YButtonStep;
		StartX = XStartPos;
		if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Prealoder")) {
			MNP.ShowPreloader("Title", "Message");
			Invoke("OnPreloaderTimeOut", 3f);
		}

		StartX += XButtonStep;
		if(GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Prealoder")) {
			MNP.HidePreloader();
		}
		
	}
コード例 #7
0
    void Start()
    {
        ThirdManager.instance.ShowLoading(false);
        instance = this;

        AudioController.Stop("Music");
        if (!AudioController.IsPlaying("Menu"))
        {
            AudioController.Play("Menu");
        }

        GameData.playCnt++;
        PlayerPrefs.SetInt("playCnt", GameData.playCnt);
        if (!SaveStats.instance._levelComplete) // if success
        {
            MobileNativeDialog dialog = new MobileNativeDialog("Share!", "You have completed this mission. Share it with friends?");
            dialog.OnComplete += OnDialogClose;
        }

        if (GameData.playCnt % 30 == 0 && GameData.playCnt > 0)
        {
            MobileNativeRateUs ratePopUp;
            if (Language.CurrentLanguage() == LanguageCode.ZH)
            {
                ratePopUp       = new MobileNativeRateUs("诚求您的反馈", "您的反馈对我们意味着很多.");
                ratePopUp.yes   = "现在行动";
                ratePopUp.later = "以后再说";
                ratePopUp.no    = "惨忍拒绝";
            }
            else
            {
                ratePopUp = new MobileNativeRateUs("Rate Mission Day", "Please take a moment to help us by providing your feedback. Thank you for your support.");
            }
            ratePopUp.SetAppleId(appleId);
            ratePopUp.SetAndroidAppUrl(apdroidAppUrl);
            ratePopUp.OnComplete += OnRatePopUpClose;

            ratePopUp.Start();
        }
    }
コード例 #8
0
ファイル: Libero.cs プロジェクト: mutatis/ElderChef
 public void Show()
 {
     MobileNativeDialog msg = new MobileNativeDialog(achievementName, descricao);
     msg.OnComplete += OnDialogClose;
 }
コード例 #9
0
	//QuitGame PopUp
	public void ShowQuitGamePopUp(){
		MobileNativeDialog quitGameDialog = new MobileNativeDialog ("Exit Game", "Are you sure you want to exit the game?");
		quitGameDialog.OnComplete += OnQuitGameDialogClose;
	}
コード例 #10
0
	//Home PopUp
	public void ShowHomePopUp(){
		MobileNativeDialog homeDialog = new MobileNativeDialog ("Main Menu", "Are you sure? Your progress will be lost !");
		homeDialog .OnComplete += OnhomeDialogClose;
	}
コード例 #11
0
    public void ShowMessage(string gameName, string currentVersion, System.Action <bool, string> callback)
    {
        restApi.ResourceAt(SConstants.CheckVersionUrl + gameName)
        .Get(response => {
            if (response != null && !response.HasError)
            {
                if (response.Resource != null)
                {
//						Hashtable data = (Hashtable)response.Resource["data"];

                    SMessageResult result = new SMessageResult(response.Resource);
                    if (result.ShouldShow)
                    {
                        switch (result.Condition)
                        {
                        case SMessageCondition.CheckVersion:
                            var ver1 = new System.Version(currentVersion);
                            var ver2 = new System.Version(result.Version);

                            var compareResult = ver2.CompareTo(ver1);


                            if (compareResult > 0)
                            {
                                MobileNativeDialog dialog = new MobileNativeDialog(result.Title, result.MessageDialog, "OK", "Cancel");
                                dialog.OnComplete        += OnDialogClose;

                                                                        #if UNITY_IOS
                                this.ActionURL = result.iOSAction;
                                                                        #elif UNITY_ANDROID
                                this.ActionURL = result.AndroidAction;
                                                                        #elif UNITY_WP8 || UNITY_WP8_1
                                this.ActionURL = result.WPAction;
                                                                        #endif

                                callback(true, "Show Message");
                            }
                            break;

                        case SMessageCondition.UnCheckVersion:

                            MobileNativeDialog dialogMessage = new MobileNativeDialog(result.Title, result.MessageDialog, "OK", "Cancel");
                            dialogMessage.OnComplete        += OnDialogClose;

                                                                #if UNITY_IOS
                            this.ActionURL = result.iOSAction;
                                                                #elif UNITY_ANDROID
                            this.ActionURL = result.AndroidAction;
                                                                #elif UNITY_WP8 || UNITY_WP8_1
                            this.ActionURL = result.WPAction;
                                                                #endif

                            callback(true, "Show Message");
                            break;
                        }
                    }
                    else
                    {
                        callback(false, "Not show popup.");
                    }
                }
                else
                {
                    callback(false, "Null response.");
                }
            }
            else
            {
                callback(false, "Cannot handle response.");
            }
        });
    }
コード例 #12
0
ファイル: MessageHandler.cs プロジェクト: jmoraltu/KatoizApp
 private void InviteUserToPlay()
 {
     MobileNativeDialog confirmDialog = new MobileNativeDialog("Katoiz", "Do you want to invite this friend to a new game?");
     confirmDialog.OnComplete += OnSaveDialogClose;
 }
コード例 #13
0
ファイル: MessageHandler.cs プロジェクト: jmoraltu/KatoizApp
 public static void ShowQuitGame()
 {
     MobileNativeDialog confirmDialog = new MobileNativeDialog("Katoiz", "Do you want to quit the game?");
     confirmDialog.OnComplete += OnSaveDialogCloseQuitGame;
 }
コード例 #14
0
ファイル: GamePlay3.cs プロジェクト: minh3d/TestCB
	// Update is called once per frame
	void Update () {
		if (Time.time >= lastRotate && circleTime.fillAmount < 1 && playing) {
			circleTime.fillAmount += delta;
			lastRotate = Time.time + rotateRate;
			if (circleTime.fillAmount >= 1) {
				//newLevel();
				GameOver();
			}
		}
		if (Input.GetKeyDown(KeyCode.Escape)) {
			MobileNativeDialog dialog = new MobileNativeDialog("Info", "Do you want back to main menu ?");
			dialog.addEventListener(BaseEvent.COMPLETE, OnDialogClose);
			Time.timeScale = 0;
		}
	}
コード例 #15
0
	//Buy Avatar PopUp
	public void ShowBuyAvatarPopUp(){
		MobileNativeDialog buyAvatarDialog = new MobileNativeDialog ("Buy Avatar", "Are you sure, you want to buy this kitty ?");
		buyAvatarDialog.OnComplete += OnBuyAvatarDialogClose;
	}