Ejemplo n.º 1
0
        void MovieRewardCallback(ArrayList vars)
        {
            int    stateName    = (int)vars[0];
            string appID        = (string)vars[1];
            string adnetworkKey = (string)vars[2];

            AdfurikunMovieRewardUtility.ADF_MovieStatus state = (AdfurikunMovieRewardUtility.ADF_MovieStatus)stateName;
            switch (state)
            {
            case AdfurikunMovieRewardUtility.ADF_MovieStatus.PrepareSuccess:
                //"準備完了"
                break;

            case AdfurikunMovieRewardUtility.ADF_MovieStatus.StartPlaying:
                //"再生開始"
                break;

            case AdfurikunMovieRewardUtility.ADF_MovieStatus.FinishedPlaying:
                //"再生完了"
                Screen.orientation = ScreenOrientation.Portrait;
                //ここで報酬を付与します
                if (finishCallBack != null)
                {
                    finishCallBack.Invoke();
                }
                break;

            case AdfurikunMovieRewardUtility.ADF_MovieStatus.FailedPlaying:
                //"再生失敗"
                Screen.orientation = ScreenOrientation.Portrait;
                break;

            case AdfurikunMovieRewardUtility.ADF_MovieStatus.AdClose:
                //"動画を閉じた"
                Screen.orientation = ScreenOrientation.Portrait;
                if (closeCallBack != null)
                {
                    closeCallBack.Invoke();
                }
                SoundManger.Instance.PauseBgm(false);
                break;

            default:
                return;
            }
        }
Ejemplo n.º 2
0
    void MovieRewardCallback(ArrayList vars)
    {
        int    stateName    = (int)vars[0];
        string appID        = (string)vars[1];
        string adnetworkKey = (string)vars[2];

        AdfurikunMovieRewardUtility.ADF_MovieStatus state = (AdfurikunMovieRewardUtility.ADF_MovieStatus)stateName;
        switch (state)
        {
        case AdfurikunMovieRewardUtility.ADF_MovieStatus.PrepareSuccess:
            //"準備完了"
            resultText.text += "リワード動画:準備完了\n";
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.StartPlaying:
            //"再生開始"
            resultText.text += "リワード動画:再生開始\n";
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.FinishedPlaying:
            //"再生完了"
            Screen.orientation = ScreenOrientation.Portrait;
            resultText.text   += "リワード動画:再生完了\n";
            //ここで報酬を付与します
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.FailedPlaying:
            //"再生失敗"
            Screen.orientation = ScreenOrientation.Portrait;
            resultText.text   += "リワード動画:再生失敗\n";
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.AdClose:
            //"動画を閉じた"
            Screen.orientation = ScreenOrientation.Portrait;
            resultText.text   += "リワード動画:動画を閉じた\n";
            break;

        default:
            resultText.text += "リワード動画:その他\n";
            return;
        }
    }
Ejemplo n.º 3
0
    void MovieRewardCallback(ArrayList vars)
    {
        int    stateName    = (int)vars[0];
        string appID        = (string)vars[1];
        string adnetworkKey = (string)vars[2];

        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource>();
        audioSources[0].Play();
        Message msg  = new Message();
        string  text = "";


        AdfurikunMovieRewardUtility.ADF_MovieStatus state = (AdfurikunMovieRewardUtility.ADF_MovieStatus)stateName; switch (state)
        {
        case AdfurikunMovieRewardUtility.ADF_MovieStatus.PrepareSuccess:
            Debug.Log("The ad was preapred.");
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.StartPlaying:
            Debug.Log("The ad was started.");
            break;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.AdClose:
            Screen.orientation = ScreenOrientation.LandscapeLeft;

            //set count data
            int movieCount = PlayerPrefs.GetInt("movieCount");
            movieCount = movieCount + 1;
            PlayerPrefs.SetInt("movieCount", movieCount);

            //stop running gunzei
            CyouteiPop CyouteiPop = new CyouteiPop();
            CyouteiPop.stopGunzei();

            if (!hyourouFlg)
            {
                int    busyoDamaQty = 0;
                string atariMsg     = "";
                float  rankPercent  = UnityEngine.Random.value;
                rankPercent = rankPercent * 100;
                if (rankPercent <= 10)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Big Hit! \n";
                    }
                    else
                    {
                        atariMsg = "大当たりですぞ。\n";
                    }
                    busyoDamaQty = UnityEngine.Random.Range(20, 51);     //20-50
                }
                else if (10 < rankPercent && rankPercent <= 40)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Mid Hit. \n";
                    }
                    else
                    {
                        atariMsg = "中当たりですぞ。\n";
                    }
                    busyoDamaQty = UnityEngine.Random.Range(10, 21);     //10-20
                }
                else if (40 < rankPercent)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Low Hit. \n";
                    }
                    else
                    {
                        atariMsg = "小当たりですぞ。\n";
                    }
                    busyoDamaQty = UnityEngine.Random.Range(5, 11);     //5-10
                }

                if (Application.systemLanguage != SystemLanguage.Japanese)
                {
                    text = atariMsg + "You got " + busyoDamaQty + " stone.";
                }
                else
                {
                    text = atariMsg + "武将珠を" + busyoDamaQty + "個手に入れましたぞ。";
                }
                msg.makeMessageOnBoard(text);

                int busyoDama    = PlayerPrefs.GetInt("busyoDama");
                int newBusyoDama = busyoDama + busyoDamaQty;
                PlayerPrefs.SetInt("busyoDama", newBusyoDama);
                PlayerPrefs.Flush();
                GameObject.Find("BusyoDamaValue").GetComponent <Text>().text = newBusyoDama.ToString();
            }
            else
            {
                int    hyourouQty  = 0;
                string atariMsg    = "";
                float  rankPercent = UnityEngine.Random.value;
                rankPercent = rankPercent * 100;
                if (rankPercent <= 10)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Big Hit! \n";
                    }
                    else
                    {
                        atariMsg = "大当たりですぞ。\n";
                    }
                    hyourouQty = UnityEngine.Random.Range(30, 51);     //30-50
                }
                else if (10 < rankPercent && rankPercent <= 40)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Mid Hit. \n";
                    }
                    else
                    {
                        atariMsg = "中当たりですぞ。\n";
                    }
                    hyourouQty = UnityEngine.Random.Range(20, 31);     //20-30
                }
                else if (40 < rankPercent)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        atariMsg = "My lord, Low Hit. \n";
                    }
                    else
                    {
                        atariMsg = "小当たりですぞ。\n";
                    }
                    hyourouQty = UnityEngine.Random.Range(10, 21);     //10-20
                }

                if (Application.systemLanguage != SystemLanguage.Japanese)
                {
                    text = atariMsg + "You got " + hyourouQty + " stamina.";
                }
                else
                {
                    text = atariMsg + "兵糧を" + hyourouQty + "個手に入れましたぞ。";
                }
                msg.makeMessageOnBoard(text);

                int hyourou    = PlayerPrefs.GetInt("hyourou");
                int newHyourou = hyourou + hyourouQty;
                if (newHyourou > 100)
                {
                    newHyourou = 100;
                }
                PlayerPrefs.SetInt("hyourou", newHyourou);
                PlayerPrefs.Flush();
                GameObject.Find("HyourouCurrentValue").GetComponent <Text>().text = newHyourou.ToString();
            }

            audioSources[3].Play();
            if (SceneManager.GetActiveScene().name == "mainStage")
            {
                GameObject          ob = GameObject.Find("GameController");
                MainStageController mc = ob.GetComponent <MainStageController>();
                mc.adRunFlg = false;
            }
            GameObject.Find("MessageStaminaObject").transform.FindChild("Close").GetComponent <CloseMessageStamina>().OnClick();

            break;

        default:
            return;

        case AdfurikunMovieRewardUtility.ADF_MovieStatus.FailedPlaying:
            audioSources[4].Play();
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                text = "There is no available video now. Please try it later.";
            }
            else
            {
                text = "再生可能な動画広告がありません。時間を置いて試してくだされ。";
            }
            msg.makeMessageOnBoard(text);
            if (SceneManager.GetActiveScene().name == "mainStage")
            {
                GameObject          ob = GameObject.Find("GameController");
                MainStageController mc = ob.GetComponent <MainStageController>();
                mc.adRunFlg = false;
            }

            break;
            //case AdfurikunMovieRewardUtility.ADF_MovieStatus.AdClose:
            //        Debug.Log("The ad was closed.");
            //break;
            //default:
            //return;
        }
    }