123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using UnityEngine;
- using UnityEngine.Events;
- public class SceneVRCommunication : MonoBehaviour
- {
- public static SceneVRCommunication Instance
- {
- get
- {
- return SceneVRCommunication.m_this;
- }
- }
- public bool IsFreeMode
- {
- get
- {
- return this.m_bFreeMode;
- }
- }
- public bool IsEnableSkip
- {
- get
- {
- return this.m_bEnableSkip;
- }
- }
- public bool UiNoMoveMode
- {
- get
- {
- return this.m_bUiNoMove;
- }
- set
- {
- this.m_bUiNoMove = value;
- }
- }
- public bool UiNoTimeMode
- {
- get
- {
- return this.m_bUiNoTime;
- }
- set
- {
- this.m_bUiNoTime = value;
- }
- }
- public bool UiNoHomeMode
- {
- get
- {
- return this.m_bUiNoHome;
- }
- set
- {
- this.m_bUiNoHome = value;
- }
- }
- public bool MouseOnlyMode
- {
- get
- {
- return this.m_bMouseOnlyMode;
- }
- }
- public VRChoices Choices
- {
- get
- {
- return this.m_VRChoices;
- }
- }
- public VRMiniGameManager MiniGameMgr
- {
- get
- {
- return this.m_VRMinigameMgr;
- }
- }
- public VRTouchComm TouchComm
- {
- get
- {
- return this.m_VRTouchComm;
- }
- }
- public bool KaraokeMode
- {
- get
- {
- return this.m_bKaraokeMode;
- }
- }
- private void Awake()
- {
- if (!GameMain.Instance.VRMode || GameMain.Instance.VRFamily == GameMain.VRFamilyType.NON)
- {
- GameMain.Instance.VRDummyMode = true;
- GameMain.Instance.OvrInit();
- GameMain.Instance.MainCamera.SetPos(new Vector3(0f, 1.6f, 0f));
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- }
- UICamera.isDisableRightClick = true;
- GameMain.Instance.OvrMgr.OvrCamera.ChangeControllerNew(true);
- GameMain.Instance.OvrMgr.OvrCamera.IsForceRightClickUiToggle = true;
- this.m_VRMinigameMgr = base.GetComponent<VRMiniGameManager>();
- if (this.m_VRMinigameMgr == null)
- {
- this.m_VRMinigameMgr = base.gameObject.AddComponent<VRMiniGameManager>();
- }
- NDebug.Assert(this.m_VRMinigameMgr != null, "MiniGameManagerがみつかりません。");
- this.m_VRTouchComm = base.GetComponent<VRTouchComm>();
- if (this.m_VRTouchComm == null)
- {
- this.m_VRTouchComm = base.gameObject.AddComponent<VRTouchComm>();
- }
- NDebug.Assert(this.m_VRTouchComm != null, "VRTouchCommがみつかりません。");
- }
- private void Start()
- {
- SceneVRCommunication.m_this = this;
- this.m_goUiRoot = GameObject.Find("UI Root");
- NDebug.Assert(this.m_goUiRoot != null, "UI Rootが見つかりません。");
- this.m_VRChoices = base.GetComponent<VRChoices>();
- if (this.m_VRChoices == null)
- {
- this.m_VRChoices = base.gameObject.AddComponent<VRChoices>();
- }
- GameMain.Instance.MsgWnd.CloseMessageWindowPanel();
- GameMain.Instance.MsgWnd.ForceDisableWindow(true);
- GameMain.Instance.ScriptMgr.adv_kag.vr_commu_mode = true;
- if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.NON)
- {
- this.m_bManShow = GameMain.Instance.CMSystem.VRManShow;
- }
- Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
- if (man != null)
- {
- man.body0.SetManHide(!this.m_bManShow);
- }
- this.m_dicTagBackup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
- Dictionary<string, string> dicTagBackup = this.m_dicTagBackup;
- string text;
- if (dicTagBackup != null && dicTagBackup.TryGetValue("name", out text) && text.Contains("SceneVRCommunication"))
- {
- string text2;
- if (dicTagBackup.TryGetValue("start_jump_file", out text2))
- {
- this.m_strStartScriptFile = text2 + ".ks";
- }
- if (dicTagBackup.TryGetValue("start_jump_label", out text2))
- {
- this.m_strStartScriptLabel = text2;
- }
- if (dicTagBackup.TryGetValue("karaoke", out text))
- {
- this.m_bKaraokeMode = true;
- }
- }
- base.StartCoroutine(this.CoScriptStart());
- }
- private IEnumerator CoScriptStart()
- {
- yield return null;
- Debug.Log("Canvas Manager attach start.");
- if (!this.m_bKaraokeMode)
- {
- this.m_goCanvas = UnityEngine.Object.Instantiate<GameObject>(Resources.Load<GameObject>("SceneVRCommunication/Tablet/Canvas Manager"));
- }
- else
- {
- this.m_goCanvas = UnityEngine.Object.Instantiate<GameObject>(Resources.Load<GameObject>("SceneVRCommunication/Tablet/Karaoke/Prefab/Canvas Manager Mini"));
- }
- NDebug.Assert(this.m_goCanvas != null, "Canvas Managerが見つかりません。");
- VRCanvasManager.Instance.SetSkipButtonEvent(new UnityAction(this.OnSkipScenario));
- this.m_goCanvas.transform.SetParent(GameMain.Instance.OvrMgr.OvrCamera.OvrTablet.transform, false);
- this.m_goCanvas.transform.localPosition = Vector3.zero;
- this.m_goCanvas.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
- Debug.Log("Canvas Manager attach finish.");
- yield return null;
- Debug.Log("Canvas Manager attach wait1.");
- yield return null;
- Debug.Log("Canvas Manager attach wait2.");
- bool bStart = false;
- if (!string.IsNullOrEmpty(this.m_strStartScriptFile))
- {
- GameMain.Instance.ScriptMgr.LoadAdvScenarioScript(this.m_strStartScriptFile, string.Empty);
- bStart = true;
- }
- if (!string.IsNullOrEmpty(this.m_strStartScriptLabel))
- {
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strStartScriptLabel);
- bStart = true;
- }
- if (bStart)
- {
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- yield break;
- }
- private void OnDestroy()
- {
- this.Uninit();
- }
- private void Uninit()
- {
- if (!this.m_bFinished)
- {
- GameMain instance = GameMain.Instance;
- if (instance != null)
- {
- if (this.TouchComm != null)
- {
- this.TouchComm.Touch_End();
- this.TouchComm.enabled = false;
- }
- if (this.Choices != null)
- {
- this.Choices.Clear();
- this.Choices.enabled = false;
- }
- UnityEngine.Object.DestroyImmediate(this.m_goCanvas);
- if (instance.SoundMgr != null)
- {
- instance.SoundMgr.VoiceStopAll();
- instance.SoundMgr.StopBGM(0.5f);
- }
- CharacterMgr characterMgr = instance.CharacterMgr;
- if (characterMgr != null)
- {
- for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
- {
- Maid stockMaid = characterMgr.GetStockMaid(i);
- if (stockMaid != null && stockMaid.body0 != null && stockMaid.body0.isLoadedBody)
- {
- stockMaid.body0.MuneYureL(1f);
- stockMaid.body0.MuneYureR(1f);
- stockMaid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, 0f, false, false);
- stockMaid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, 0f, false, false);
- stockMaid.transform.localScale = Vector3.one;
- stockMaid.StopKuchipakuPattern();
- stockMaid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
- stockMaid.DelPrefabAll();
- }
- }
- for (int j = 0; j < characterMgr.GetStockManCount(); j++)
- {
- Maid stockMan = characterMgr.GetStockMan(j);
- if (stockMan != null && stockMan.body0 != null && stockMan.body0.isLoadedBody)
- {
- stockMan.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, 0f, false, false);
- stockMan.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, 0f, false, false);
- stockMan.DelPrefabAll();
- }
- }
- string[] array = new string[]
- {
- "handitem",
- "kousoku_upper",
- "kousoku_lower",
- "skirt",
- "panz",
- "mizugi",
- "onepiece",
- "accanl",
- "accvag",
- "KubiScl",
- "UdeScl",
- "DouPer",
- "sintyou",
- "kata"
- };
- for (int k = 0; k < characterMgr.GetMaidCount(); k++)
- {
- Maid maid = characterMgr.GetMaid(k);
- if (maid != null && maid.Visible)
- {
- maid.OpenMouth(false);
- maid.DelPrefabAll();
- for (int l = 0; l < array.Length; l++)
- {
- maid.ResetProp(array[l], true);
- }
- maid.AllProcPropSeqStart();
- }
- }
- for (int m = 0; m < characterMgr.GetManCount(); m++)
- {
- Maid man = characterMgr.GetMan(m);
- if (man != null && man.Visible)
- {
- man.DelPrefabAll();
- for (int n = 0; n < array.Length; n++)
- {
- man.ResetProp(array[n], false);
- }
- man.AllProcPropSeqStart();
- }
- }
- }
- if (VRTestInputModule.Instance != null)
- {
- VRTestInputModule.Instance.enabled = false;
- }
- if (instance.OvrMgr.OvrCamera != null)
- {
- VRTestInputModule[] componentsInChildren = instance.OvrMgr.OvrCamera.GetComponentsInChildren<VRTestInputModule>(true);
- foreach (VRTestInputModule vrtestInputModule in componentsInChildren)
- {
- vrtestInputModule.enabled = false;
- UnityEngine.Object.DestroyImmediate(vrtestInputModule.gameObject);
- }
- VRControllerLaserCast[] componentsInChildren2 = instance.OvrMgr.OvrCamera.GetComponentsInChildren<VRControllerLaserCast>(true);
- foreach (VRControllerLaserCast vrcontrollerLaserCast in componentsInChildren2)
- {
- vrcontrollerLaserCast.enabled = false;
- UnityEngine.Object.DestroyImmediate(vrcontrollerLaserCast.gameObject);
- }
- instance.OvrMgr.OvrCamera.ForceHideUI(false);
- instance.OvrMgr.OvrCamera.HandLimitMode = AVRControllerBehavior.LIMIT_MODE.NORMAL;
- instance.OvrMgr.OvrCamera.ChangeControllerNew(GameMain.Instance.CMSystem.OvrUseNewControllerType);
- instance.OvrMgr.OvrCamera.IsForceRightClickUiToggle = false;
- }
- UICamera.isDisableRightClick = false;
- instance.MsgWnd.ForceDisableWindow(false);
- ScriptManager scriptMgr = instance.ScriptMgr;
- if (scriptMgr != null && scriptMgr.adv_kag != null)
- {
- scriptMgr.adv_kag.vr_commu_mode = false;
- if (scriptMgr.adv_kag.kag != null)
- {
- scriptMgr.adv_kag.kag.TextClear();
- }
- }
- Maid man2 = instance.CharacterMgr.GetMan(0);
- if (man2 != null)
- {
- man2.body0.SetManHide(false);
- }
- instance.CMSystem.SetTmpGenericFlag("VR夜伽中", 0);
- instance.CMSystem.SetTmpGenericFlag("VRエディット中", 0);
- if (instance.VRDeviceTypeID == GameMain.VRDeviceType.NON)
- {
- instance.OvrUninit();
- }
- else if (instance.VRDeviceTypeID == GameMain.VRDeviceType.RIFT || instance.VRDeviceTypeID == GameMain.VRDeviceType.RIFT_TOUCH)
- {
- instance.OvrMgr.OvrCamera.ChangeTouchUse(true);
- }
- }
- this.m_bFinished = true;
- }
- }
- public void kagFreeSceneSwitch(bool f_bFreeMode, bool f_bEnableSkip = true, bool f_bNoStartText = false)
- {
- this.m_bEnableSkip = false;
- if (!f_bFreeMode)
- {
- this.TouchComm.Touch_End();
- if (this.m_coFreeSceneStartText != null)
- {
- base.StopCoroutine(this.m_coFreeSceneStartText);
- }
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- this.m_strFreeSceneEndScriptName = scriptMgr.adv_kag.kag.GetCurrentFileName();
- this.m_bEnableSkip = f_bEnableSkip;
- }
- else
- {
- if (!this.m_bKaraokeMode && !f_bNoStartText)
- {
- this.StartFreeSceneText();
- }
- this.m_strFreeSceneEndScriptName = string.Empty;
- this.UiNoHomeMode = false;
- }
- GameMain.Instance.OvrMgr.OvrCamera.HandLimitMode = ((!f_bFreeMode) ? AVRControllerBehavior.LIMIT_MODE.NO_WARP : AVRControllerBehavior.LIMIT_MODE.NORMAL);
- if (!this.m_bFreeMode || !f_bFreeMode)
- {
- }
- this.m_bFreeMode = f_bFreeMode;
- this.KagTabletUIUpdate();
- }
- public void StartDay()
- {
- Farm_Mng.Instance.Day_Start();
- this.KagTabletUIUpdate();
- }
- public void KagTabletUIUpdate()
- {
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.UpdateCanvas();
- }
- private void DupCheck(GameObject[] value)
- {
- }
- public void KagBGChangeInit(Dictionary<string, string> f_tag_backup)
- {
- try
- {
- GameObject[] array = GameObject.FindGameObjectsWithTag("OvrEventObj");
- this.DupCheck(array);
- this.m_dicEventObj = array.ToDictionary((GameObject n) => n.name, (GameObject n) => n);
- GameObject[] array2 = GameObject.FindGameObjectsWithTag("OvrEventGroup");
- this.DupCheck(array2);
- this.m_dicEventGroup = array2.ToDictionary((GameObject n) => n.name, (GameObject n) => new SceneVRCommunication.EventGroup(n, this.FindChild(n.transform, null)));
- }
- catch (Exception ex)
- {
- NDebug.Assert("同じ名前のオブジェクトが入ったプレハブをロードしようとしませんでしたか?\n" + ex.Message, false);
- }
- if (f_tag_backup != null && f_tag_backup.ContainsKey("farm"))
- {
- Farm_Mng.Instance.Farm_Start();
- }
- }
- public void KagEventObj(string f_strName, int f_nVisible, int f_nTrigger, int f_nGrab, string f_strAnimation)
- {
- GameObject gameObject;
- if (this.m_dicEventObj.TryGetValue(f_strName, out gameObject))
- {
- if (f_nVisible != 0)
- {
- gameObject.SetActive(f_nVisible == 1);
- }
- if (f_nTrigger != 0)
- {
- VREventTrigger component = gameObject.GetComponent<VREventTrigger>();
- if (component != null)
- {
- component.SetEnableEvent(f_nTrigger == 1);
- }
- }
- if (f_nGrab != 0)
- {
- VREventTrigger component2 = gameObject.GetComponent<VREventTrigger>();
- if (component2 != null)
- {
- component2.SetEnableCollider(f_nGrab == 1);
- }
- }
- if (!string.IsNullOrEmpty(f_strAnimation))
- {
- Animator component3 = gameObject.GetComponent<Animator>();
- if (component3 != null)
- {
- component3.SetTrigger(f_strAnimation);
- }
- }
- }
- else
- {
- NDebug.Assert("指定名のオブジェクトがありません。" + f_strName, false);
- }
- }
- public void KagEventObjGroup(string f_strName, int f_nVisible, int f_nTrigger, int f_nGrab)
- {
- SceneVRCommunication.EventGroup eventGroup;
- if (this.m_dicEventGroup.TryGetValue(f_strName, out eventGroup))
- {
- if (f_nVisible != 0 || f_nTrigger != 0 || f_nGrab != 0)
- {
- for (int i = 0; i < eventGroup.listChild.Count; i++)
- {
- if (f_nVisible != 0)
- {
- eventGroup.listChild[i].SetActive(f_nVisible == 1);
- }
- VREventTrigger component = eventGroup.listChild[i].GetComponent<VREventTrigger>();
- if (component != null)
- {
- if (f_nTrigger != 0)
- {
- component.SetEnableEvent(f_nTrigger == 1);
- }
- if (f_nGrab != 0)
- {
- component.SetEnableCollider(f_nGrab == 1);
- }
- }
- }
- }
- }
- else
- {
- NDebug.Assert("指定名のオブジェクトグループがありません。" + f_strName, false);
- }
- }
- public void KagDoNextTime()
- {
- string str = "VRmainOP_0001";
- string label_name = string.Empty;
- SceneVRCommunication.VR_TIME nowTime = this.GetNowTime();
- if (nowTime == SceneVRCommunication.VR_TIME.MONING)
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("時間帯", 2);
- label_name = "*昼_ループ";
- }
- else if (nowTime == SceneVRCommunication.VR_TIME.DAY)
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("時間帯", 3);
- label_name = "*夜_ループ";
- }
- else if (nowTime == SceneVRCommunication.VR_TIME.NIGHT)
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("時間帯", 1);
- label_name = "*朝_ループ";
- this.StartDay();
- }
- this.KagTabletUIUpdate();
- GameMain.Instance.ScriptMgr.LoadAdvScenarioScript(str + ".ks", string.Empty);
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(label_name);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- private List<GameObject> FindChild(Transform f_trParent, List<GameObject> f_list = null)
- {
- if (f_list == null)
- {
- f_list = new List<GameObject>();
- }
- for (int i = 0; i < f_trParent.childCount; i++)
- {
- this.FindChild(f_trParent.GetChild(i), f_list);
- }
- if (f_trParent.tag == "OvrEventObj")
- {
- f_list.Add(f_trParent.gameObject);
- }
- return f_list;
- }
- public void YotogiStart(Action f_actDecide, Action f_actCancel)
- {
- this.m_actDecide = f_actDecide;
- this.m_actCancel = f_actCancel;
- }
- public void MaidEditStart()
- {
- if (GameMain.Instance.CharacterMgr.GetMaid(0) == null)
- {
- Debug.LogError("エディット対象メイドが居ません。");
- return;
- }
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- string currentFileName = scriptMgr.adv_kag.kag.GetCurrentFileName();
- GameMain.Instance.ScriptMgr.EvalScript("tf['back_edit_script_name'] = '" + currentFileName + "';");
- scriptMgr.LoadAdvScenarioScript(Path.ChangeExtension("vr_edit_call", ".ks"), "*start_vr");
- scriptMgr.adv_kag.Exec();
- }
- public SceneVRCommunication.VR_TIME GetNowTime()
- {
- SceneVRCommunication.VR_TIME result = SceneVRCommunication.VR_TIME.DAY;
- int flag = GameMain.Instance.CharacterMgr.status.GetFlag("時間帯");
- if (flag == 0 || flag == 1)
- {
- result = SceneVRCommunication.VR_TIME.MONING;
- }
- else if (flag == 2)
- {
- result = SceneVRCommunication.VR_TIME.DAY;
- }
- else if (flag == 3)
- {
- result = SceneVRCommunication.VR_TIME.NIGHT;
- }
- else
- {
- NDebug.Assert("現在の時間帯が不正です", false);
- }
- return result;
- }
- public void KagStartDayTimeShow(string f_strReturnFile, string f_strReturnLabel)
- {
- this.m_strRetrunFile = f_strReturnFile;
- this.m_strRetrunLabel = f_strReturnLabel;
- Day_UI.Day_UI_Start(new Action(this.OnEndDayTimeShow));
- }
- private void OnEndDayTimeShow()
- {
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- if (!string.IsNullOrEmpty(this.m_strRetrunFile))
- {
- scriptMgr.LoadAdvScenarioScript(this.m_strRetrunFile + ".ks", string.Empty);
- }
- if (!string.IsNullOrEmpty(this.m_strRetrunLabel))
- {
- scriptMgr.adv_kag.JumpLabel(this.m_strRetrunLabel);
- }
- scriptMgr.adv_kag.Exec();
- }
- public void KagDialog(string f_strText, string f_strLabelOk, string f_strLabelCancel, string f_strLabelYes, string strLabelNo)
- {
- this.m_DialogMenu = VRDialogMenu.CreateDialog();
- VRDialogMenu.TYPE_STYLE type_STYLE = (VRDialogMenu.TYPE_STYLE)0;
- this.m_strLabelOk = f_strLabelOk;
- this.m_strLabelCancel = f_strLabelCancel;
- this.m_strLabelYes = f_strLabelYes;
- this.m_strLabelNo = strLabelNo;
- if (!string.IsNullOrEmpty(this.m_strLabelOk))
- {
- type_STYLE |= VRDialogMenu.TYPE_STYLE.OK;
- }
- if (!string.IsNullOrEmpty(this.m_strLabelCancel))
- {
- type_STYLE |= VRDialogMenu.TYPE_STYLE.CANCEL;
- }
- if (!string.IsNullOrEmpty(this.m_strLabelYes))
- {
- type_STYLE |= VRDialogMenu.TYPE_STYLE.YES;
- }
- if (!string.IsNullOrEmpty(this.m_strLabelNo))
- {
- type_STYLE |= VRDialogMenu.TYPE_STYLE.NO;
- }
- this.m_DialogMenu.OpenDialog(f_strText, type_STYLE, new UnityAction<VRDialogMenu.TYPE_STYLE>(this.OnEndDialog));
- }
- private void OnEndDialog(VRDialogMenu.TYPE_STYLE style)
- {
- string text = string.Empty;
- if (style == VRDialogMenu.TYPE_STYLE.OK)
- {
- text = this.m_strLabelOk;
- }
- else if (style == VRDialogMenu.TYPE_STYLE.CANCEL)
- {
- text = this.m_strLabelCancel;
- }
- if (style == VRDialogMenu.TYPE_STYLE.YES)
- {
- text = this.m_strLabelYes;
- }
- else if (style == VRDialogMenu.TYPE_STYLE.NO)
- {
- text = this.m_strLabelNo;
- }
- this.m_DialogMenu.CloseDialog();
- NDebug.Assert(!string.IsNullOrEmpty(text), "ダイアログとび先ラベルがありません");
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(text);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- public void KagStartMovieMusicPlayerTV()
- {
- VRExternalFileLoader.Event_OpenSelect();
- }
- public void KagVRMovieTV(bool f_bStart, string f_strFileName = "", bool f_bLoop = false)
- {
- if (f_bStart)
- {
- VRExternalFileLoader.Event_PlayMovie(f_strFileName);
- }
- else
- {
- VRExternalFileLoader.Event_CloseMovie();
- }
- }
- public void KagPlantWindowShow(string strFileName, string strLabelOK, string strLabelCancel)
- {
- this.m_strFilePlant = strFileName;
- this.m_strLabelPlantOk = strLabelOK;
- this.m_strLabelPlantCancel = strLabelCancel;
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.OpenVRCulture(new UnityAction(this.OnPlantOk), new UnityAction(this.OnPlantCancel));
- }
- private void OnPlantOk()
- {
- if (!string.IsNullOrEmpty(this.m_strFilePlant))
- {
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_strFilePlant, string.Empty);
- }
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strLabelPlantOk);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- private void OnPlantCancel()
- {
- if (!string.IsNullOrEmpty(this.m_strFilePlant))
- {
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_strFilePlant, string.Empty);
- }
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strLabelPlantCancel);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- public void KagPlantUpdate()
- {
- Farm_Mng.Instance.SyuKaku();
- }
- public void KagTutorialStart(string f_strReturnLabel)
- {
- this.m_strRetrunLabel = f_strReturnLabel;
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.OpenVRTutorialMenu(new UnityAction(this.OnEndTutorial));
- }
- private void OnEndTutorial()
- {
- if (!string.IsNullOrEmpty(this.m_strRetrunLabel))
- {
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strRetrunLabel);
- }
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- public void KagVRNoChangeBG(bool f_bStart)
- {
- this.m_bUiNoMove = f_bStart;
- }
- public void KagVRTrophyGet(string f_strText)
- {
- Trophy_UI.Trophy_Start(f_strText);
- }
- private void StartFreeSceneText()
- {
- if (this.m_coFreeSceneStartText != null)
- {
- base.StopCoroutine(this.m_coFreeSceneStartText);
- }
- this.m_coFreeSceneStartText = base.StartCoroutine(this.CoFreeSceneText());
- }
- private IEnumerator CoFreeSceneText()
- {
- yield return new WaitForSeconds(1f);
- SceneVRCommunication.VR_TIME time = this.GetNowTime();
- string[] aryTimeStr = new string[]
- {
- "朝",
- "昼",
- "夜"
- };
- string strBGName = string.Empty;
- if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Night".ToLower())
- {
- strBGName = "ヴィラ1F";
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom_Night".ToLower())
- {
- strBGName = "ヴィラ2F";
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm_Night".ToLower())
- {
- strBGName = "庭";
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR_Night".ToLower())
- {
- strBGName = "海岸";
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo_Night".ToLower())
- {
- strBGName = "露天風呂";
- }
- if (!string.IsNullOrEmpty(strBGName))
- {
- FreeScene_UI.FreeScene_Start(strBGName + "\u3000" + aryTimeStr[(int)this.GetNowTime()], null);
- }
- this.m_coFreeSceneStartText = null;
- yield break;
- }
- public void KagRentalMaidSelectStart()
- {
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.OpenVRRentalMaid();
- }
- public void KagTouchUseSelect(string f_strReturnLabel)
- {
- this.m_strRetrunLabel = f_strReturnLabel;
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.OpenVRDecideUseTouch(new UnityAction<bool>(this.OnTouchUseSelect));
- }
- private void OnTouchUseSelect(bool f_bUseTouch)
- {
- GameMain.Instance.OvrMgr.OvrCamera.ChangeTouchUse(f_bUseTouch);
- if (!string.IsNullOrEmpty(this.m_strRetrunLabel))
- {
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strRetrunLabel);
- }
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- private void OnSkipScenario()
- {
- if (!string.IsNullOrEmpty(this.m_strFreeSceneEndScriptName))
- {
- GameMain.Instance.SoundMgr.VoiceStopAll();
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_strFreeSceneEndScriptName, string.Empty);
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel("*アフターファイル挿入箇所");
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- }
- public void KagHintShow(string f_strHintMsg)
- {
- SelectMessage_UI.Message_Start(f_strHintMsg);
- }
- public void KagKaraokeWindowShow(string f_strReturnFile, string f_strReturnLabel)
- {
- this.m_strKaraokeRetrunFile = f_strReturnFile;
- this.m_strKaraokeRetrunLabel = f_strReturnLabel;
- VRCanvasManager instance = VRCanvasManager.Instance;
- instance.StartKaraokeMode(new Action(this.OnKaraokeCancel));
- }
- private void OnKaraokeCancel()
- {
- if (!string.IsNullOrEmpty(this.m_strKaraokeRetrunFile))
- {
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_strKaraokeRetrunFile, string.Empty);
- }
- if (!string.IsNullOrEmpty(this.m_strKaraokeRetrunLabel))
- {
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strKaraokeRetrunLabel);
- }
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- public void OnEnd()
- {
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- base.StartCoroutine(this.CoEnd());
- }
- private IEnumerator CoEnd()
- {
- yield return null;
- GameMain.Instance.UnloadPopScene();
- yield return null;
- this.Uninit();
- yield return null;
- Debug.Log("vr_end_call");
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile("vr_end_call.ks", string.Empty);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- yield break;
- }
- private void Update()
- {
- if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.NON && this.m_bManShow != GameMain.Instance.CMSystem.VRManShow)
- {
- this.m_bManShow = GameMain.Instance.CMSystem.VRManShow;
- Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
- if (man != null)
- {
- man.body0.SetManHide(!this.m_bManShow);
- }
- }
- }
- private static SceneVRCommunication m_this;
- private bool m_bFreeMode = true;
- private bool m_bEnableSkip;
- private bool m_bUiNoMove;
- private bool m_bUiNoTime;
- private bool m_bUiNoHome;
- private bool m_bMouseOnlyMode;
- private Dictionary<string, GameObject> m_dicEventObj;
- private VRChoices m_VRChoices;
- private VRMiniGameManager m_VRMinigameMgr;
- private VRTouchComm m_VRTouchComm;
- private GameObject m_goUiRoot;
- private string m_strRetrunFile = string.Empty;
- private string m_strRetrunLabel = string.Empty;
- private string m_strKaraokeRetrunFile = string.Empty;
- private string m_strKaraokeRetrunLabel = string.Empty;
- private Dictionary<string, SceneVRCommunication.EventGroup> m_dicEventGroup;
- public Dictionary<string, string> m_dicTagBackup;
- private Coroutine m_coFreeSceneStartText;
- private GameObject m_goCanvas;
- private string m_strFreeSceneEndScriptName;
- private bool m_bManShow;
- private bool m_bFinished;
- private bool m_bKaraokeMode;
- private string m_strStartScriptFile;
- private string m_strStartScriptLabel;
- private Action m_actDecide;
- private Action m_actCancel;
- private VRDialogMenu m_DialogMenu;
- private string m_strLabelOk = string.Empty;
- private string m_strLabelCancel = string.Empty;
- private string m_strLabelYes = string.Empty;
- private string m_strLabelNo = string.Empty;
- private string m_strFilePlant = string.Empty;
- private string m_strLabelPlantOk = string.Empty;
- private string m_strLabelPlantCancel = string.Empty;
- public enum VR_TIME
- {
- MONING,
- DAY,
- NIGHT,
- MAX
- }
- private class EventGroup
- {
- public EventGroup(GameObject go, List<GameObject> lst)
- {
- this.goParent = go;
- this.listChild = lst;
- }
- public GameObject goParent;
- public List<GameObject> listChild = new List<GameObject>();
- }
- }
|