IEnumerator Setup()
    {
        state = TitleState.Input;

        GameStateInformation.IsEnglish = false;

#if UNITY_EDITOR
        const string UrlRes = @"http://*****:*****@"http://custom-sb.azurewebsites.net/Unity/Resource/lng";
#endif

        //OTPを取得
        //WWW www = new WWW(UrlRes);
        yield return(null);

        //while (www.isDone == false || www.progress != 1)
        //{
        //    yield return null;
        //}

        //yield return www;

        //if (CommonFunction.IsNull(www.error) == false)
        //{
        //    www.Dispose();
        //}
        //else
        //{
        //    if (www.text == "en")
        //    {
        //        GameStateInformation.IsEnglish = true;
        //    }
        //}

        TitleJp = GameObject.Find("TitleImage");
        TitleEn = GameObject.Find("TitleImageEng");

        if (GameStateInformation.IsEnglish == true)
        {
            GameObject.Find("OnEnglish").GetComponent <Toggle>().isOn = true;
            CommonConst.Message.SetEn();
            CommonConst.DeathMessage.SetEn();
            CommonFunction.SetActive(TitleEn, true);
            CommonFunction.SetActive(TitleJp, false);
        }
        else
        {
            GameObject.Find("OnEnglish").GetComponent <Toggle>().isOn = false;
            CommonConst.Message.SetJp();
            CommonConst.DeathMessage.SetJp();
            CommonFunction.SetActive(TitleEn, false);
            CommonFunction.SetActive(TitleJp, true);
        }

        //バナー表示
        //AdMobExt.bannerView.Show();
        //StartCoroutine(CheckStartup());

        ManageNews.Setup();

        GameObject.Find("TitleSubText").GetComponent <Text>().text = CommonConst.Message.SubTitle;

        GameObject gm = new GameObject("FloorChanger");
        _manageFade = gm.AddComponent <ManageFade>();
        _manageFade.SetupFade();
        _manageFade.Wait = 0.01f;
        _manageFade.PlayFadeOut(false, 0.5f);

        SelectedList = new Dictionary <int, GameObject>();

        GameObject.Find("OnBGMCheck").GetComponent <Toggle>().isOn =
            MusicInformation.Music.IsMusicOn;

        GameObject.Find("OnSoundCheck").GetComponent <Toggle>().isOn =
            SoundInformation.Sound.IsPlay;

        GameObject.Find("OnVoiceCheck").GetComponent <Toggle>().isOn =
            VoiceInformation.Voice.IsPlay;

        GameObject.Find("NameInputField").GetComponent <InputField>().text = ScoreInformation.Info.PlayerNameBase;

        SelectTargetPanel          = GameObject.Find("SelectTargetPanel");
        ScrollViewSelected         = GameObject.Find("SelectTargetScrollView");
        ScrollViewSelectedUnit     = GameObject.Find("SelectUnit");
        ScrollViewSelectedContents = GameObject.Find("SelectTargetContent");

        MusicInformation.Music.Setup(MusicInformation.MusicType.Title);

        StringBuilder sb = new StringBuilder();
        //キー情報の読み込み
        KeyControlModel kcm = SaveDataInformation.LoadKeyControl();
        if (CommonFunction.IsNull(kcm) == false)
        {
            KeyControlInformation.Info = kcm;
            sb.AppendLine(CommonConst.Message.KeyConfigSuccess);
        }
        KeyControlInformation.Info.OpMode = OperationMode.KeyOnly;

        GameObject.Find("PushEnter").GetComponent <Text>().text = string.Format("Push {0}", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());

        //システム情報の読み込み
        SystemInformation si = SaveDataInformation.LoadSystemInformation();
        if (CommonFunction.IsNull(si) == false)
        {
            if (CommonFunction.IsNullOrWhiteSpace(GameObject.Find("NameInputField").GetComponent <InputField>().text) == true)
            {
                GameObject.Find("NameInputField").GetComponent <InputField>().text = si.CharacterName;
            }
            MusicInformation.Music.Volume = CommonFunction.NumberToPercent(si.BGMVolume);
            SoundInformation.Sound.Volume = CommonFunction.NumberToPercent(si.SoundVolume);
            VoiceInformation.Voice.Volume = CommonFunction.NumberToPercent(si.VoiceVolume);
            sb.AppendLine(CommonConst.Message.SystemSettingSuccess);
        }
        GameObject.Find("SystemText").GetComponent <Text>().text = sb.ToString();


        //セーブデータを読み込み
        SavePlayingInformation save = SaveDataInformation.LoadPlayingValue();
        if (CommonFunction.IsNull(save) == false)
        {
            save.IsLoadSave = true;
            ResourceInformation.SaveInfo = save;
        }

        CommonFunction.SetActive(ScrollViewSelectedUnit, false);
        CommonFunction.SetActive(SelectTargetPanel, false);

        IsStart = true;
    }
Example #2
0
    private void StartMain()
    {
        GameObject gm = new GameObject("FloorChanger");

        _manageFade = gm.AddComponent <ManageFade>();
        _manageFade.SetupFade();
        _manageFade.Wait = 0.01f;
        _manageFade.PlayFadeOut(false);

        GameObject.Find("OnBGMCheck").GetComponent <Toggle>().isOn =
            MusicInformation.Music.IsMusicOn;

        GameObject.Find("OnSoundCheck").GetComponent <Toggle>().isOn =
            SoundInformation.Sound.IsPlay;

        GameObject.Find("OnVoiceCheck").GetComponent <Toggle>().isOn =
            VoiceInformation.Voice.IsPlay;

        if (KeyControlInformation.Info.OpMode == OperationMode.UseMouse)
        {
            GameObject.Find("UseMouse").GetComponent <Toggle>().isOn =
                true;
        }

        if (ScoreInformation.Info.PlayerNameBase != CommonConst.Message.UnityChanName && ScoreInformation.Info.PlayerNameBase != CommonConst.Message.StellaChanName)
        {
            GameObject.Find("NameInputField").GetComponent <InputField>().text = ScoreInformation.Info.PlayerNameBase;
        }
        else
        {
            GameObject.Find("NameInputField").GetComponent <InputField>().text = "";
        }

        //MusicInformation.Music.Setup(MusicInformation.MusicType.CharacterSelect);

        ScrollViewSelected         = GameObject.Find("SelectTargetScrollView");
        ScrollViewSelectedUnit     = GameObject.Find("SelectUnit");
        ScrollViewSelectedContents = GameObject.Find("SelectTargetContent");

        _keyDisp = GameObject.Find("KeyDisplayPanel");

        CharacterStatusPanel = GameObject.Find("CharacterStatusPanel");
        DungeonStatusPanel   = GameObject.Find("DungeonStatusPanel");

        ScrollViewSelectedUnit.SetActive(false);
        DungeonStatusPanel.SetActive(false);

        SelectedList = new Dictionary <long, GameObject>();

        _state = SelectTurnState.ManageStart;

        _keyDisp.SetActive(false);


        //ダンジョンデータを読み込み
        Dungeons = TableDungeonMaster.GetAllValue();
        //キャラクターデータを読み込み
        Characters = TablePlayer.GetAllValue();
        //初期選択を格納
        SelectCharacter = Characters.First().Value.ObjNo;
        InitialzeContent(Characters, SelectCharacter);

        MainThreadDispatcher.StartUpdateMicroCoroutine(TransSceneStart(1f));
    }
    private void Start()
    {
        GameObject gm = new GameObject("FloorChanger");

        _manageFade = gm.AddComponent <ManageFade>();
        _manageFade.SetupFade();
        _manageFade.Wait = 0.01f;
        _manageFade.PlayFadeOut(false, 2);

#if UNITY_EDITOR
        //ScoreInformation.Info.isDisrupt = true;
        //PlayerInformation.Info.PType = PlayerType.OricharChan;
#endif
        if (ScoreInformation.Info.isDisrupt == true)
        {
            GameObject.Find("TouhaFail").SetActive(false);
            GameObject.Find("TouhaSuccess").GetComponent <Text>().text = CommonConst.Message.Success;
            MusicInformation.Music.Setup(MusicInformation.MusicType.Gameclear);
            switch (PlayerInformation.Info.PType)
            {
            case PlayerType.UnityChan:
                GameObject.Find("Character").SetActive(false);
                GameObject.Find("SD_Stellachan").SetActive(false);
                GameObject.Find("SD_StellachanClear").SetActive(false);
                ActionObject = GameObject.Find("CharacterClear");
                break;

            case PlayerType.OricharChan:
                GameObject.Find("Character").SetActive(false);
                GameObject.Find("CharacterClear").SetActive(false);
                GameObject.Find("SD_Stellachan").SetActive(false);
                ActionObject = GameObject.Find("SD_StellachanClear");
                break;
            }
        }
        else
        {
            GameObject.Find("TouhaSuccess").SetActive(false);
            GameObject.Find("TouhaFail").GetComponent <Text>().text = CommonConst.Message.Failure;
            MusicInformation.Music.Setup(MusicInformation.MusicType.Gameover);
            switch (PlayerInformation.Info.PType)
            {
            case PlayerType.UnityChan:
                GameObject.Find("CharacterClear").SetActive(false);
                GameObject.Find("SD_Stellachan").SetActive(false);
                GameObject.Find("SD_StellachanClear").SetActive(false);
                ActionObject = GameObject.Find("Character");
                break;

            case PlayerType.OricharChan:
                GameObject.Find("Character").SetActive(false);
                GameObject.Find("CharacterClear").SetActive(false);
                GameObject.Find("SD_StellachanClear").SetActive(false);
                ActionObject = GameObject.Find("SD_Stellachan");
                break;
            }
        }

        fadeAlpha = 1f;

        GameObject.Find("Name").GetComponent <Text>().text        = CommonConst.Message.Name;
        GameObject.Find("Floor").GetComponent <Text>().text       = CommonConst.Message.SearchFloor;
        GameObject.Find("DungeonName").GetComponent <Text>().text = CommonConst.Message.DungeonName;
        GameObject.Find("PlayTime").GetComponent <Text>().text    = CommonConst.Message.PlayTime;
        GameObject.Find("Level").GetComponent <Text>().text       = CommonConst.Message.Level;
        GameObject.Find("Cause").GetComponent <Text>().text       = CommonConst.Message.CauseOfFailure;
        GameObject.Find("EquipWeapon").GetComponent <Text>().text = CommonConst.Message.TheMostUsedWeapon;
        GameObject.Find("EquipShield").GetComponent <Text>().text = CommonConst.Message.TheMostUsedShield;
        GameObject.Find("EquipRing").GetComponent <Text>().text   = CommonConst.Message.TheMostUsedRing;


        GameObject.Find("NameValue").GetComponent <Text>().text =
            ScoreInformation.Info.PlayerName;

        GameObject.Find("DungeonNameValue").GetComponent <Text>().text =
            ScoreInformation.Info.DungeonName;

        GameObject.Find("FloorValue").GetComponent <Text>().text =
            string.Format("{0} F", ScoreInformation.Info.Floor);

        TimeSpan t = new TimeSpan(ScoreInformation.Info.TotalTime);
        GameObject.Find("PlayTimeValue").GetComponent <Text>().text =
            string.Format("{0:0}h {1}m {2}s", Math.Floor(t.TotalHours), t.Minutes, t.Seconds);

        GameObject.Find("ScoreValue").GetComponent <Text>().text =
            string.Format("{0:#,0}", ScoreInformation.Info.Score);

        GameObject.Find("LevelValue").GetComponent <Text>().text =
            string.Format("{0}", ScoreInformation.Info.iLevel);

        GameObject.Find("EquipWeaponValue").GetComponent <Text>().text =
            ScoreInformation.Info.MostUseWeaponName;

        GameObject.Find("EquipShieldValue").GetComponent <Text>().text =
            ScoreInformation.Info.MostUseSieldName;

        GameObject.Find("EquipRingValue").GetComponent <Text>().text =
            ScoreInformation.Info.MostUseRingName;

        GameObject.Find("CauseValue").GetComponent <Text>().text =
            ScoreInformation.Info.CauseDeath;

        if (KeyControlInformation.Info.OpMode == OperationMode.UseMouse)
        {
            GameObject.Find("PushStart").GetComponent <Text>().text = string.Format("Push {0} or Mouse Double Click", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());
        }
        else
        {
            GameObject.Find("PushStart").GetComponent <Text>().text = string.Format("Push {0}", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());
        }


        StartCoroutine(ScoreInformation.Info.SendScoreCorutine(ScoreInformation.Info.GetJson()));
        StartCoroutine(TransScene(1f));
        //OnPushShare();
    }