public void Initialize(PlayerCharacter player)
    {
        pl = player;

        SystemPanel.SetActive(true);

        IsClose = false;

        SystemPanel.transform.Find("SystemValidation").GetComponent <Text>().text = "";

        SystemPanel.transform.Find("NameInputField").GetComponent <InputField>().text
            = player.DisplayName;

        SystemPanel.transform.Find("SystemBgmHeader/OnBGMCheck").GetComponent <Toggle>().isOn              = MusicInformation.Music.IsMusicOn;
        SystemPanel.transform.Find("SystemBgmHeader/BGMVolumeSlider").GetComponent <Slider>().value        = CommonFunction.PercentToNumber(MusicInformation.Music.Volume);
        SystemPanel.transform.Find("SystemBgmHeader/BGMVolumeInputField").GetComponent <InputField>().text = CommonFunction.PercentToNumber(MusicInformation.Music.Volume).ToString();

        SystemPanel.transform.Find("SystemSoundHeader/OnSoundCheck").GetComponent <Toggle>().isOn              = SoundInformation.Sound.IsPlay;
        SystemPanel.transform.Find("SystemSoundHeader/SoundVolumeSlider").GetComponent <Slider>().value        = CommonFunction.PercentToNumber(SoundInformation.Sound.Volume);
        SystemPanel.transform.Find("SystemSoundHeader/SoundVolumeInputField").GetComponent <InputField>().text = CommonFunction.PercentToNumber(SoundInformation.Sound.Volume).ToString();

        SystemPanel.transform.Find("SystemVoiceHeader/OnVoiceCheck").GetComponent <Toggle>().isOn              = VoiceInformation.Voice.IsPlay;
        SystemPanel.transform.Find("SystemVoiceHeader/VoiceVolumeSlider").GetComponent <Slider>().value        = CommonFunction.PercentToNumber(VoiceInformation.Voice.Volume);
        SystemPanel.transform.Find("SystemVoiceHeader/VoiceVolumeInputField").GetComponent <InputField>().text = CommonFunction.PercentToNumber(VoiceInformation.Voice.Volume).ToString();


        temp = KeyControlInformation.Info.Clone();

        SetAllkeyInfo(temp);

        SelectFieldKey();
    }
    private void SetKeyInfo(Dictionary <KeyType, KeyCode> list, GameObject target, GameObject label, KeyType type)
    {
        KeyCode key = KeyControlModel.GetInputKey();

        if (key == KeyCode.None)
        {
            SystemPanel.transform.Find("SystemValidation").GetComponent <Text>().text =
                "";
        }
        else if (temp.CheckContainsKey(list, key, type) == true)
        {
            SystemPanel.transform.Find("SystemValidation").GetComponent <Text>().text =
                string.Format("<color=red>「{0}」キーが重複しています。別のキーを割り当ててください。</color>", KeyControlModel.GetName(key).Trim());
        }
        else
        {
            if (list[type] != key)
            {
                label.GetComponent <Text>().text = KeyControlModel.GetName(key);
                list[type] = key;
            }
            SystemPanel.transform.Find("SystemValidation").GetComponent <Text>().text =
                "";
        }
    }
    public static void SaveValue(KeyControlModel data)
    {
        //jsonの取得
        string json = data.GetJsonData();

        //データの保存
        SaveKeyControl(json);
    }
    public void OnInitialize()
    {
        OperationMode om = KeyControlInformation.Info.OpMode;

        KeyControlInformation.Info = new KeyControlModel();

        KeyControlInformation.Info.OpMode = om;

        temp = KeyControlInformation.Info.Clone();

        SetAllkeyInfo(KeyControlInformation.Info);

        SystemPanel.transform.Find("SystemValidation").GetComponent <Text>().text =
            CommonConst.Message.KeyInfoInitial;
    }
    private void SetAllkeyInfo(KeyControlModel key)
    {
        SetKeyInfo(SystemMoveUpHeader, key.MoveUp);
        SetKeyInfo(SystemMoveDownHeader, key.MoveDown);
        SetKeyInfo(SystemMoveLeftHeader, key.MoveLeft);
        SetKeyInfo(SystemMoveRightHeader, key.MoveRight);
        SetKeyInfo(SystemMoveSlashHeader, key.XMove);
        SetKeyInfo(SystemDirHeader, key.ChangeDirection);
        SetKeyInfo(SystemDeathBlowHeader, key.DeathBlow);
        SetKeyInfo(SystemMenuHeader, key.MenuOpen);
        SetKeyInfo(SystemMlogHeader, key.MessageLog);
        SetKeyInfo(SystemDashHeader, key.Dash);
        SetKeyInfo(SystemAttackHeader, key.Attack);
        SetKeyInfo(SystemIdleHeader, key.Idle);
        SetKeyInfo(SystemKeyDisplayHeader, key.KeyDisplay);

        SetKeyInfo(SystemOkHeader, key.MenuOk);
        SetKeyInfo(SystemCancelHeader, key.MenuCancel);
        SetKeyInfo(SystemOptionHeader, key.LookOption);
        SetKeyInfo(SystemSortHeader, key.ItemSort);
        SetKeyInfo(SystemMultiSelectHeader, key.MenuMultiSelectOk);

        if (KeyControlInformation.Info.OpMode == OperationMode.UseMouse)
        {
            SystemPanel.transform.Find("SystemUseMouseHeader/OnUseMouseCheck").GetComponent <Toggle>().isOn = true;
        }
        else
        {
            SystemPanel.transform.Find("SystemUseMouseHeader/OnUseMouseCheck").GetComponent <Toggle>().isOn = false;
        }

        if (string.IsNullOrEmpty(temp.VerticalKey) == true)
        {
            SystemDTopHeader.transform.Find("SystemText").GetComponent <Text>().text = CommonConst.Message.NotSet;
        }
        else
        {
            SystemDTopHeader.transform.Find("SystemText").GetComponent <Text>().text = temp.VerticalKey;
        }
        if (string.IsNullOrEmpty(temp.HorizontalKey) == true)
        {
            SystemDLeftHeader.transform.Find("SystemText").GetComponent <Text>().text = CommonConst.Message.NotSet;
        }
        else
        {
            SystemDLeftHeader.transform.Find("SystemText").GetComponent <Text>().text = temp.HorizontalKey;
        }
    }
    public void SelectDPadKey()
    {
        #region フィールド系
        ScrollViewSystemKeyField.SetActive(false);
        //SystemMoveUpHeader.SetActive(false);
        //SystemMoveDownHeader.SetActive(false);
        //SystemMoveLeftHeader.SetActive(false);
        //SystemMoveRightHeader.SetActive(false);
        //SystemMoveSlashHeader.SetActive(false);
        //SystemDirHeader.SetActive(false);
        //SystemDeathBlowHeader.SetActive(false);
        //SystemMenuHeader.SetActive(false);
        //SystemMlogHeader.SetActive(false);
        //SystemDashHeader.SetActive(false);
        //SystemAttackHeader.SetActive(false);
        //SystemIdleHeader.SetActive(false);
        //SystemKeyDisplayHeader.SetActive(false);

        #endregion フィールド系

        #region メニュー系
        SystemOkHeader.SetActive(false);
        SystemCancelHeader.SetActive(false);
        SystemOptionHeader.SetActive(false);
        SystemSortHeader.SetActive(false);
        SystemMultiSelectHeader.SetActive(false);

        #endregion メニュー系

        #region 方向キー
        SystemDTopHeader.SetActive(true);
        SystemDLeftHeader.SetActive(true);
        #endregion 方向キー

        //水平方向の候補を取得
        HkeyTemp         = "";
        CandidateHorizon = new List <KeyControlModel.HorizontalKeyList>();
        foreach (KeyControlModel.HorizontalKeyList t in KeyControlModel.HorizontalKeyLists())
        {
            int    dir;
            string keyname = Enum.GetName(typeof(KeyControlModel.HorizontalKeyList), t);
            bool   check   = CheckAxis(keyname, out dir);
            if (check == false)
            {
                CandidateHorizon.Add(t);
            }
        }

        //垂直方向の候補を取得
        VkeyTemp          = "";
        CandidateVertical = new List <KeyControlModel.VerticalKeyList>();
        foreach (KeyControlModel.VerticalKeyList t in KeyControlModel.HorizontalKeyLists())
        {
            int    dir;
            string keyname = Enum.GetName(typeof(KeyControlModel.VerticalKeyList), t);
            bool   check   = CheckAxis(keyname, out dir);
            if (check == false)
            {
                CandidateVertical.Add(t);
            }
        }


        SystemPanel.transform.Find("KeyPanel/SystemKeyDescription").GetComponent <Text>().text
            = CommonConst.Message.KeyDescriptionDPad;
//            = @"Keyフィールドにカーソルを合わせて、対応する方向キーを押してください、
//操作が逆転する場合はリストボックスから反転を選択してください。";
    }
 private void SetKeyInfo(GameObject header, KeyCode c)
 {
     header.transform.Find("SystemText").GetComponent <Text>().text = KeyControlModel.GetName(c);
 }
예제 #8
0
    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;
    }
    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();
    }
    public void OnUseMouseTitle()
    {
        if (Input.GetKey(KeyCode.Space))
        {
            return;
        }

        Toggle t = GetComponent <Toggle>();

        if (t.isOn == true)
        {
            KeyControlInformation.Info.OpMode = OperationMode.UseMouse;
            GameObject.Find("PushEnter").GetComponent <Text>().text = string.Format("Push {0} or Mouse Double Click", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());
        }
        else
        {
            KeyControlInformation.Info.OpMode = OperationMode.KeyOnly;
            GameObject.Find("PushEnter").GetComponent <Text>().text = string.Format("Push {0}", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());
        }
    }
    public void OnInitialized()
    {
        SaveDataInformation.InitilizeSystemValue();
        KeyControlInformation.Info    = new KeyControlModel();
        SoundInformation.Sound.Volume = 0.7f;
        MusicInformation.Music.Volume = 0.7f;
        VoiceInformation.Voice.Volume = 0.7f;

        GameObject.Find("SystemText").GetComponent <Text>().text =
            "設定情報が初期化されました。";
        GameObject.Find("PushEnter").GetComponent <Text>().text = string.Format("Push {0}", KeyControlModel.GetName(KeyControlInformation.Info.MenuOk).Trim());
    }