SceneNetorareCheck.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SceneNetorareCheck : BaseMgr<SceneNetorareCheck>
  5. {
  6. private void Start()
  7. {
  8. this.SceneStart();
  9. this.toggleDic.Add(SceneNetorareCheck.Type.LockNTRPlay, UTY.GetChildObject(this.toggleParent, "Toggle_LockNTRPlay/Toggle_On", false).GetComponent<UIToggle>());
  10. this.toggleDic.Add(SceneNetorareCheck.Type.LockUserDraftMaid, UTY.GetChildObject(this.toggleParent, "Toggle_LockUserDraftMaid/Toggle_On", false).GetComponent<UIToggle>());
  11. this.toggleDic.Add(SceneNetorareCheck.Type.IsComPlayer, UTY.GetChildObject(this.toggleParent, "Toggle_IsComPlayer/Toggle_On", false).GetComponent<UIToggle>());
  12. EventDelegate.Add(this.buttonOk.onClick, new EventDelegate.Callback(this.EndNextScene));
  13. this.uiTable = this.toggleParent.GetComponent<UITable>();
  14. if (!Product.isJapan)
  15. {
  16. UTY.GetChildObject(this.toggleParent, "Toggle_IsComPlayer", false).SetActive(false);
  17. UTY.GetChildObject(this.toggleParent, "Toggle_LockUserDraftMaid", false).SetActive(false);
  18. }
  19. }
  20. public void SceneStart()
  21. {
  22. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  23. GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
  24. GameMain.Instance.MainLight.Reset();
  25. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  26. GameMain.Instance.MainCamera.Vignett(false);
  27. GameMain.Instance.MainCamera.SetControl(false);
  28. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.5609447f, 1.380762f, -1.382336f), true);
  29. GameMain.Instance.MainCamera.SetDistance(1.6f, true);
  30. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(245.5691f, 6.273283f), true);
  31. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  32. GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu");
  33. GameMain.Instance.MainLight.SetIntensity(0.65f);
  34. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  35. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  36. GameMain.Instance.MainCamera.FadeIn(1f, false, null, true, true, default(Color));
  37. }
  38. public void EndNextScene()
  39. {
  40. GameMain.Instance.CharacterMgr.status.lockNTRPlay = this.toggleDic[SceneNetorareCheck.Type.LockNTRPlay].value;
  41. GameMain.Instance.CharacterMgr.status.lockUserDraftMaid = !this.toggleDic[SceneNetorareCheck.Type.LockUserDraftMaid].value;
  42. GameMain.Instance.CharacterMgr.status.isOldPlayer = this.toggleDic[SceneNetorareCheck.Type.IsComPlayer].value;
  43. GameMain.Instance.SoundMgr.StopBGM(1f);
  44. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnFinishFadeOut), true, default(Color));
  45. }
  46. private void OnFinishFadeOut()
  47. {
  48. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  49. GameMain.Instance.MainCamera.SetControl(true);
  50. string label_name = GameMain.Instance.ScriptMgr.adv_kag.tag_backup["label"];
  51. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(label_name);
  52. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  53. }
  54. public void SceneFinish()
  55. {
  56. if (GameMain.Instance.MainCamera != null)
  57. {
  58. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  59. }
  60. if (GameMain.Instance.CharacterMgr != null)
  61. {
  62. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  63. }
  64. }
  65. [SerializeField]
  66. private GameObject toggleParent;
  67. [SerializeField]
  68. private UIButton buttonOk;
  69. private UITable uiTable;
  70. private Dictionary<SceneNetorareCheck.Type, UIToggle> toggleDic = new Dictionary<SceneNetorareCheck.Type, UIToggle>();
  71. public enum Type
  72. {
  73. LockNTRPlay,
  74. LockUserDraftMaid,
  75. IsComPlayer
  76. }
  77. }