Ejemplo n.º 1
0
	public void activate(BetterList<RacingAI> aFinishers) {


		this.gameObject.SetActive(true);
		aFinishers.Sort(finishPositionSort);
		int i = 0;
		for(i = 0;i<aFinishers.size;i++) {
			completeMembers[i].init(aFinishers[i],i);
			
			completeMembers[i].gameObject.SetActive(true);
		}
		if(ChampionshipSeason.ACTIVE_SEASON.getTeamFromDriver(completeMembers[0].driver.driverRecord)==ChampionshipSeason.ACTIVE_SEASON.getUsersTeam()) {
			MobileNativeRateUs ratePopUp =  new MobileNativeRateUs("Enjoying Racing Manager?", "Rate us 5 Stars to help with future updates!","5 Stars","Not Right Now","Never!");
			#if UNITY_IOS
				ratePopUp.SetAppleId("975017895");
			#endif
			#if UNITY_ANDROID
				ratePopUp.SetAndroidAppUrl("market://details?id=com.blueomega.gpmanager");
			#endif
			ratePopUp.addEventListener(BaseEvent.COMPLETE,OnRatePopUpClose);
			ratePopUp.Start();
		} 
		for(int c = i;c<completeMembers.Count;c++) {
			completeMembers[i].gameObject.SetActive(false);
		}
	}
Ejemplo n.º 2
0
    void Start()
    {
        ThirdManager.isTutorial = false;
        if (!AudioController.IsPlaying("Menu"))
        {
            AudioController.Play("Menu");
        }
        AudioController.Instance.Volume = PlayerPrefs.GetFloat("Music", 1.0f);
        ThirdManager.instance.ShowLoading(false);
        ThirdManager.isPurchase = PlayerPrefs.GetInt("isPurchase", 0) == 0?false:true;

        url = "You have completed your mission. Share it with friends? \n\n ";

        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            url += "https://play.google.com/store/apps/details?id=com.peakrainbow.missionday";
            break;

        case RuntimePlatform.IPhonePlayer:
            url += "https://itunes.apple.com/app/id?mt=8";
            break;
        }

        if (!ThirdManager.isPurchase)
        {
            int delay = PlayerPrefs.GetInt("sessioncount", 0);
            if (delay >= 9)
            {
                if (PlayerPrefs.GetString("StartTime", "0") != "0")
                {
                    delay30.SetActive(true);
                }
                else
                {
                    MobileNativeRateUs adsPopUp;
                    if (Language.CurrentLanguage() == LanguageCode.ZH)
                    {
                        adsPopUp       = new MobileNativeRateUs("您的飞船已全部战损", "看广告获取飞船.");
                        adsPopUp.yes   = "¥20可获不限数量的飞船";
                        adsPopUp.no    = "不看广告,等12分钟";
                        adsPopUp.later = "看广告";
                    }
                    else
                    {
                        adsPopUp       = new MobileNativeRateUs("No More Sessions", "Watch ads to get more sessions.");
                        adsPopUp.yes   = "$2.99 for Unlimited Session";
                        adsPopUp.no    = "No, Wait 12 minutes";
                        adsPopUp.later = "Yes, watch ads";
                    }
                    adsPopUp.SetAppleId("");
                    adsPopUp.SetAndroidAppUrl("market://details?id=com.peakrainbow.missionday");
                    adsPopUp.OnComplete += OnAdsPopUpClose;

                    adsPopUp.Start();
                }
            }
        }
    }
Ejemplo n.º 3
0
    void Init(bool levelComplete)
    {
        GameData.Init();
        bestScore.text    = GameData.bestScore.ToString();
        currentScore.text = SaveStats.instance._score.ToString();
        ShowRank();

        LevelData levelData = (LevelData)(LoadData.LevelList[GameData.selectedLevel]);

        ufoDestory.text      = GameData.killedUfo.ToString();
        stonesDestroy.text   = levelData.greyStone.ToString();
        levelIcon.spriteName = "insignia" + (GameData.selectedLevel).ToString();

        //count session and show message.
        GameData.sessioncnt++;
        if (!ThirdManager.isPurchase)
        {
            if (GameData.sessioncnt < 10)
            {
                PlayerPrefs.SetInt("sessioncount", GameData.sessioncnt);
            }
            else
            {
                PlayerPrefs.SetString("StartTime", "0");
                MobileNativeRateUs adsPopUp;
                if (Language.CurrentLanguage() == LanguageCode.ZH)
                {
                    adsPopUp       = new MobileNativeRateUs("您的飞船已全部战损", "看广告获取飞船.");
                    adsPopUp.yes   = "¥20可获不限数量的飞船";
                    adsPopUp.no    = "不看广告,等12分钟";
                    adsPopUp.later = "看广告";
                }
                else
                {
                    adsPopUp       = new MobileNativeRateUs("No More Sessions", "Watch ads to get more sessions.");
                    adsPopUp.yes   = "$2.99 for Unlimited Session";
                    adsPopUp.no    = "No, Wait 12 minutes";
                    adsPopUp.later = "Yes, watch ads";
                }
                adsPopUp.SetAppleId("");
                adsPopUp.SetAndroidAppUrl("market://details?id=com.peakrainbow.missionday");
                adsPopUp.OnComplete += OnAdsPopUpClose;

                adsPopUp.Start();
            }
        }

        //count ads session count and show message.
        int later = PlayerPrefs.GetInt("ratelater", 0);

        if ((GameData.adscnt < 29 && later == 0) || later == -1)
        {
            GameData.adscnt++;
            PlayerPrefs.SetInt("adscount", GameData.adscnt);
        }
        else
        {
        }
    }
Ejemplo n.º 4
0
	void Start() {

		//rate us
		if (ratePopUp == null) {
			ratePopUp = new MobileNativeRateUs ("Like this game?", "Please rate to support future updates!");
			ratePopUp.SetAppleId ("916270150");
			ratePopUp.SetAndroidAppUrl ("https://play.google.com/store/apps/details?id=com.tap.colorfun");
			ratePopUp.addEventListener(BaseEvent.COMPLETE, OnRatePopUpClose);
		}
	}
Ejemplo n.º 5
0
    void Rate()
    {
        MobileNativeRateUs ratePopUp = new MobileNativeRateUs("Like this game?", "Please rate to support future updates!");

        #if UNITY_ANDROID
        ratePopUp.SetAndroidAppUrl(apdroidAppUrl);
        #endif

        #if UNITY_IOS
            ratePopUp.SetAppleId(appleId);
        #endif

        ratePopUp.Start();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        // Rate for app
        ratePopUp = new MobileNativeRateUs("Like this game?", "Rate my app!!!");
        ratePopUp.SetAndroidAppUrl("https://play.google.com/store/apps/details?id=com.OhGame.LookTap");

        isNextNumber = false;
        Score        = 0;
        level        = 1;
        dem          = 0;
        RankOffline  = 0;

        // Load high score
        for (int i = 0; i <= 4; i++)
        {
            ListHighScore_Entry[i]            = new HighScore_Entry();
            ListHighScore_Entry[i].Score      = PlayerPrefs.GetInt(SaveHighScore + (i + 1).ToString(), 0);
            ListHighScore_Entry[i].PlayerName = PlayerPrefs.GetString(SavePlayerName + (i + 1).ToString());
        }

        for (int i = 0; i <= 4; i++)
        {
            Debug.Log(ListHighScore_Entry[i].PlayerName + ": " + ListHighScore_Entry[i].Score.ToString());
        }

        TxtBestScore.text = ListHighScore_Entry[0].Score.ToString();

        // Audio
        SoundClickRight = (AudioSource)gameObject.AddComponent <AudioSource>();
        AudioClip RightClick_AudioClip;

        RightClick_AudioClip = (AudioClip)Resources.Load("Audio/taptap");
        SoundClickRight.clip = RightClick_AudioClip;
        SoundClickRight.loop = false;

        SoundClickWrong = (AudioSource)gameObject.AddComponent <AudioSource>();
        AudioClip WrongClick_AudioClip;

        WrongClick_AudioClip = (AudioClip)Resources.Load("Audio/wrong");
        SoundClickWrong.clip = WrongClick_AudioClip;
        SoundClickWrong.loop = false;

        // Ads
        UM_AdManager.instance.Init();
        int bannerId1 = UM_AdManager.instance.CreateAdBanner(TextAnchor.LowerCenter);

        UM_AdManager.instance.ShowBanner(bannerId1);
    }
Ejemplo n.º 7
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();
        }
    }
Ejemplo n.º 8
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(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();
		}
		
	}
Ejemplo n.º 9
0
    void Start()
    {
        //get session count

        int sessioncount = PlayerPrefs.GetInt("sessioncount", 0);

        //Debug.Log (sessioncount);

        if (sessioncount >= 10 && PlayerPrefs.GetInt("purchase", 0) == 0)
        {
            MobileNativeRateUs adsPopUp = new MobileNativeRateUs("No More Sessions", "Watch ads to get more sessions.");
            adsPopUp.yes         = "$1.99 for Unlimited Session";
            adsPopUp.no          = "No, Wait 12 minutes";
            adsPopUp.later       = "Yes";
            adsPopUp.OnComplete += OnAdsPopUpDialog;

            adsPopUp.Start();
        }
    }
Ejemplo n.º 10
0
    public void OnBack()
    {
        if (getSession)
        {
            gameObject.SetActive(false);
        }
        else
        {
            gameObject.SetActive(false);

            MobileNativeRateUs adsPopUp = new MobileNativeRateUs("No More Sessions", "Watch ads to get more sessions.");
            adsPopUp.SetAppleId("");
            adsPopUp.SetAndroidAppUrl("market://details?id=com.peakrainbow.missionday");
            adsPopUp.yes         = "$2.99 for Unlimited Session";
            adsPopUp.no          = "No, Wait 12 minutes";
            adsPopUp.later       = "Yes, watch ads";
            adsPopUp.OnComplete += OnAdsPopUpClose;

            adsPopUp.Start();
        }
    }
Ejemplo n.º 11
0
    public void _clickPlay()
    {
        gl.gameover = false;

        int sessioncount = PlayerPrefs.GetInt("sessioncount", 0);

        if (sessioncount >= 10 && PlayerPrefs.GetInt("purchase", 0) == 0)
        {
            MobileNativeRateUs adsPopUp = new MobileNativeRateUs("No More Sessions", "Watch ads to get more sessions.");
            adsPopUp.yes         = "$1.99 for Unlimited Session";
            adsPopUp.no          = "No, Wait 12 minutes";
            adsPopUp.later       = "Yes";
            adsPopUp.OnComplete += OnAdsPopUpDialog;
            adsPopUp.Start();

            return;
        }

        PlayerPrefs.SetInt("sessioncount", ++sessioncount);
        SceneManager.LoadScene("Play");
    }
Ejemplo n.º 12
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();
        }
    }
Ejemplo n.º 13
0
    public void galaxyLoseLife()
    {
        if (galaxy.getLives() > 0)
        {
            audioDeath.Play();
            galaxy.loseLife();
        }
        if (galaxy.getLives() == 0)
        {
            audioTimeTicking.Stop();
            Timer.Cancel(levelTimer);
            Timer.Cancel(spawnTimer);
            Timer.Cancel(hourglassTimer);

            finalScore          = (finalScore == -1 ? finalScore = galaxy.getLevel() * galaxy.getStarsDestroyed() : finalScore);
            textFinalScore.text = finalScore.ToString();

#if !UNITY_EDITOR
            if (askRate == 0)
            {
                MobileNativeRateUs ratePopUp = new MobileNativeRateUs("Enjoying Falling Stars?", "Please rate to support us.", "Rate Now", "Much much later", "Later");
                ratePopUp.SetAndroidAppUrl("https://play.google.com/store/apps/details?id=com.AwkwardTurtleStudios.FallingStars");
                ratePopUp.Start();
                ratePopUp.OnComplete += OnRatePopUpClose;
            }
            else if (askRate > 0)
            {
                askRate--;
                SaveRate(askRate);
            }
            if (isConnectedToGoogle)
            {
                achievementsAndLeaderBoards();
            }
#endif
        }
        textLives.text = galaxy.getLives().ToString();
    }