12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using MaidStatus;
- using UnityEngine;
- public class SceneVRTouch : MonoBehaviour
- {
- private void Start()
- {
- GameMain.Instance.CharacterMgr.DeactivateCharaAll();
- this.m_maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- this.m_maid.Visible = true;
- Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
- string a;
- if (tag_backup != null && tag_backup.TryGetValue("name", out a) && a == "SceneVRTouch")
- {
- string text;
- if (tag_backup.TryGetValue("label_end", out text))
- {
- this.m_strScriptArgLabelEnd = text;
- }
- if (tag_backup.TryGetValue("label_ft", out text))
- {
- this.m_strScriptArgLabelFT = text;
- }
- }
- GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
- this.m_maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
- GameMain.Instance.MainLight.Reset();
- GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
- GameMain.Instance.MainCamera.SetPos(new Vector3(0f, 1.4871f, 1f));
- GameMain.Instance.MainCamera.SetRotation(new Vector3(0f, -180f, 0f));
- this.m_lstBgInfo = this.ReadBGList();
- foreach (SceneVRTouch.BGInfo bginfo in this.m_lstBgInfo)
- {
- SceneVRTouch.ButtonBG buttonBG = new SceneVRTouch.ButtonBG();
- buttonBG.texIcon = bginfo.texThumb;
- buttonBG.m_bg = bginfo;
- this.m_listBg.Add(buttonBG);
- }
- this.m_listTouchMotionScript = this.ReadMotionList();
- foreach (SceneVRTouch.TouchMotionScript touchMotionScript in this.m_listTouchMotionScript)
- {
- SceneVRTouch.ButtonPose buttonPose = new SceneVRTouch.ButtonPose();
- buttonPose.texIcon = touchMotionScript.m_texThumb;
- buttonPose.m_motion = touchMotionScript;
- this.m_listPose.Add(buttonPose);
- }
- this.m_dicTouchVoiceScript = this.ReadVoiceList();
- this.m_TouchMgr = new VRTouchMgr();
- this.m_MotionScriptMgr = GameMain.Instance.ScriptMgrFast;
- GameObject gameObject = GameObject.Find("Cancel");
- this.m_btnEnd = gameObject.GetComponent<UIButton>();
- EventDelegate.Add(this.m_btnEnd.onClick, new EventDelegate.Callback(this.OnButtonEndClick));
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- base.StartCoroutine(this.CoLoadWait());
- }
- public void OnDestroy()
- {
- if (this.m_MotionScriptMgr != null)
- {
- this.m_MotionScriptMgr.StopAndResetScriptAll();
- }
- }
- private IEnumerator CoLoadWait()
- {
- while (GameMain.Instance.CharacterMgr.IsBusy())
- {
- yield return null;
- }
- GameMain.Instance.CharacterMgr.ResetCharaPosAll();
- this.m_maid.boMabataki = true;
- MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Grab);
- MaidColliderCollect.AddCollider(this.m_maid, MaidColliderCollect.ColliderType.Touch);
- foreach (SceneVRTouch.TouchMotionScript touchMotionScript in this.m_listTouchMotionScript)
- {
- string[] array = touchMotionScript.m_strNeutralScript.Split(new char[]
- {
- '*'
- });
- this.m_MotionScriptMgr.LoadAndCacheScript(array[0]);
- this.m_MotionScriptMgr.LoadMotionCacheKag(array[0]);
- foreach (KeyValuePair<VRTouchMgr.ETouchPos, Dictionary<VRTouchMgr.ETouchBehavior, string>> keyValuePair in touchMotionScript.m_dicTouchScript)
- {
- foreach (KeyValuePair<VRTouchMgr.ETouchBehavior, string> keyValuePair2 in keyValuePair.Value)
- {
- array = keyValuePair2.Value.Split(new char[]
- {
- '*'
- });
- this.m_MotionScriptMgr.LoadAndCacheScript(array[0]);
- this.m_MotionScriptMgr.LoadMotionCacheKag(array[0]);
- }
- }
- }
- this.BgAndMotion(this.m_lstBgInfo[0]);
- GameMain.Instance.MainCamera.FadeIn(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
- yield break;
- }
- private void OnCompleteFadeIn()
- {
- }
- private List<SceneVRTouch.BGInfo> ReadBGList()
- {
- List<SceneVRTouch.BGInfo> list = new List<SceneVRTouch.BGInfo>();
- string text = "vr_touch_bg.nei";
- NDebug.Assert(GameUty.FileSystem.IsExistentFile(text), "背景リストファイルが読み取れません。");
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- SceneVRTouch.BGInfo bginfo = new SceneVRTouch.BGInfo();
- bginfo.nID = csvParser.GetCellAsInteger(0, i);
- bginfo.strThumbFileName = csvParser.GetCellAsString(1, i);
- bginfo.strName = csvParser.GetCellAsString(2, i);
- bginfo.strScriptTagFT = csvParser.GetCellAsString(3, i);
- bginfo.strFileName = csvParser.GetCellAsString(4, i);
- bginfo.strBGM = csvParser.GetCellAsString(5, i);
- bginfo.strCondition = csvParser.GetCellAsString(6, i);
- if (!string.IsNullOrEmpty(bginfo.strCondition))
- {
- YotogiStage.Data data = YotogiStage.GetData(bginfo.strCondition);
- if (data.isYotogiPlayable(GameMain.Instance.CharacterMgr.status.clubGrade, true))
- {
- goto IL_21A;
- }
- }
- string cellAsString = csvParser.GetCellAsString(7, i);
- string[] array = cellAsString.Split(new char[]
- {
- ' ',
- ',',
- 'f'
- }, StringSplitOptions.RemoveEmptyEntries);
- bginfo.vPos = new Vector3(float.Parse(array[0]), float.Parse(array[1]), float.Parse(array[2]));
- string text2 = csvParser.GetCellAsString(8, i);
- text2 = text2.Trim(new char[]
- {
- ' ',
- 'f'
- });
- bginfo.fRot = float.Parse(text2);
- bginfo.strValidPack = csvParser.GetCellAsString(9, i);
- if (!string.IsNullOrEmpty(bginfo.strThumbFileName))
- {
- bginfo.texThumb = ImportCM.CreateTexture(bginfo.strThumbFileName + ".tex");
- }
- else
- {
- Debug.LogWarning("BGボタンテクスチャの指定がありません。" + bginfo.strName);
- bginfo.texThumb = Resources.Load<Texture2D>("System/Texture/unsupported");
- }
- list.Add(bginfo);
- }
- IL_21A:;
- }
- }
- }
- return list;
- }
- private Dictionary<VRTouchMgr.ETouchPos, SceneVRTouch.TouchVoiceScript> ReadVoiceList()
- {
- Dictionary<VRTouchMgr.ETouchPos, SceneVRTouch.TouchVoiceScript> dictionary = new Dictionary<VRTouchMgr.ETouchPos, SceneVRTouch.TouchVoiceScript>();
- string text = "vr_touch_voice.nei";
- NDebug.Assert(GameUty.FileSystem.IsExistentFile(text), "背景リストファイルが読み取れません。");
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- this.m_kag = new VRTouchKagManager(this, scriptMgr.tjs, scriptMgr);
- this.m_kag.enabled = true;
- this.m_kag.Initialize();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- string cellAsString = csvParser.GetCellAsString(0, i);
- VRTouchMgr.ETouchPos key = VRTouchMgr.ETouchPos.無し;
- try
- {
- key = (VRTouchMgr.ETouchPos)Enum.Parse(typeof(VRTouchMgr.ETouchPos), cellAsString);
- }
- catch
- {
- NDebug.Assert("このタッチ部位は未定義です。" + cellAsString, false);
- }
- SceneVRTouch.TouchVoiceScript touchVoiceScript;
- if (!dictionary.TryGetValue(key, out touchVoiceScript))
- {
- touchVoiceScript = new SceneVRTouch.TouchVoiceScript();
- dictionary.Add(key, touchVoiceScript);
- }
- string cellAsString2 = csvParser.GetCellAsString(1, i);
- VRTouchMgr.ETouchBehavior key2 = VRTouchMgr.ETouchBehavior.無し;
- try
- {
- key2 = (VRTouchMgr.ETouchBehavior)Enum.Parse(typeof(VRTouchMgr.ETouchBehavior), cellAsString2);
- }
- catch
- {
- NDebug.Assert("この行動は未定義です。" + cellAsString2, false);
- }
- SceneVRTouch.TouchVoiceScript.TouchBehavior touchBehavior;
- if (!touchVoiceScript.m_listBeh.TryGetValue(key2, out touchBehavior))
- {
- touchBehavior = new SceneVRTouch.TouchVoiceScript.TouchBehavior();
- touchVoiceScript.m_listBeh.Add(key2, touchBehavior);
- }
- int num = csvParser.GetCellAsInteger(2, i) - 1;
- SceneVRTouch.TouchVoiceScript.TouchOrder touchOrder;
- if (!touchBehavior.m_dicOrderNo.TryGetValue(num, out touchOrder))
- {
- touchOrder = new SceneVRTouch.TouchVoiceScript.TouchOrder();
- touchBehavior.m_dicOrderNo.Add(num, touchOrder);
- if (touchBehavior.nOrderNoMax < num)
- {
- touchBehavior.nOrderNoMax = num;
- }
- }
- touchOrder.m_nLimit = csvParser.GetCellAsInteger(3, i);
- touchOrder.m_nTime = csvParser.GetCellAsInteger(4, i);
- string text2 = csvParser.GetCellAsString(5, i);
- if (string.IsNullOrEmpty(text2))
- {
- foreach (string str in this.m_strConditionNameTbl)
- {
- text2 = text2 + str + "|";
- }
- }
- int num2 = 0;
- int num3 = 0;
- string text3 = csvParser.GetCellAsString(6, i);
- if (string.IsNullOrEmpty(text3))
- {
- text3 = "A^M";
- }
- string[] array = text3.Split(new char[]
- {
- '^'
- });
- num2 = (int)(array[0][0] - 'A');
- num3 = (int)(array[1][0] - 'A');
- int num4 = 0;
- int num5 = 999;
- string text4 = csvParser.GetCellAsString(7, i);
- if (string.IsNullOrEmpty(text4))
- {
- text4 = "0^999";
- }
- string[] array2 = text4.Split(new char[]
- {
- '^'
- });
- num4 = int.Parse(array2[0]);
- num5 = int.Parse(array2[1]);
- string cellAsString3 = csvParser.GetCellAsString(8, i);
- string cellAsString4 = csvParser.GetCellAsString(9, i);
- string cellAsString5 = csvParser.GetCellAsString(10, i);
- string[] array3 = text2.Split(new char[]
- {
- '|'
- });
- foreach (string text5 in array3)
- {
- if (!string.IsNullOrEmpty(text5) && !(text5 == "無し"))
- {
- Relation relation = (Relation)Array.IndexOf<string>(this.m_strConditionNameTbl, text5);
- SceneVRTouch.TouchVoiceScript.TouchCondition touchCondition;
- if (!touchOrder.m_dicCondition.TryGetValue(relation, out touchCondition))
- {
- touchCondition = new SceneVRTouch.TouchVoiceScript.TouchCondition();
- touchCondition.eRelation = relation;
- touchOrder.m_dicCondition.Add(relation, touchCondition);
- }
- SceneVRTouch.TouchVoiceScript.Cup cup = touchCondition.FindCupRange(num2, num3);
- if (cup == null)
- {
- cup = new SceneVRTouch.TouchVoiceScript.Cup();
- cup.nCupLower = num2;
- cup.nCupUpper = num3;
- touchCondition.m_listCup.Add(cup);
- }
- SceneVRTouch.TouchVoiceScript.Waist waist = cup.FindWaistRange(num4, num5);
- if (waist == null)
- {
- waist = new SceneVRTouch.TouchVoiceScript.Waist();
- waist.nWaistLower = num4;
- waist.nWaistUpper = num5;
- cup.m_listWaist.Add(waist);
- }
- waist.strScriptFirst = cellAsString3;
- waist.strScriptBreath = cellAsString4;
- waist.strScriptAfter = cellAsString5;
- Dictionary<int, SceneVRTouch.RandVoiceList> randVoiceListFirst = this.ScriptRead(cellAsString3);
- Dictionary<int, SceneVRTouch.RandVoiceList> randVoiceListBreath = this.ScriptRead(cellAsString4);
- Dictionary<int, SceneVRTouch.RandVoiceList> randVoiceListAfter = this.ScriptRead(cellAsString5);
- waist.SetRandVoiceListFirst(randVoiceListFirst);
- waist.SetRandVoiceListBreath(randVoiceListBreath);
- waist.SetRandVoiceListAfter(randVoiceListAfter);
- }
- }
- }
- }
- }
- }
- if (this.m_kag != null)
- {
- this.m_kag.Dispose();
- this.m_kag = null;
- }
- return dictionary;
- }
- private Dictionary<int, SceneVRTouch.RandVoiceList> ScriptRead(string f_strScriptFileName)
- {
- Dictionary<int, SceneVRTouch.RandVoiceList> dicSet = new Dictionary<int, SceneVRTouch.RandVoiceList>();
- if (string.IsNullOrEmpty(f_strScriptFileName))
- {
- return null;
- }
- this.m_kag.SetShuffleDg(delegate(int f_nKouhun, string f_strVoiceFileName, string f_strFace, string f_strFaceBlend)
- {
- SceneVRTouch.RandVoiceList randVoiceList = null;
- if (!dicSet.TryGetValue(f_nKouhun, out randVoiceList))
- {
- randVoiceList = new SceneVRTouch.RandVoiceList();
- dicSet.Add(f_nKouhun, randVoiceList);
- }
- randVoiceList.AddSet(f_strVoiceFileName, f_strFace, f_strFaceBlend);
- });
- this.m_kag.LoadScriptFile(ScriptManager.ReplacePersonal(this.m_maid, f_strScriptFileName) + ".ks", string.Empty);
- this.m_kag.Exec();
- return dicSet;
- }
- private List<SceneVRTouch.TouchMotionScript> ReadMotionList()
- {
- List<SceneVRTouch.TouchMotionScript> list = new List<SceneVRTouch.TouchMotionScript>();
- string text = "vr_touch_motion.nei";
- NDebug.Assert(GameUty.FileSystem.IsExistentFile(text), "モーションリストファイルが読み取れません。");
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- SceneVRTouch.TouchMotionScript touchMotionScript = new SceneVRTouch.TouchMotionScript();
- touchMotionScript.m_nId = csvParser.GetCellAsInteger(0, i);
- touchMotionScript.m_strThumb = csvParser.GetCellAsString(1, i);
- touchMotionScript.m_strFTScript = csvParser.GetCellAsString(2, i);
- if (!string.IsNullOrEmpty(touchMotionScript.m_strFTScript))
- {
- touchMotionScript.m_strFTScript = ScriptManager.ReplacePersonal(this.m_maid, touchMotionScript.m_strFTScript) + ".ks";
- }
- touchMotionScript.m_strNeutralScript = csvParser.GetCellAsString(3, i);
- for (int j = 4; j < csvParser.max_cell_x; j++)
- {
- string cellAsString = csvParser.GetCellAsString(j, 0);
- string[] array = cellAsString.Split(new char[]
- {
- '_'
- });
- VRTouchMgr.ETouchPos f_pos = VRTouchMgr.ETouchPos.無し;
- try
- {
- f_pos = (VRTouchMgr.ETouchPos)Enum.Parse(typeof(VRTouchMgr.ETouchPos), array[0]);
- }
- catch
- {
- NDebug.Assert("この部位は未定義です。" + array[0], false);
- }
- VRTouchMgr.ETouchBehavior f_beh = VRTouchMgr.ETouchBehavior.無し;
- try
- {
- f_beh = (VRTouchMgr.ETouchBehavior)Enum.Parse(typeof(VRTouchMgr.ETouchBehavior), array[1]);
- }
- catch
- {
- NDebug.Assert("この行動は未定義です。" + array[1], false);
- }
- string cellAsString2 = csvParser.GetCellAsString(j, i);
- touchMotionScript.AddScript(f_pos, f_beh, cellAsString2);
- }
- if (!string.IsNullOrEmpty(touchMotionScript.m_strThumb))
- {
- touchMotionScript.m_texThumb = ImportCM.CreateTexture(touchMotionScript.m_strThumb + ".tex");
- }
- else
- {
- Debug.LogWarning("モーションボタンテクスチャの指定がありません。" + touchMotionScript.m_nId);
- touchMotionScript.m_texThumb = Resources.Load<Texture2D>("System/Texture/unsupported");
- }
- list.Add(touchMotionScript);
- }
- }
- }
- }
- return list;
- }
- public void Bg(SceneEdit.PVBInfo f_pvb)
- {
- SceneVRTouch.ButtonBG buttonBG = f_pvb as SceneVRTouch.ButtonBG;
- this.BgAndMotion(buttonBG.m_bg);
- }
- private void BgAndMotion(SceneVRTouch.BGInfo f_bi)
- {
- this.m_BGInfoNow = f_bi;
- GameMain.Instance.BgMgr.ChangeBg(f_bi.strFileName);
- GameMain.Instance.BgMgr.SetPos(f_bi.vPos);
- GameMain.Instance.BgMgr.SetRot(new Vector3(0f, f_bi.fRot, 0f));
- GameMain.Instance.SoundMgr.PlayBGM(f_bi.strBGM + ".ogg", 1f, true);
- this.Motion((this.m_MotionScriptNow != null) ? this.m_MotionScriptNow : this.m_listTouchMotionScript[0]);
- }
- public void Pose(SceneEdit.PVBInfo f_pvb)
- {
- SceneVRTouch.ButtonPose buttonPose = f_pvb as SceneVRTouch.ButtonPose;
- this.Motion(buttonPose.m_motion);
- }
- private void Motion(SceneVRTouch.TouchMotionScript f_motion)
- {
- this.m_MotionScriptNow = f_motion;
- if (!string.IsNullOrEmpty(f_motion.m_strFTScript) && !string.IsNullOrEmpty(this.m_BGInfoNow.strScriptTagFT))
- {
- GameMain.Instance.ScriptMgr.EvalScript("global.__vrtouch_first_file = '" + f_motion.m_strFTScript + "';");
- GameMain.Instance.ScriptMgr.EvalScript("global.__vrtouch_first_tag = '*" + this.m_BGInfoNow.strScriptTagFT + "';");
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptArgLabelFT);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- else
- {
- Debug.LogWarning("モーションFTの指定がありませんでした。ID:" + f_motion.m_nId);
- }
- this.PlayMotionScript(f_motion.GetScriptNeutral());
- }
- private void PlayMotionScript(string f_strFileLabelName)
- {
- float realtimeSinceStartup = Time.realtimeSinceStartup;
- string[] array = f_strFileLabelName.Split(new char[]
- {
- '*'
- });
- this.m_MotionScriptMgr.LoadAndCacheScript(array[0]);
- this.m_MotionScriptMgr.StartMotionScript(array[0], "*" + array[1], 0, null);
- Debug.Log("PlayMotionScript time=" + (Time.realtimeSinceStartup - realtimeSinceStartup).ToString("F6"));
- }
- public void ClothesState(SceneEditInfo.ClothesState f_cs)
- {
- Maid maid = this.m_maid;
- if (f_cs == SceneEditInfo.ClothesState.Nude)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.Nude);
- }
- else if (f_cs == SceneEditInfo.ClothesState.Underwear)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.Underwear);
- }
- if (f_cs == SceneEditInfo.ClothesState.Wear)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- }
- }
- private IEnumerator CoVoicePlayFirstAndBreath(SceneVRTouch.TouchVoiceScript.TouchOrder f_order, bool f_bFirstPlay, bool f_bForceFirstPlay)
- {
- this.m_bVoiceAfter = false;
- this.m_bSkippedPlayFirst = true;
- SceneVRTouch.TouchVoiceScript.TouchCondition cond = f_order.GetTouchCondition(this.m_maid);
- SceneVRTouch.TouchVoiceScript.Cup cup = cond.GetCup(this.m_maid);
- SceneVRTouch.TouchVoiceScript.Waist waist = cup.GetWaist(this.m_maid);
- int nKouhun = Math.Min((int)this.m_fKouhunNow, f_order.m_nLimit);
- SceneVRTouch.RandVoiceList randFirst = waist.GetRandVoiceListFirst(nKouhun);
- SceneVRTouch.RandVoiceList randBreath = waist.GetRandVoiceListBreath(nKouhun);
- SceneVRTouch.RandVoiceList randAfter = waist.GetRandVoiceListAfter(nKouhun);
- SceneVRTouch.RandVoiceList.Set setFirst = randFirst.GetVoiceFace();
- if (f_bFirstPlay && (f_bForceFirstPlay || !this.m_bNowPlayFirst))
- {
- if (this.m_maid.AudioMan.isPlay())
- {
- this.m_maid.AudioMan.Stop();
- }
- this.m_bNowPlayFirst = true;
- this.m_bSkippedPlayFirst = false;
- this.m_maid.AudioMan.LoadPlay(setFirst.m_strVoiceFileName, 0f, false, false);
- this.m_maid.FaceAnime(setFirst.m_strFace, 1f, 0);
- this.m_maid.FaceBlend((!string.IsNullOrEmpty(setFirst.m_strFaceBlend)) ? setFirst.m_strFaceBlend : "無し");
- }
- while (this.m_bNowPlayFirst)
- {
- if (!this.m_maid.AudioMan.isPlay())
- {
- this.m_bNowPlayFirst = false;
- break;
- }
- yield return null;
- }
- while (!this.m_bVoiceAfter)
- {
- SceneVRTouch.RandVoiceList.Set set = randBreath.GetVoiceFace();
- this.m_maid.AudioMan.LoadPlay(set.m_strVoiceFileName, 0f, false, false);
- this.m_maid.FaceAnime(set.m_strFace, 1f, 0);
- this.m_maid.FaceBlend((!string.IsNullOrEmpty(set.m_strFaceBlend)) ? set.m_strFaceBlend : "無し");
- while (this.m_maid.AudioMan.isPlay())
- {
- yield return null;
- }
- }
- for (;;)
- {
- SceneVRTouch.RandVoiceList.Set set2 = randAfter.GetVoiceFace();
- this.m_maid.AudioMan.LoadPlay(set2.m_strVoiceFileName, 0f, false, false);
- this.m_maid.FaceAnime(set2.m_strFace, 1f, 0);
- this.m_maid.FaceBlend((!string.IsNullOrEmpty(set2.m_strFaceBlend)) ? set2.m_strFaceBlend : "無し");
- while (this.m_maid.AudioMan.isPlay())
- {
- yield return null;
- }
- }
- yield break;
- }
- private void PlayVoice_First(SceneVRTouch.TouchVoiceScript.TouchOrder f_order, bool f_bFirstPlay, bool f_bForceFirstPlay)
- {
- float realtimeSinceStartup = Time.realtimeSinceStartup;
- if (this.m_coVoicePlayBraeth != null)
- {
- base.StopCoroutine(this.m_coVoicePlayBraeth);
- }
- this.m_coVoicePlayBraeth = base.StartCoroutine(this.CoVoicePlayFirstAndBreath(f_order, f_bFirstPlay, f_bForceFirstPlay));
- }
- private void PlayVoice_After()
- {
- this.m_bVoiceAfter = true;
- }
- private void OnButtonEndClick()
- {
- GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
- }
- private void OnCompleteFadeOut()
- {
- if (!string.IsNullOrEmpty(this.m_strScriptArgLabelEnd))
- {
- Debug.Log("OnEndScene JumpTo " + this.m_strScriptArgLabelEnd);
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptArgLabelEnd);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- }
- private void Update()
- {
- this.m_TouchMgr.FrameStart();
- bool flag = false;
- VRTouchMgr.EHand eTouchHandNow = VRTouchMgr.EHand.Non;
- VRTouchMgr.ETouchPos etouchPos = VRTouchMgr.ETouchPos.無し;
- VRTouchMgr.ETouchBehavior eTouchBehNow = VRTouchMgr.ETouchBehavior.無し;
- bool flag2 = false;
- float realtimeSinceStartup = Time.realtimeSinceStartup;
- foreach (KeyValuePair<VRTouchMgr.ETouchPos, SceneVRTouch.TouchVoiceScript> keyValuePair in this.m_dicTouchVoiceScript)
- {
- for (int i = 0; i <= 1; i++)
- {
- for (int j = 1; j <= 2; j++)
- {
- SceneVRTouch.TouchVoiceScript.TouchBehavior touchBehavior;
- if (this.m_TouchMgr.GetBehaviorTouchDown((VRTouchMgr.EHand)i, keyValuePair.Key, (VRTouchMgr.ETouchBehavior)j, 0) && keyValuePair.Value.m_listBeh.TryGetValue((VRTouchMgr.ETouchBehavior)j, out touchBehavior))
- {
- if (this.m_eTouchPosNow == VRTouchMgr.ETouchPos.無し || (this.m_eTouchHandNow == (VRTouchMgr.EHand)i && this.m_eTouchPosNow == keyValuePair.Key && this.m_eTouchBehNow != (VRTouchMgr.ETouchBehavior)j))
- {
- this.m_nOrderNoNow = 0;
- flag = true;
- bool f_bFirstPlay = true;
- bool f_bForceFirstPlay = false;
- if (this.m_eTouchBehNow == VRTouchMgr.ETouchBehavior.掴む && j == 1)
- {
- f_bFirstPlay = false;
- }
- if (this.m_eTouchBehNow == VRTouchMgr.ETouchBehavior.触る && j == 2)
- {
- f_bForceFirstPlay = true;
- }
- if (this.m_eTouchBehNow == VRTouchMgr.ETouchBehavior.無し && j == 2)
- {
- f_bForceFirstPlay = true;
- }
- eTouchHandNow = (this.m_eTouchHandNow = (VRTouchMgr.EHand)i);
- etouchPos = (this.m_eTouchPosNow = keyValuePair.Key);
- eTouchBehNow = (this.m_eTouchBehNow = (VRTouchMgr.ETouchBehavior)j);
- this.PlayVoice_First(touchBehavior.m_dicOrderNo[this.m_nOrderNoNow], f_bFirstPlay, f_bForceFirstPlay);
- this.PlayMotionScript(this.m_MotionScriptNow.GetScript(this.m_eTouchPosNow, this.m_eTouchBehNow));
- }
- flag2 = true;
- break;
- }
- }
- if (flag2)
- {
- break;
- }
- }
- if (flag2)
- {
- break;
- }
- }
- SceneVRTouch.TouchVoiceScript.TouchBehavior touchBehavior2;
- if (this.m_eTouchPosNow != VRTouchMgr.ETouchPos.無し && this.m_TouchMgr.GetBehaviorTouchOrGrab(this.m_eTouchHandNow, this.m_eTouchPosNow, 0) && this.m_dicTouchVoiceScript[this.m_eTouchPosNow].m_listBeh.TryGetValue(this.m_eTouchBehNow, out touchBehavior2))
- {
- int num = (int)this.m_fKouhunNow;
- SceneVRTouch.TouchVoiceScript.TouchOrder touchOrder = null;
- try
- {
- touchOrder = touchBehavior2.m_dicOrderNo[this.m_nOrderNoNow];
- }
- catch
- {
- Debug.LogError(string.Concat(new object[]
- {
- "発生順オーバー:",
- this.m_nOrderNoNow,
- "/",
- touchBehavior2.nOrderNoMax,
- ":",
- this.m_eTouchPosNow,
- ":",
- this.m_eTouchBehNow
- }));
- }
- if (this.m_fKouhunNow <= (float)touchOrder.m_nLimit)
- {
- this.m_fKouhunNow += Time.deltaTime / (float)touchOrder.m_nTime;
- if ((float)touchOrder.m_nLimit < this.m_fKouhunNow)
- {
- this.m_fKouhunNow = (float)touchOrder.m_nLimit;
- }
- flag = true;
- }
- if (num < (int)this.m_fKouhunNow)
- {
- this.m_nOrderNoNow++;
- if (touchBehavior2.nOrderNoMax < this.m_nOrderNoNow)
- {
- this.m_nOrderNoNow = touchBehavior2.nOrderNoMax;
- }
- Debug.Log("興奮度UP:" + this.m_nOrderNoNow);
- this.PlayVoice_First(touchBehavior2.m_dicOrderNo[this.m_nOrderNoNow], true, false);
- }
- eTouchHandNow = this.m_eTouchHandNow;
- etouchPos = this.m_eTouchPosNow;
- eTouchBehNow = this.m_eTouchBehNow;
- }
- SceneVRTouch.TouchVoiceScript.TouchBehavior touchBehavior3;
- if (!flag && this.m_dicTouchVoiceScript[VRTouchMgr.ETouchPos.無し].m_listBeh.TryGetValue(VRTouchMgr.ETouchBehavior.無し, out touchBehavior3))
- {
- this.m_fKouhunNow += Time.deltaTime / (float)touchBehavior3.m_dicOrderNo[0].m_nTime;
- if (this.m_fKouhunNow <= 0f)
- {
- this.m_fKouhunNow = 0f;
- }
- if (0f < this.m_fKouhunBefore && this.m_fKouhunNow <= 0f)
- {
- this.PlayVoice_First(touchBehavior3.m_dicOrderNo[0], true, false);
- this.PlayMotionScript(this.m_MotionScriptNow.m_strNeutralScript);
- }
- }
- if (etouchPos == VRTouchMgr.ETouchPos.無し)
- {
- this.PlayVoice_After();
- }
- this.m_fKouhunBefore = this.m_fKouhunNow;
- this.m_eTouchHandNow = eTouchHandNow;
- this.m_eTouchPosNow = etouchPos;
- this.m_eTouchBehNow = eTouchBehNow;
- this.m_TouchMgr.FrameEnd();
- if (GameMain.Instance.ScriptMgr.is_motion_all_prop_seq)
- {
- GameMain.Instance.ScriptMgr.motion_all_prop_seq_maid.AllProcPropSeqStart();
- GameMain.Instance.ScriptMgr.motion_all_prop_seq_maid = null;
- GameMain.Instance.ScriptMgr.is_motion_all_prop_seq = false;
- }
- this.m_MotionScriptMgr.Update();
- }
- private List<SceneVRTouch.BGInfo> m_lstBgInfo;
- private string[] m_strConditionNameTbl = new string[]
- {
- "無し",
- "緊張",
- "お近づき",
- "信頼",
- "恋人",
- "愛奴"
- };
- private Dictionary<VRTouchMgr.ETouchPos, SceneVRTouch.TouchVoiceScript> m_dicTouchVoiceScript;
- private List<SceneVRTouch.TouchMotionScript> m_listTouchMotionScript;
- private Maid m_maid;
- private Vector3 m_vCamResetTargetPos;
- private Vector2 m_vCamResetAngle;
- private float m_fCamResetDistance;
- private VRTouchMgr m_TouchMgr;
- private VRTouchKagManager m_kag;
- [SerializeField]
- private VRTouchMgr.EHand m_eTouchHandNow = VRTouchMgr.EHand.Non;
- [SerializeField]
- private VRTouchMgr.ETouchPos m_eTouchPosNow;
- [SerializeField]
- private VRTouchMgr.ETouchBehavior m_eTouchBehNow;
- [SerializeField]
- private int m_nOrderNoNow;
- [SerializeField]
- private float m_fKouhunNow;
- private float m_fKouhunBefore;
- private SceneVRTouch.BGInfo m_BGInfoNow;
- private SceneVRTouch.TouchMotionScript m_MotionScriptNow;
- private string m_strScriptArgLabelEnd;
- private string m_strScriptArgLabelFT;
- public List<SceneEdit.PVBInfo> m_listPose = new List<SceneEdit.PVBInfo>();
- public List<SceneEdit.PVBInfo> m_listBg = new List<SceneEdit.PVBInfo>();
- private UIButton m_btnEnd;
- private ScriptManagerFast m_MotionScriptMgr;
- private Coroutine m_coVoicePlayBraeth;
- private bool m_bVoiceAfter;
- private bool m_bNowPlayFirst;
- private bool m_bSkippedPlayFirst;
- public class RandVoiceList
- {
- public void AddSet(string f_strVoiceFileName, string f_strFace, string f_strFaceBlend)
- {
- this.m_listVoiceFace.Add(new SceneVRTouch.RandVoiceList.Set(f_strVoiceFileName + ".ogg", f_strFace, f_strFaceBlend));
- }
- private void Shuffle()
- {
- System.Random random = new System.Random();
- List<SceneVRTouch.RandVoiceList.Set> listVoiceFace = this.m_listVoiceFace;
- int i = listVoiceFace.Count;
- while (i > 1)
- {
- i--;
- int index = random.Next(i + 1);
- SceneVRTouch.RandVoiceList.Set value = listVoiceFace[index];
- listVoiceFace[index] = listVoiceFace[i];
- listVoiceFace[i] = value;
- }
- }
- public SceneVRTouch.RandVoiceList.Set GetVoiceFace()
- {
- if (this.m_nNow == 0)
- {
- this.Shuffle();
- }
- SceneVRTouch.RandVoiceList.Set result = this.m_listVoiceFace[this.m_nNow];
- if (this.m_listVoiceFace.Count <= this.m_nNow)
- {
- this.m_nNow = 0;
- }
- return result;
- }
- private List<SceneVRTouch.RandVoiceList.Set> m_listVoiceFace = new List<SceneVRTouch.RandVoiceList.Set>();
- private int m_nNow;
- public class Set
- {
- public Set(string f_strVoiceFileName, string f_strFace, string f_strFaceBlend)
- {
- this.m_strVoiceFileName = f_strVoiceFileName;
- this.m_strFace = f_strFace;
- this.m_strFaceBlend = f_strFaceBlend;
- }
- public string m_strVoiceFileName;
- public string m_strFace;
- public string m_strFaceBlend;
- }
- }
- private class BGInfo
- {
- public int nID;
- public string strThumbFileName;
- public string strName;
- public string strScriptTagFT;
- public string strFileName;
- public string strBGM;
- public string strCondition;
- public Vector3 vPos;
- public float fRot;
- public string strValidPack;
- public Texture2D texThumb;
- }
- private class TouchVoiceScript
- {
- public Dictionary<VRTouchMgr.ETouchBehavior, SceneVRTouch.TouchVoiceScript.TouchBehavior> m_listBeh = new Dictionary<VRTouchMgr.ETouchBehavior, SceneVRTouch.TouchVoiceScript.TouchBehavior>();
- public class Waist
- {
- public void SetRandVoiceListFirst(Dictionary<int, SceneVRTouch.RandVoiceList> f_dicRandVoiceList)
- {
- this.m_dicRandVoiceFirst = f_dicRandVoiceList;
- }
- public void SetRandVoiceListBreath(Dictionary<int, SceneVRTouch.RandVoiceList> f_dicRandVoiceList)
- {
- this.m_dicRandVoiceBreath = f_dicRandVoiceList;
- }
- public void SetRandVoiceListAfter(Dictionary<int, SceneVRTouch.RandVoiceList> f_dicRandVoiceList)
- {
- this.m_dicRandVoiceAfter = f_dicRandVoiceList;
- }
- public SceneVRTouch.RandVoiceList GetRandVoiceListFirst(int f_nKouhun)
- {
- return this.m_dicRandVoiceFirst[f_nKouhun];
- }
- public SceneVRTouch.RandVoiceList GetRandVoiceListBreath(int f_nKouhun)
- {
- return this.m_dicRandVoiceBreath[f_nKouhun];
- }
- public SceneVRTouch.RandVoiceList GetRandVoiceListAfter(int f_nKouhun)
- {
- return this.m_dicRandVoiceAfter[f_nKouhun];
- }
- public int nWaistLower;
- public int nWaistUpper = 999;
- public string strScriptFirst;
- public string strScriptBreath;
- public string strScriptAfter;
- private Dictionary<int, SceneVRTouch.RandVoiceList> m_dicRandVoiceFirst = new Dictionary<int, SceneVRTouch.RandVoiceList>();
- private Dictionary<int, SceneVRTouch.RandVoiceList> m_dicRandVoiceBreath = new Dictionary<int, SceneVRTouch.RandVoiceList>();
- private Dictionary<int, SceneVRTouch.RandVoiceList> m_dicRandVoiceAfter = new Dictionary<int, SceneVRTouch.RandVoiceList>();
- }
- public class Cup
- {
- public SceneVRTouch.TouchVoiceScript.Waist FindWaistRange(int nMin, int nMax)
- {
- return this.m_listWaist.Find((SceneVRTouch.TouchVoiceScript.Waist a) => a.nWaistLower == nMin && a.nWaistUpper == nMax);
- }
- public SceneVRTouch.TouchVoiceScript.Waist FindWaistValue(int nValue)
- {
- return this.m_listWaist.Find((SceneVRTouch.TouchVoiceScript.Waist a) => a.nWaistLower <= nValue && nValue <= a.nWaistUpper);
- }
- public SceneVRTouch.TouchVoiceScript.Waist GetWaist(Maid f_maid)
- {
- SceneVRTouch.TouchVoiceScript.Waist waist = this.FindWaistValue(f_maid.status.body.waist);
- NDebug.Assert(waist != null, "ウェスト条件に合うボイススクリプトがありません。");
- return waist;
- }
- public int nCupLower;
- public int nCupUpper = 9;
- public List<SceneVRTouch.TouchVoiceScript.Waist> m_listWaist = new List<SceneVRTouch.TouchVoiceScript.Waist>();
- }
- public class TouchCondition
- {
- public SceneVRTouch.TouchVoiceScript.Cup FindCupRange(int nMin, int nMax)
- {
- return this.m_listCup.Find((SceneVRTouch.TouchVoiceScript.Cup a) => a.nCupLower == nMin && a.nCupUpper == nMax);
- }
- public SceneVRTouch.TouchVoiceScript.Cup FindCupValue(int nValue)
- {
- return this.m_listCup.Find((SceneVRTouch.TouchVoiceScript.Cup a) => a.nCupLower <= nValue && nValue <= a.nCupUpper);
- }
- public SceneVRTouch.TouchVoiceScript.Cup GetCup(Maid f_maid)
- {
- SceneVRTouch.TouchVoiceScript.Cup cup = this.FindCupValue((int)(f_maid.status.body.cup[0] - 'A'));
- NDebug.Assert(cup != null, "カップ条件に合うボイススクリプトがありません。");
- return cup;
- }
- public Relation eRelation;
- public List<SceneVRTouch.TouchVoiceScript.Cup> m_listCup = new List<SceneVRTouch.TouchVoiceScript.Cup>();
- }
- public class TouchOrder
- {
- public SceneVRTouch.TouchVoiceScript.TouchCondition GetTouchCondition(Maid f_maid)
- {
- return this.m_dicCondition[f_maid.status.relation];
- }
- public int m_nLimit;
- public int m_nTime;
- public Dictionary<Relation, SceneVRTouch.TouchVoiceScript.TouchCondition> m_dicCondition = new Dictionary<Relation, SceneVRTouch.TouchVoiceScript.TouchCondition>();
- }
- public class TouchBehavior
- {
- public int nOrderNoMax;
- public Dictionary<int, SceneVRTouch.TouchVoiceScript.TouchOrder> m_dicOrderNo = new Dictionary<int, SceneVRTouch.TouchVoiceScript.TouchOrder>();
- }
- }
- private class TouchMotionScript
- {
- public void AddScript(VRTouchMgr.ETouchPos f_pos, VRTouchMgr.ETouchBehavior f_beh, string f_strScript)
- {
- Dictionary<VRTouchMgr.ETouchBehavior, string> dictionary;
- if (!this.m_dicTouchScript.TryGetValue(f_pos, out dictionary))
- {
- dictionary = new Dictionary<VRTouchMgr.ETouchBehavior, string>();
- this.m_dicTouchScript.Add(f_pos, dictionary);
- }
- dictionary.Add(f_beh, f_strScript);
- }
- public string GetScript(VRTouchMgr.ETouchPos f_pos, VRTouchMgr.ETouchBehavior f_beh)
- {
- return this.m_dicTouchScript[f_pos][f_beh];
- }
- public string GetScriptNeutral()
- {
- return this.m_strNeutralScript;
- }
- public int m_nId;
- public string m_strThumb;
- public string m_strFTScript;
- public string m_strNeutralScript;
- public Texture2D m_texThumb;
- public Dictionary<VRTouchMgr.ETouchPos, Dictionary<VRTouchMgr.ETouchBehavior, string>> m_dicTouchScript = new Dictionary<VRTouchMgr.ETouchPos, Dictionary<VRTouchMgr.ETouchBehavior, string>>();
- }
- private class ButtonPose : SceneEdit.PVBInfo
- {
- public SceneVRTouch.TouchMotionScript m_motion;
- }
- private class ButtonBG : SceneEdit.PVBInfo
- {
- public SceneVRTouch.BGInfo m_bg;
- }
- }
|