Example #1
0
    // Use this for initialization
    void Start()
    {
        // 設定を反映
        bool bgm = EncryptedPlayerPrefs.LoadBool(Const.KEY_BGM_ON, true);

        Sound.Instans.audioSource.mute = !bgm;
        bool se = EncryptedPlayerPrefs.LoadBool(Const.KEY_SE_ON, true);

        Sound.Instans.seAudioSource.mute = !se;
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        int playerPos = EncryptedPlayerPrefs.LoadInt(Const.KEY_PLAYERPOS, GameMaster.CtrRight);

        SetPlayerPosImage(playerPos);
        int gameLevel = EncryptedPlayerPrefs.LoadInt(Const.KEY_LEVEL, Const.GAME_LEVEL_NOMAL);

        SetLevelImage(gameLevel);

        bool bgm = EncryptedPlayerPrefs.LoadBool(Const.KEY_BGM_ON, true);

        SetBgmImage(bgm);
        bool se = EncryptedPlayerPrefs.LoadBool(Const.KEY_SE_ON, true);

        SetSeImage(se);
    }
Example #3
0
    void Init()
    {
        dead             = false;
        soundButtonImage = soundButtonObj.GetComponent <Image> ();
        bool isSound = EncryptedPlayerPrefs.LoadBool(Const.KEY_SOUND, true);

        if (isSound)
        {
            soundButtonImage.sprite = soundOnImage;
            SoundController.Instance.SetSound(true);
        }
        else
        {
            soundButtonImage.sprite = soundOffImage;
            SoundController.Instance.SetSound(false);
        }

        int        charaNo = EncryptedPlayerPrefs.LoadInt(Const.KEY_CHARA, 0);
        GameObject chara   = charactors [charaNo];

        Instantiate(chara, chara.transform.position, chara.transform.rotation);
        score     = 0;
        scoreText = ScoreObj.GetComponent <TextMeshProUGUI> ();

        maxScoreText = MaxScoreObj.GetComponent <TextMeshProUGUI> ();
        pointText    = PointObj.GetComponent <TextMeshProUGUI> ();
        maxScore     = EncryptedPlayerPrefs.LoadInt(Const.KEY_MAX_SCORE, 0);
        point        = EncryptedPlayerPrefs.LoadInt(Const.KEY_POINT, 0);

        uploadScore       = EncryptedPlayerPrefs.LoadInt(Const.KEY_UPD_SCORE, 0);
        maxScoreText.text = maxScore.ToString();
        pointText.text    = point.ToString();
        rewardButton.SetActive(false);
        reawrdedTextObj.SetActive(false);
        Admanager.bannerView.Hide();
        isNetConnect = (Application.internetReachability != NetworkReachability.NotReachable);
    }
Example #4
0
 void Awake()
 {
     Instance         = this;
     audioSource      = GetComponent <AudioSource> ();
     audioSource.mute = !EncryptedPlayerPrefs.LoadBool(Const.KEY_SOUND, true);
 }
Example #5
0
    IEnumerator OnRetry()
    {
        yield return(new WaitForSeconds(1.0f));

        string imagePath = Application.persistentDataPath + "/screenShot.png";

        if (File.Exists(imagePath))
        {
            byte[]    image   = File.ReadAllBytes(imagePath);
            Texture2D texture = new Texture2D(0, 0);
            texture.LoadImage(image);

            Sprite imageSprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
            resultImage.GetComponent <Image> ().sprite = imageSprite;
        }
        canvas.SetActive(true);
        dead = true;
        Admanager.bannerView.Show();
        int random = Random.Range(0, 100);

        if (random <= 10)
        {
            if (Advertisement.IsReady("rewardedVideo"))
            {
                rewardButton.SetActive(true);
            }
        }

                #if UNITY_ANDROID
        //レビュー依頼はAndroidのみ
        if (isNetConnect)
        {
            //ネット接続しているときのみ
            if (score >= 100)
            {
                bool reviewFlg2 = EncryptedPlayerPrefs.LoadBool(Const.KEY_REVIEW_FLG2, false);
                bool isReviewOn = EncryptedPlayerPrefs.LoadBool(Const.KEY_REVIEW_ON_FLG, false);
                if (!isReviewOn && !reviewFlg2)
                {
                    // 50の時にレビューしてない場合は100以上で再度レビュー依頼
                    DialogManager.Instance.SetLabel("YES!", "NO..", "CLOSE");
                    DialogManager.Instance.ShowSelectDialog("Amazing!\nPlease Review!", (bool result) => {
                        if (result)
                        {
                            Application.OpenURL(Const.ANDROID_URL);
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_FLG2, true);
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_ON_FLG, true);
                        }
                        else
                        {
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_FLG2, true);
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_ON_FLG, true);
                        }
                    });
                }
            }
            else if (score >= 50)
            {
                //50以上出したら一回だけレビュー依頼
                bool reviewFlg = EncryptedPlayerPrefs.LoadBool(Const.KEY_REVIEW_FLG, false);
                if (!reviewFlg)
                {
                    DialogManager.Instance.SetLabel("YES!", "NO..", "CLOSE");
                    DialogManager.Instance.ShowSelectDialog("Please Review.", (bool result) => {
                        if (result)
                        {
                            Application.OpenURL(Const.ANDROID_URL);
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_FLG, true);
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_ON_FLG, true);
                        }
                        else
                        {
                            EncryptedPlayerPrefs.SaveBool(Const.KEY_REVIEW_FLG, true);
                        }
                    });
                }
            }
        }
                #endif
    }