123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- 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 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 (!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 (!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.UIImage = choiceObjpair.EventUI.GetComponent<UISprite>();
- 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)
- {
- 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)
- {
- 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)
- {
- choiceObjpair.UIImage.spriteName = choiceObjpair.CursorOnImage;
- }
- else
- {
- choiceObjpair.UIImage.spriteName = choiceObjpair.CursorOffImage;
- }
- }
- }
- 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 UISprite UIImage;
- }
- private class PauseBackupLookTarget
- {
- public bool m_backupHeadToCam;
- public bool m_backupEyeToCam;
- public bool m_backupEyeSorashi;
- public Transform m_backupLookTarget;
- }
- }
|