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()); }
public TurnState UpdateSystemMenu(TurnState state) { if (CommonFunction.IsNull(UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject) == false) { bool isError = false; string target = ""; try { target = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name; } catch (MissingReferenceException) { isError = true; } if (isError == false) { if (target == "SystemInputFieldMoveUp") { SetKeyInfoField(SystemMoveUpHeader, KeyType.MoveUp); } else if (target == "SystemInputFieldMoveDown") { SetKeyInfoField(SystemMoveDownHeader, KeyType.MoveDown); } else if (target == "SystemInputFieldMoveLeft") { SetKeyInfoField(SystemMoveLeftHeader, KeyType.MoveLeft); } else if (target == "SystemInputFieldMoveRight") { SetKeyInfoField(SystemMoveRightHeader, KeyType.MoveRight); } else if (target == "SystemInputFieldMoveSlash") { SetKeyInfoField(SystemMoveSlashHeader, KeyType.XMove); } else if (target == "SystemInputFieldDir") { SetKeyInfoField(SystemDirHeader, KeyType.ChangeDirection); } else if (target == "SystemInputFieldDeathBlow") { SetKeyInfoField(SystemDeathBlowHeader, KeyType.DeathBlow); } else if (target == "SystemInputFieldMenu") { SetKeyInfoField(SystemMenuHeader, KeyType.MenuOpen); } else if (target == "SystemInputFieldMlog") { SetKeyInfoField(SystemMlogHeader, KeyType.MessageLog); } else if (target == "SystemInputFieldDash") { SetKeyInfoField(SystemDashHeader, KeyType.Dash); } else if (target == "SystemInputFieldAttack") { SetKeyInfoField(SystemAttackHeader, KeyType.Attack); } else if (target == "SystemInputFieldIdle") { SetKeyInfoField(SystemIdleHeader, KeyType.Idle); } else if (target == "SystemInputFieldDisplay") { SetKeyInfoField(SystemKeyDisplayHeader, KeyType.KeyDisplay); } else if (target == "SystemInputFieldOk") { SetKeyInfoMenu(SystemOkHeader, KeyType.MenuOk); } else if (target == "SystemInputFieldCancel") { SetKeyInfoMenu(SystemCancelHeader, KeyType.MenuCancel); } else if (target == "SystemInputFieldOption") { SetKeyInfoMenu(SystemOptionHeader, KeyType.LookOption); } else if (target == "SystemInputFieldSort") { SetKeyInfoMenu(SystemSortHeader, KeyType.ItemSort); } else if (target == "SystemInputFieldMultiSelect") { SetKeyInfoMenu(SystemMultiSelectHeader, KeyType.MenuMultiSelectOk); } else if (target == "SystemInputFieldDTop") { SetVertical(); } else if (target == "SystemInputFieldDLeft") { SetHorizontal(); } } } //閉じる else if (Input.GetKeyDown(KeyControlInformation.Info.MenuCancel)) { IsClose = true; } if (IsClose == true) { //データを保存 SystemInformation s = new SystemInformation(); s.CharacterName = pl.DisplayName; s.IsBgm = MusicInformation.Music.IsMusicOn; s.BGMVolume = CommonFunction.PercentToInt(MusicInformation.Music.Volume); s.IsSound = SoundInformation.Sound.IsPlay; s.SoundVolume = CommonFunction.PercentToInt(SoundInformation.Sound.Volume); s.IsVoice = VoiceInformation.Voice.IsPlay; s.VoiceVolume = CommonFunction.PercentToInt(VoiceInformation.Voice.Volume); SaveDataInformation.SaveValue(KeyControlInformation.Info); SaveDataInformation.SaveValue(s); SaveDataInformation.Submit(); //Debug.Log(temp.GetJsonData()); //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.MenuCancel); SystemPanel.SetActive(false); state = TurnState.FirstMenu; } return(state); }
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 UpdateMain() { if (IsStart == false) { return; } if (ManageWait.Info.IsWait == true) { return; } if (state == TitleState.Input) { if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.MenuOk) || (KeyControlInformation.Info.OnLeftClick() && CommonFunction.IsDoubleClick())) { if (CommonFunction.IsNull(UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject) == false && UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name == "NameInputField") { return; } if (CommonFunction.IsNull(ResourceInformation.SaveInfo) == false && ResourceInformation.SaveInfo.IsLoadSave == true) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.MenuOk); state = TitleState.ActionSelectInit; } else { TargetScene = "Scenes/GameSelect"; state = TitleState.FadeInit; } } } else if (state == TitleState.ActionSelectInit) { InitialzeContent(); state = TitleState.ActionSelect; } else if (state == TitleState.ActionSelect) { if (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject == GameObject.Find("NameInputField")) { return; } //上 if (KeyControlInformation.Info.OnMoveUp()) { Selected = SelectUp(SelectedList, Selected); } //下 else if (KeyControlInformation.Info.OnMoveDown()) { Selected = SelectDown(SelectedList, Selected); } //ダンジョン決定 シーン移動 else if (KeyControlInformation.Info.OnKeyDownMenu(KeyType.MenuOk)) { if (Selected == (int)TitleSelectAction.Continue) { TargetScene = "Scenes/rouge1"; state = TitleState.FadeInitLoadSave; } else if (Selected == (int)TitleSelectAction.NewGame) { ResourceInformation.SaveInfo = new SavePlayingInformation(); SaveDataInformation.RemoveSaveData(); TargetScene = "Scenes/GameSelect"; state = TitleState.FadeInit; } } } else if (state == TitleState.FadeInitLoadSave) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.GameStart); string name = GameObject.Find("NameText").GetComponent <Text>().text; ScoreInformation.Info.PlayerName = name; _manageFade.PlayFadeIn(true, 0.5f); SavePlayingInformation save = ResourceInformation.SaveInfo; //保存されていたら保存データを読み込み if (save.IsLoadSave == true) { DungeonInformation.Info = TableDungeonMaster.GetValue(save.don); PlayerInformation.Info = TablePlayer.GetValue(save.pon); //アイテムデータをロード SaveItemData[] items = SaveDataInformation.LoadItemValue(); //アイテムデータを反映 GameStateInformation.TempItemList = SaveItemInformation.ToListBaseItem(items); //セーブデータを削除 SaveDataInformation.RemoveSaveData(); } StartCoroutine(TransScene(TargetScene, 0.5f)); state = TitleState.Fade; } else if (state == TitleState.FadeInit) { //サウンドを鳴らす SoundInformation.Sound.Play(SoundInformation.SoundType.GameStart); string name = GameObject.Find("NameText").GetComponent <Text>().text; ScoreInformation.Info.PlayerName = name; _manageFade.PlayFadeIn(true, 0.5f); StartCoroutine(TransScene(TargetScene, 0.5f)); state = TitleState.Fade; } }