12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using I2.Loc;
- using UnityEngine;
- using wf;
- public class RhythmAction_Mgr : MonoBehaviour
- {
- public static RhythmAction_Mgr.DanceType NowDance
- {
- get
- {
- return RhythmAction_Mgr.m_DanceType;
- }
- }
- public static int DanceReward { get; private set; }
- public static RhythmAction_Mgr.DanceState NowState { get; private set; }
- public static RhythmAction_Mgr Instance
- {
- get
- {
- return RhythmAction_Mgr.m_Instance;
- }
- }
- public string MusicCSV_Path
- {
- get
- {
- return "csv_rhythm_action/" + this.m_UseMusicName + "/";
- }
- }
- public List<Maid> DanceMaid
- {
- get
- {
- return this.m_DanceMain.DanceMaid;
- }
- }
- public Maid UserMaid
- {
- get
- {
- return this.m_DanceMain.UserMaid;
- }
- }
- public bool IsTakeEnd
- {
- get
- {
- return this.m_DanceMain.m_AnimatorData.takeName == null;
- }
- }
- public float TakeTime
- {
- get
- {
- return this.m_DanceMain.m_AnimatorData.GetTakeTime();
- }
- }
- public bool IsPause
- {
- get
- {
- return this.m_IsPause;
- }
- }
- public AVProVideoPlayer MovieMgr { get; private set; }
- public float DanceDeltaTime { get; private set; }
- public Transform OvrCamTrans
- {
- get
- {
- return this.m_DanceMain.OvrCamTrans;
- }
- }
- public GameObject UIScreen { get; private set; }
- public bool IsReadyNow
- {
- get
- {
- return this.m_ReadyPanel;
- }
- }
- public float DanceTimer { get; private set; }
- public bool DanceEnd
- {
- get
- {
- return this.m_DanceMain.IsDanceEnd;
- }
- }
- public bool ForceDanceEnd
- {
- get
- {
- return this.m_DanceMain.IsForceDanceEnd;
- }
- }
- public List<Maid> FactOrderList
- {
- get
- {
- return this.m_FactOrderList;
- }
- }
- public bool IsDanceSkip
- {
- get
- {
- return this.m_DanceMain.IsDanceSkip;
- }
- }
- public bool IsNewController
- {
- get
- {
- return GameMain.Instance.VRMode && GameMain.Instance.OvrMgr.ovr_obj.left_controller.controller.IsControllerTypeNew && GameMain.Instance.OvrMgr.ovr_obj.right_controller.controller.IsControllerTypeNew;
- }
- }
- public float RemainingTime
- {
- get
- {
- return Mathf.Max(this.TakeTime - this.DanceTimer, 0f);
- }
- }
- public static int MusicReleaseFlag
- {
- get
- {
- return GameMain.Instance.CharacterMgr.status.GetFlag("_楽曲解放");
- }
- set
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("_楽曲解放", value);
- }
- }
- public static bool IsVSDance
- {
- get
- {
- return RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.VS || RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.VS_Skip;
- }
- }
- public static bool IsVSDanceFirst
- {
- get
- {
- return RhythmAction_Mgr.IsVSDance && RhythmAction_Mgr.NowState == RhythmAction_Mgr.DanceState.Dance_First;
- }
- }
- public static bool IsRhythmGameMode
- {
- get
- {
- bool flag = true;
- flag &= (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.View && RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Touch && RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Encore);
- return flag & (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.VS_Skip && RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.BenchMark);
- }
- }
- private void Awake()
- {
- RhythmAction_Mgr.m_Instance = this;
- this.m_NowTime = 0f;
- this.m_LastTime = 0f;
- this.m_DanceMain = GameObject.Find("_DanceMain_").GetComponent<DanceMain>();
- if (DanceMain.SelectDanceData != null && !string.IsNullOrEmpty(DanceMain.SelectDanceData.csvFolderName))
- {
- this.m_UseMusicName = DanceMain.SelectDanceData.csvFolderName;
- }
- if (!base.transform.parent)
- {
- GameObject gameObject = GameObject.Find("UI Root");
- base.transform.SetParent(gameObject.transform, false);
- }
- GameObject gameObject2 = base.transform.parent.Find("Camera").gameObject;
- this.m_RhythmActionCam = UnityEngine.Object.Instantiate<GameObject>(gameObject2, base.transform.parent).GetComponent<Camera>();
- this.m_RhythmActionCam.name = "RhythmActionCam";
- this.m_NguiCam = gameObject2.GetComponent<Camera>();
- if (DanceMain.SelectDanceData != null && !this.m_NguiCam.enabled)
- {
- this.m_NguiCam.enabled = true;
- }
- if (!GameMain.Instance.VRMode || !this.IsNewController)
- {
- this.m_NguiCam.cullingMask = this.m_RhythmAction2DLayer;
- this.m_RhythmActionCam.gameObject.SetActive(false);
- }
- else
- {
- this.m_OrijinLimit = GameMain.Instance.OvrMgr.OvrCamera.HandLimitMode;
- GameMain.Instance.OvrMgr.OvrCamera.HandLimitMode = AVRControllerBehavior.LIMIT_MODE.NO_WARP;
- this.m_RhythmActionCam.cullingMask = this.m_RhythmActionLayer;
- this.m_LeftPenlight = Utility.CreatePrefab(GameMain.Instance.OvrMgr.GetVRControllerTransform(true).gameObject, "SceneDance/Rhythm_Action/Prefab/StickLight", true);
- this.m_LeftPenlight.name = "PenLight(left)";
- this.m_RightPenlight = Utility.CreatePrefab(GameMain.Instance.OvrMgr.GetVRControllerTransform(false).gameObject, "SceneDance/Rhythm_Action/Prefab/StickLight", true);
- this.m_RightPenlight.name = "PenLight(light)";
- Transform transform = this.m_LeftPenlight.transform;
- Vector3 vector = Vector3.zero;
- this.m_RightPenlight.transform.localEulerAngles = vector;
- transform.localEulerAngles = vector;
- Transform transform2 = this.m_LeftPenlight.transform;
- vector = this.m_PenlightOffset;
- this.m_RightPenlight.transform.localPosition = vector;
- transform2.localPosition = vector;
- Transform transform3 = this.m_LeftPenlight.transform;
- vector = this.m_PenlightScale;
- this.m_RightPenlight.transform.localScale = vector;
- transform3.localScale = vector;
- UnityEngine.Object.Destroy(this.m_LeftPenlight.GetComponent<OvrControllerHit>());
- UnityEngine.Object.Destroy(this.m_RightPenlight.GetComponent<OvrControllerHit>());
- UnityEngine.Object.Destroy(this.m_LeftPenlight.GetComponent<ViveControllerHit>());
- UnityEngine.Object.Destroy(this.m_RightPenlight.GetComponent<ViveControllerHit>());
- }
- if (!DanceMain.KaraokeMode && GameMain.Instance.VRMode)
- {
- this.m_OvrUI = GameMain.Instance.OvrMgr.OvrCamera.m_goOvrUiScreen.GetComponent<OvrUI>();
- GameMain.Instance.OvrMgr.OvrCamera.m_goOvrUiScreen.SetActive(true);
- this.UIScreen = this.m_OvrUI.transform.Find("ovr_screen").gameObject;
- this.m_FirstScreen = this.UIScreen.transform.localPosition;
- if (this.IsNewController)
- {
- this.m_RhythmActionTex = Resources.Load<RenderTexture>("SceneDance/Rhythm_Action/rtRhythmActionUI");
- this.m_RhythmActionCam.targetTexture = this.m_RhythmActionTex;
- this.m_ScreenMat = this.UIScreen.transform.Find("default").GetComponent<MeshRenderer>().material;
- this.m_ScreenMat.mainTexture = this.m_RhythmActionTex;
- this.UIScreen.transform.Find("hit").gameObject.SetActive(false);
- }
- GameMain.Instance.OvrMgr.OvrCamera.HandDanceMode = (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.VS_Skip);
- }
- this.m_MainCamDepth = GameMain.Instance.MainCamera.GetComponent<DepthOfFieldScatter>();
- if (this.m_MainCamDepth)
- {
- this.m_OrijinDepthEnable = this.m_MainCamDepth.enabled;
- this.m_OrijinFocalSize = this.m_MainCamDepth.focalSize;
- this.m_MainCamDepth.focalSize = this.m_DanceMain.DepthFocalSize;
- this.m_MainCamDepth.enabled = DanceSetting.Settings.IsDepthOfFieldOn;
- }
- foreach (RhythmAction_Mgr.ChoiceObjpair choiceObjpair in this.m_ChoiceUIList)
- {
- choiceObjpair.UILocalize = choiceObjpair.EventUI.GetComponent<Localize>();
- switch (choiceObjpair.Choice)
- {
- case RhythmAction_Mgr.PauseChoices.Continue:
- this.AddEventMethod(choiceObjpair.EventUI, new EventDelegate.Callback(this.SelectContinue));
- break;
- case RhythmAction_Mgr.PauseChoices.End:
- if (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.VS_Skip)
- {
- this.AddEventMethod(choiceObjpair.EventUI, new EventDelegate.Callback(this.SelectEnd));
- }
- else
- {
- choiceObjpair.EventUI.SetActive(false);
- }
- break;
- case RhythmAction_Mgr.PauseChoices.Recet:
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Free)
- {
- this.AddEventMethod(choiceObjpair.EventUI, new EventDelegate.Callback(this.SelectRecet));
- }
- else
- {
- choiceObjpair.EventUI.SetActive(false);
- choiceObjpair.EventUI.transform.parent.localPosition += Vector3.down * this.m_ChoiceUIDown;
- }
- break;
- case RhythmAction_Mgr.PauseChoices.Skip:
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.VS_Skip)
- {
- this.AddEventMethod(choiceObjpair.EventUI, new EventDelegate.Callback(this.SelectSkip));
- }
- else
- {
- choiceObjpair.EventUI.SetActive(false);
- }
- break;
- }
- }
- this.ChoicesUIRecet();
- this.m_PausePanel.SetActive(false);
- GameObject gameObject3 = GameObject.Find("LiveGimic");
- if (gameObject3)
- {
- this.Search_AllEffect(gameObject3.transform, false);
- }
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
- {
- GameMain.Instance.SysShortcut.gameObject.SetActive(false);
- }
- }
- private void Update()
- {
- if (this.m_LastTime != 0f)
- {
- this.m_NowTime = Time.realtimeSinceStartup;
- }
- if (this.m_LeftPenlight && this.m_RightPenlight)
- {
- this.m_LeftPenlight.SetActive(GameMain.Instance.OvrMgr.ovr_obj.left_controller.controller.HandDanceMode);
- this.m_RightPenlight.SetActive(GameMain.Instance.OvrMgr.ovr_obj.right_controller.controller.HandDanceMode);
- }
- this.DanceDeltaTime = this.m_NowTime - this.m_LastTime;
- this.m_LastTime = Time.realtimeSinceStartup;
- if (!this.IsPause && this.m_IsStart)
- {
- this.DanceTimer += this.DanceDeltaTime;
- }
- if (GameMain.Instance.VRMode && this.m_OvrUI)
- {
- if (!this.IsNewController && !Note_Mgr.Instance.IsActive)
- {
- return;
- }
- Vector3 eulerAngles = this.m_OvrUI.m_goCenter.transform.eulerAngles;
- eulerAngles.z = 0f;
- this.m_OvrUI.transform.eulerAngles = eulerAngles;
- this.UIScreen.transform.localPosition = new Vector3(0f, -this.m_UIDown, this.m_CameraLength);
- this.m_RhythmActionCam.transform.localPosition = this.m_NguiCam.transform.localPosition;
- }
- }
- private void OnDestroy()
- {
- if (this.m_RhythmActionCam)
- {
- UnityEngine.Object.DestroyImmediate(this.m_RhythmActionCam.gameObject);
- }
- if (GameMain.Instance.VRMode && !this.IsNewController)
- {
- this.m_NguiCam.cullingMask = LayerMask.GetMask(new string[]
- {
- "NGUI"
- });
- }
- if (!DanceMain.KaraokeMode && GameMain.Instance.VRMode && GameMain.Instance.VRFamily != GameMain.VRFamilyType.NON)
- {
- if (this.IsNewController)
- {
- GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
- GameMain.Instance.OvrMgr.OvrCamera.HandLimitMode = this.m_OrijinLimit;
- if (GameMain.Instance.OvrMgr.OvrCamera.m_goOvrUiScreen)
- {
- GameMain.Instance.OvrMgr.OvrCamera.m_goOvrUiScreen.SetActive(false);
- }
- }
- else if (this.m_OvrUI)
- {
- this.m_OvrUI.enabled = true;
- }
- GameMain.Instance.OvrMgr.OvrCamera.HandDanceMode = false;
- }
- if (this.m_MainCamDepth)
- {
- this.m_MainCamDepth.focalSize = this.m_OrijinFocalSize;
- this.m_MainCamDepth.enabled = this.m_OrijinDepthEnable;
- }
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
- {
- if (GameMain.Instance && GameMain.Instance.SysShortcut)
- {
- GameMain.Instance.SysShortcut.gameObject.SetActive(true);
- }
- BenchSetting.SettingRecet();
- }
- foreach (Maid maid in this.DanceMaid)
- {
- if (maid)
- {
- maid.MabatakiUpdateStop = false;
- }
- }
- if (this.m_LeftPenlight && this.m_RightPenlight)
- {
- UnityEngine.Object.Destroy(this.m_LeftPenlight);
- UnityEngine.Object.Destroy(this.m_RightPenlight);
- }
- }
- private IEnumerator CheckPause()
- {
- float timer = 0f;
- UIPanel ready_panel = (!this.m_ReadyPanel) ? null : this.m_ReadyPanel.GetComponent<UIPanel>();
- bool ready_fade = false;
- bool ready_display = false;
- for (;;)
- {
- if (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.BenchMark)
- {
- if (this.m_ReadyPanel)
- {
- if (!ready_display)
- {
- ready_display = GameMain.Instance.MainCamera.IsFadeProc();
- }
- else if (!ready_fade)
- {
- if (!this.IsPause && !this.m_ReadyNotStop)
- {
- this.SwitchPause(true, true);
- }
- timer += this.DanceDeltaTime;
- if (timer > this.m_ReadyWaitTime)
- {
- this.SwitchPause(false, true);
- ready_fade = true;
- timer = 0f;
- }
- }
- else
- {
- timer += this.DanceDeltaTime;
- ready_panel.alpha = 1f - Mathf.Sin(Mathf.Clamp01(timer / this.m_ReadyFadeTime) * 90f * 0.0174532924f);
- if (timer > this.m_ReadyFadeTime)
- {
- ready_fade = false;
- ready_display = false;
- UnityEngine.Object.Destroy(this.m_ReadyPanel);
- timer = 0f;
- }
- }
- }
- else if (!GameMain.Instance.MainCamera.IsFadeOut() && Input.GetKeyDown(KeyCode.Return))
- {
- this.SwitchPause(!this.m_IsPause, false);
- }
- }
- yield return null;
- }
- yield break;
- }
- private void DanceStart()
- {
- this.m_IsStart = true;
- if (GameMain.Instance.VRMode)
- {
- this.m_NguiCam.clearFlags = CameraClearFlags.Color;
- this.m_RhythmActionCam.clearFlags = CameraClearFlags.Color;
- }
- else
- {
- this.m_NguiCam.clearFlags = CameraClearFlags.Depth;
- }
- this.m_BlackBG.SetActive(DanceSetting.Settings.IsblackBGon && Note_Mgr.Instance.IsActive);
- if (this.m_OvrUI)
- {
- if (this.IsNewController)
- {
- GameMain.Instance.OvrMgr.OvrCamera.ShowUI(!Note_Mgr.Instance.IsActive);
- this.m_OvrUI.enabled = false;
- }
- else
- {
- this.m_OvrUI.enabled = !Note_Mgr.Instance.IsActive;
- }
- }
- if (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
- {
- GameMain.Instance.SysShortcut.gameObject.SetActive(false);
- }
- if (!Note_Mgr.Instance.IsActive || RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.BenchMark)
- {
- UnityEngine.Object.Destroy(this.m_ReadyPanel);
- }
- if (DanceMain.KaraokeMode || (RhythmAction_Mgr.IsVSDance && VsDanceDataMgr.Instance.CurrentSetting.isSpecifiedVictoryState))
- {
- return;
- }
- foreach (Maid maid in this.DanceMaid)
- {
- this.SetMaidFaceStop(maid, false);
- this.SetMaidFaceBlendStop(maid, false);
- this.Search_AllEffect(maid.transform, true);
- }
- base.StartCoroutine(this.CheckPause());
- }
- private void ToNextState()
- {
- if (DanceMain.KaraokeMode || (RhythmAction_Mgr.IsVSDance && VsDanceDataMgr.Instance.CurrentSetting.isSpecifiedVictoryState))
- {
- return;
- }
- RhythmAction_Mgr.DanceState nowState = RhythmAction_Mgr.NowState;
- if (nowState != RhythmAction_Mgr.DanceState.Dance_First)
- {
- if (nowState == RhythmAction_Mgr.DanceState.Dance_Second)
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("バトル回数", 2);
- RhythmAction_Mgr.NowState = RhythmAction_Mgr.DanceState.Dance_First;
- }
- }
- else
- {
- GameMain.Instance.CharacterMgr.status.SetFlag("バトル回数", 1);
- if (RhythmAction_Mgr.IsVSDance)
- {
- RhythmAction_Mgr.NowState = RhythmAction_Mgr.DanceState.Dance_Second;
- }
- }
- }
- private void SwitchPause(bool is_pause, bool is_ready = false)
- {
- this.m_IsPause = is_pause;
- this.m_PausePanel.SetActive(this.m_IsPause && !is_ready);
- if (this.IsNewController && this.m_PausePanel.activeSelf)
- {
- GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
- }
- this.ChoicesUIRecet();
- if (this.m_IsPause)
- {
- if (this.MovieMgr)
- {
- this.MovieMgr.Stop();
- }
- foreach (ParticleSystem particleSystem in this.m_AllParticleSystem)
- {
- if (particleSystem && particleSystem.gameObject.activeInHierarchy)
- {
- particleSystem.Pause();
- }
- }
- foreach (Animator animator in this.m_OtherAnimator)
- {
- animator.speed = 0f;
- }
- foreach (AudioSource audioSource in this.m_AudioMgrList)
- {
- audioSource.Pause();
- }
- GameMain.Instance.SoundMgr.GetAudioSourceBgm().Pause();
- }
- else
- {
- if (this.MovieMgr)
- {
- this.MovieMgr.Play();
- }
- foreach (ParticleSystem particleSystem2 in this.m_AllParticleSystem)
- {
- if (particleSystem2 && particleSystem2.gameObject.activeInHierarchy)
- {
- particleSystem2.Play();
- }
- }
- foreach (Animator animator2 in this.m_OtherAnimator)
- {
- animator2.speed = 1f;
- }
- foreach (AudioSource audioSource2 in this.m_AudioMgrList)
- {
- audioSource2.UnPause();
- }
- GameMain.Instance.SoundMgr.GetAudioSourceBgm().UnPause();
- }
- foreach (EllipsoidParticleEmitter ellipsoidParticleEmitter in this.m_AllParticleEmitter)
- {
- if (ellipsoidParticleEmitter)
- {
- ellipsoidParticleEmitter.enabled = !this.m_IsPause;
- }
- }
- for (int i = 0; i < this.DanceMaid.Count; i++)
- {
- Maid maid = this.DanceMaid[i];
- if (GameMain.Instance.VRMode && GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") == 0)
- {
- RhythmAction_Mgr.PauseBackupLookTarget pauseBackupLookTarget2;
- if (this.m_IsPause)
- {
- RhythmAction_Mgr.PauseBackupLookTarget pauseBackupLookTarget = new RhythmAction_Mgr.PauseBackupLookTarget();
- pauseBackupLookTarget.m_backupHeadToCam = maid.body0.boHeadToCam;
- pauseBackupLookTarget.m_backupEyeToCam = maid.body0.boEyeToCam;
- pauseBackupLookTarget.m_backupEyeSorashi = maid.body0.boEyeSorashi;
- pauseBackupLookTarget.m_backupLookTarget = maid.body0.trsLookTarget;
- this.m_backupLookTarget[i] = pauseBackupLookTarget;
- maid.EyeToCamera(Maid.EyeMoveType.無視する, 0f);
- }
- else if (this.m_backupLookTarget.TryGetValue(i, out pauseBackupLookTarget2))
- {
- maid.body0.boHeadToCam = pauseBackupLookTarget2.m_backupHeadToCam;
- maid.body0.boEyeToCam = pauseBackupLookTarget2.m_backupEyeToCam;
- maid.body0.boEyeSorashi = pauseBackupLookTarget2.m_backupEyeSorashi;
- maid.body0.trsLookTarget = pauseBackupLookTarget2.m_backupLookTarget;
- }
- else
- {
- maid.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
- }
- }
- maid.MabatakiUpdateStop = this.m_IsPause;
- }
- if (!is_ready)
- {
- GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Click);
- }
- }
- private void SelectContinue()
- {
- this.m_SelectEnd = false;
- this.m_SelectRecet = false;
- this.m_SelectSkip = false;
- this.ChoicesSelect(RhythmAction_Mgr.PauseChoices.Continue, true);
- }
- private void SelectEnd()
- {
- this.m_SelectEnd = true;
- this.m_SelectRecet = false;
- this.m_SelectSkip = false;
- this.ChoicesSelect(RhythmAction_Mgr.PauseChoices.End, true);
- }
- private void SelectRecet()
- {
- this.m_SelectEnd = true;
- this.m_SelectRecet = true;
- this.m_SelectSkip = false;
- this.ChoicesSelect(RhythmAction_Mgr.PauseChoices.Recet, true);
- }
- private void SelectSkip()
- {
- this.m_SelectEnd = false;
- this.m_SelectRecet = false;
- this.m_SelectSkip = true;
- this.ChoicesSelect(RhythmAction_Mgr.PauseChoices.Skip, true);
- }
- private void ChoicesSelect(RhythmAction_Mgr.PauseChoices select_choice, bool playse = true)
- {
- if (playse)
- {
- GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Hover);
- }
- foreach (RhythmAction_Mgr.ChoiceObjpair choiceObjpair in this.m_ChoiceUIList)
- {
- if (choiceObjpair.Choice == select_choice)
- {
- Utility.SetLocalizeTerm(choiceObjpair.UILocalize, choiceObjpair.CursorOnImage, true);
- }
- else
- {
- Utility.SetLocalizeTerm(choiceObjpair.UILocalize, choiceObjpair.CursorOffImage, true);
- }
- }
- }
- private void ChoicesUIRecet()
- {
- this.m_SelectEnd = false;
- this.m_SelectRecet = false;
- this.m_SelectSkip = false;
- this.ChoicesSelect(RhythmAction_Mgr.PauseChoices.Continue, false);
- }
- private void Decide_GameEnd()
- {
- GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Click);
- this.m_DanceMain.IsForceDanceEnd = this.m_SelectEnd;
- this.m_DanceMain.IsDanceSkip = this.m_SelectSkip;
- DanceMain.IsDanceRecet = this.m_SelectRecet;
- if (!this.m_DanceMain.IsForceDanceEnd && !this.m_SelectSkip)
- {
- this.SwitchPause(false, false);
- }
- else
- {
- foreach (Maid maid in this.DanceMaid)
- {
- maid.boMabataki = true;
- }
- }
- }
- private void AddEventMethod(GameObject ui, EventDelegate.Callback callback)
- {
- UIEventTrigger component = ui.GetComponent<UIEventTrigger>();
- EventDelegate.Add(component.onHoverOver, callback);
- EventDelegate.Add(component.onPress, new EventDelegate.Callback(this.Decide_GameEnd));
- }
- public void Search_AllEffect(Transform parent, bool isIgnoreAnime = false)
- {
- IEnumerator enumerator = parent.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform = (Transform)obj;
- ParticleSystem component = transform.GetComponent<ParticleSystem>();
- EllipsoidParticleEmitter component2 = transform.GetComponent<EllipsoidParticleEmitter>();
- Animator component3 = transform.GetComponent<Animator>();
- AVProVideoPlayer component4 = transform.GetComponent<AVProVideoPlayer>();
- if (component)
- {
- this.m_AllParticleSystem.Add(component);
- }
- else if (component2)
- {
- this.m_AllParticleEmitter.Add(component2);
- }
- else if (component3 && !isIgnoreAnime)
- {
- this.m_OtherAnimator.Add(component3);
- }
- else if (component4)
- {
- this.MovieMgr = component4;
- }
- this.Search_AllEffect(transform, isIgnoreAnime);
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- }
- public void AddMgrParts(PartsMgrBase parts)
- {
- this.m_MgrPartsList.Add(parts);
- }
- public T GetMgrParts<T>() where T : PartsMgrBase
- {
- foreach (PartsMgrBase partsMgrBase in this.m_MgrPartsList)
- {
- if (partsMgrBase is T)
- {
- return (T)((object)partsMgrBase);
- }
- }
- Debug.LogErrorFormat("指定した管理クラスを取得できませんでした", new object[0]);
- return (T)((object)null);
- }
- public void RhythmGame_Start()
- {
- this.DanceStart();
- foreach (PartsMgrBase partsMgrBase in this.m_MgrPartsList)
- {
- if (partsMgrBase.IsActive)
- {
- partsMgrBase.StartAction();
- }
- }
- }
- public void RhythmGame_End()
- {
- if (GameMain.Instance.VRMode && this.m_OvrUI)
- {
- this.m_OvrUI.enabled = true;
- }
- base.StopAllCoroutines();
- foreach (PartsMgrBase partsMgrBase in this.m_MgrPartsList)
- {
- if (partsMgrBase.IsActive)
- {
- partsMgrBase.EndAction();
- }
- }
- this.ToNextState();
- }
- public void Pause()
- {
- this.SwitchPause(true, false);
- }
- public void Play()
- {
- this.SwitchPause(false, false);
- }
- public void AddParticleSystem(ParticleSystem particle)
- {
- if (!this.m_AllParticleSystem.Contains(particle))
- {
- this.m_AllParticleSystem.Add(particle);
- }
- if (particle.subEmitters.subEmittersCount > 0)
- {
- for (int i = 0; i < particle.subEmitters.subEmittersCount; i++)
- {
- this.AddParticleSystem(particle.subEmitters.GetSubEmitterSystem(i));
- }
- }
- }
- public void AddParticleSystem(ParticleSystem[] particle)
- {
- foreach (ParticleSystem particle2 in particle)
- {
- this.AddParticleSystem(particle2);
- }
- }
- public void RemoveParticleSystem(ParticleSystem particle)
- {
- if (this.m_AllParticleSystem.Contains(particle))
- {
- this.m_AllParticleSystem.Remove(particle);
- }
- if (particle.subEmitters.subEmittersCount > 0)
- {
- for (int i = 0; i < particle.subEmitters.subEmittersCount; i++)
- {
- this.RemoveParticleSystem(particle.subEmitters.GetSubEmitterSystem(i));
- }
- }
- }
- public void RemoveParticleSystem(ParticleSystem[] particle)
- {
- foreach (ParticleSystem particle2 in particle)
- {
- this.RemoveParticleSystem(particle2);
- }
- }
- public void AddAudioMgr(AudioSource[] audio_array)
- {
- foreach (AudioSource audio in audio_array)
- {
- this.AddAudioMgr(audio);
- }
- }
- public void AddAudioMgr(AudioSource audio)
- {
- if (!this.m_AudioMgrList.Contains(audio))
- {
- this.m_AudioMgrList.Add(audio);
- }
- }
- public void RemoveAudioMgr(AudioSource[] audio_array)
- {
- foreach (AudioSource audio in audio_array)
- {
- this.RemoveAudioMgr(audio);
- }
- }
- public void RemoveAudioMgr(AudioSource audio)
- {
- if (this.m_AudioMgrList.Contains(audio))
- {
- this.m_AudioMgrList.Remove(audio);
- }
- }
- public bool GetCamMoveStop()
- {
- return this.TimeLineStopInfo.CamMoveStop;
- }
- public void SetCamMoveStop(bool set)
- {
- this.TimeLineStopInfo.CamMoveStop = set;
- }
- public void SetTimeLineFace(int maid_no, string face)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maid_no);
- if (this.TimeLineStopInfo.TimeLineFace.ContainsKey(maid))
- {
- this.TimeLineStopInfo.TimeLineFace[maid] = face;
- }
- else
- {
- this.TimeLineStopInfo.TimeLineFace.Add(maid, face);
- }
- }
- public void SetTimeLineFaceBlend(int maid_no, string face)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maid_no);
- if (this.TimeLineStopInfo.TimeLineFaceBlend.ContainsKey(maid))
- {
- this.TimeLineStopInfo.TimeLineFaceBlend[maid] = face;
- }
- else
- {
- this.TimeLineStopInfo.TimeLineFaceBlend.Add(maid, face);
- }
- }
- public bool GetMaidFaceStop(int maid_no)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maid_no);
- return this.GetMaidFaceStop(maid);
- }
- public bool GetMaidFaceStop(Maid maid)
- {
- return this.TimeLineStopInfo.FaceStop.ContainsKey(maid) && this.TimeLineStopInfo.FaceStop[maid];
- }
- public bool GetMaidFaceBlendStop(int maid_no)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maid_no);
- return this.GetMaidFaceBlendStop(maid);
- }
- public bool GetMaidFaceBlendStop(Maid maid)
- {
- return this.TimeLineStopInfo.FaceBlendStop.ContainsKey(maid) && this.TimeLineStopInfo.FaceBlendStop[maid];
- }
- public void SetMaidFaceStop(Maid maid, bool set)
- {
- if (!this.TimeLineStopInfo.FaceStop.ContainsKey(maid) || !this.TimeLineStopInfo.TimeLineFace.ContainsKey(maid))
- {
- if (!this.TimeLineStopInfo.FaceStop.ContainsKey(maid))
- {
- this.TimeLineStopInfo.FaceStop.Add(maid, set);
- }
- return;
- }
- if (this.TimeLineStopInfo.FaceStop[maid] != set)
- {
- this.TimeLineStopInfo.FaceStop[maid] = set;
- if (!set)
- {
- maid.FaceAnime(this.TimeLineStopInfo.TimeLineFace[maid], 1f, 0);
- }
- }
- }
- public void SetMaidFaceBlendStop(Maid maid, bool set)
- {
- if (!this.TimeLineStopInfo.FaceBlendStop.ContainsKey(maid) || !this.TimeLineStopInfo.TimeLineFaceBlend.ContainsKey(maid))
- {
- if (!this.TimeLineStopInfo.FaceBlendStop.ContainsKey(maid))
- {
- this.TimeLineStopInfo.FaceBlendStop.Add(maid, set);
- }
- return;
- }
- if (this.TimeLineStopInfo.FaceBlendStop[maid] != set)
- {
- this.TimeLineStopInfo.FaceBlendStop[maid] = set;
- if (!set)
- {
- maid.FaceBlend(this.TimeLineStopInfo.TimeLineFaceBlend[maid]);
- }
- }
- }
- public void SetDanceReward(int reward)
- {
- if (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.Challenge)
- {
- return;
- }
- RhythmAction_Mgr.DanceReward += reward;
- }
- public void SetFocalSize(float focal_size)
- {
- if (this.m_MainCamDepth)
- {
- this.m_MainCamDepth.focalSize = focal_size;
- }
- }
- public IEnumerator DanceTimeCoroutine(float time_rimmit, Action<float> update_call, Action end_call = null)
- {
- float timer = 0f;
- for (;;)
- {
- if (!this.IsPause)
- {
- timer += this.DanceDeltaTime;
- if (update_call != null)
- {
- update_call(timer);
- }
- if (time_rimmit > 0f && timer > time_rimmit)
- {
- break;
- }
- }
- yield return null;
- }
- if (end_call != null)
- {
- end_call();
- }
- yield break;
- yield break;
- }
- public IEnumerator DanceTimeCoroutine(Action update_call, Func<bool> endcheck_call = null)
- {
- for (;;)
- {
- if (!this.IsPause)
- {
- if (update_call != null)
- {
- update_call();
- }
- if (endcheck_call != null && endcheck_call())
- {
- break;
- }
- }
- yield return null;
- }
- yield break;
- yield break;
- }
- public void StartTimeCroutine(float time_rimmit, Action<float> update_call, Action end_call = null)
- {
- base.StartCoroutine(this.DanceTimeCoroutine(time_rimmit, update_call, end_call));
- }
- public void StartTimeCroutine(Action update_call, Func<bool> endcheck_call = null)
- {
- base.StartCoroutine(this.DanceTimeCoroutine(update_call, endcheck_call));
- }
- public void InstanceInit()
- {
- RhythmAction_Mgr.m_Instance = this;
- }
- public void KaraokeEnd()
- {
- if (this.m_RhythmActionCam)
- {
- UnityEngine.Object.Destroy(this.m_RhythmActionCam.gameObject);
- }
- UnityEngine.Object.Destroy(base.gameObject);
- }
- public static void RewardRecet()
- {
- RhythmAction_Mgr.DanceReward = 0;
- }
- public static void KaraokeRecet()
- {
- RhythmAction_Mgr.NowState = RhythmAction_Mgr.DanceState.Dance_First;
- MotionAction_Mgr.CaptureFlagRecet();
- }
- public static void SetDanceType(RhythmAction_Mgr.DanceType type)
- {
- if (type == RhythmAction_Mgr.DanceType.VrDance)
- {
- return;
- }
- RhythmAction_Mgr.m_DanceType = type;
- if (RhythmAction_Mgr.m_DanceType != RhythmAction_Mgr.DanceType.VS_Skip)
- {
- ShootCutInTex.TextureClear(DanceBattle_Mgr.CharaType.Player);
- }
- RhythmAction_Mgr.NowState = RhythmAction_Mgr.DanceState.Dance_First;
- MotionAction_Mgr.CaptureFlagRecet();
- if (RhythmAction_Mgr.m_DanceType == RhythmAction_Mgr.DanceType.Challenge)
- {
- RhythmAction_Mgr.DoChallengeDance = true;
- RhythmAction_Mgr.RewardRecet();
- }
- }
- public const string RhythmResouce_Path = "SceneDance/Rhythm_Action/";
- public const string DanceSelectResouce_Path = "SceneDanceSelect/Rhythm_Action/";
- public const string RhythmCSVPath = "csv_rhythm_action/";
- public const int BenchMarkID = -100;
- public const string TestResourcePath = "SceneDance/Rhythm_Action/TestResources/";
- public const string ToolResource_path = "SceneDance/Rhythm_Action/Tools/";
- private static RhythmAction_Mgr.DanceType m_DanceType = RhythmAction_Mgr.DanceType.View;
- public static bool DoChallengeDance;
- private static RhythmAction_Mgr m_Instance;
- private List<PartsMgrBase> m_MgrPartsList = new List<PartsMgrBase>();
- [SerializeField]
- private GameObject m_PausePanel;
- [SerializeField]
- [Header("「Ready?」の表示時間")]
- private float m_ReadyWaitTime = 2f;
- [SerializeField]
- [Header("「Ready?」フェードアウト時間")]
- private float m_ReadyFadeTime = 0.5f;
- [SerializeField]
- private GameObject m_ReadyPanel;
- [SerializeField]
- [Header("csvフォルダ名")]
- private string m_UseMusicName;
- private DanceMain m_DanceMain;
- private bool m_IsPause;
- private List<ParticleSystem> m_AllParticleSystem = new List<ParticleSystem>();
- private List<EllipsoidParticleEmitter> m_AllParticleEmitter = new List<EllipsoidParticleEmitter>();
- private List<Animator> m_OtherAnimator = new List<Animator>();
- private List<AudioSource> m_AudioMgrList = new List<AudioSource>();
- private float m_NowTime;
- private float m_LastTime;
- private OvrUI m_OvrUI;
- private Vector3 m_FirstScreen;
- [Header("VR時カメラ設定")]
- [SerializeField]
- [Header("VR時のカメラとの距離")]
- private float m_CameraLength = 1f;
- [SerializeField]
- [Header("VR時はnGUIを少し下げる")]
- private float m_UIDown = 0.5f;
- private RhythmAction_Mgr.TimeLineStop TimeLineStopInfo = new RhythmAction_Mgr.TimeLineStop();
- private bool m_SelectEnd;
- private bool m_SelectRecet;
- private bool m_SelectSkip;
- [SerializeField]
- [Header("フリー以外の時は選択肢UIを少し下に下げる")]
- private float m_ChoiceUIDown = 65f;
- [SerializeField]
- [Header("ポーズ中の各選択肢毎に設定するUI")]
- private List<RhythmAction_Mgr.ChoiceObjpair> m_ChoiceUIList = new List<RhythmAction_Mgr.ChoiceObjpair>();
- private bool m_OrijinDepthEnable;
- private DepthOfFieldScatter m_MainCamDepth;
- private float m_OrijinFocalSize;
- [SerializeField]
- [Header("黒背景")]
- private GameObject m_BlackBG;
- [SerializeField]
- [Header("Readyでもダンスを止めないフラグ")]
- private bool m_ReadyNotStop;
- [SerializeField]
- [Header("音ゲーのレイヤー")]
- private LayerMask m_RhythmActionLayer = -1;
- [SerializeField]
- [Header("音ゲーのレイヤー(2D時)")]
- private LayerMask m_RhythmAction2DLayer = -1;
- private List<Maid> m_FactOrderList = new List<Maid>();
- private bool m_IsOrijinTablet;
- private Camera m_RhythmActionCam;
- private RenderTexture m_RhythmActionTex;
- private Material m_ScreenMat;
- private Camera m_NguiCam;
- private AVRControllerBehavior.LIMIT_MODE m_OrijinLimit;
- private bool m_IsStart;
- [SerializeField]
- [Header("ペンライトのオフセット")]
- private Vector3 m_PenlightOffset = new Vector3(0f, -0.01f, -0.06f);
- [SerializeField]
- [Header("ペンライトのサイズ")]
- private Vector3 m_PenlightScale = new Vector3(1.25f, 1.25f, 2f);
- private GameObject m_LeftPenlight;
- private GameObject m_RightPenlight;
- private Dictionary<int, RhythmAction_Mgr.PauseBackupLookTarget> m_backupLookTarget = new Dictionary<int, RhythmAction_Mgr.PauseBackupLookTarget>();
- public enum DanceType
- {
- Free,
- Challenge,
- VS,
- Encore,
- View,
- BenchMark,
- Touch,
- VS_Skip,
- VrDance
- }
- public enum DanceState
- {
- Dance_First,
- Dance_Second
- }
- private class TimeLineStop
- {
- public bool CamMoveStop;
- public Dictionary<Maid, bool> FaceStop = new Dictionary<Maid, bool>();
- public Dictionary<Maid, bool> FaceBlendStop = new Dictionary<Maid, bool>();
- public Dictionary<Maid, string> TimeLineFace = new Dictionary<Maid, string>();
- public Dictionary<Maid, string> TimeLineFaceBlend = new Dictionary<Maid, string>();
- }
- private enum PauseChoices
- {
- Continue,
- End,
- Recet,
- Skip
- }
- [Serializable]
- private class ChoiceObjpair
- {
- public RhythmAction_Mgr.PauseChoices Choice;
- public GameObject EventUI;
- public string CursorOnImage;
- public string CursorOffImage;
- [HideInInspector]
- public Localize UILocalize;
- }
- private class PauseBackupLookTarget
- {
- public bool m_backupHeadToCam;
- public bool m_backupEyeToCam;
- public bool m_backupEyeSorashi;
- public Transform m_backupLookTarget;
- }
- }
|