SceneNetorareCheck.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. }
  15. public void SceneStart()
  16. {
  17. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  18. GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
  19. GameMain.Instance.MainLight.Reset();
  20. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  21. GameMain.Instance.MainCamera.Vignett(false);
  22. GameMain.Instance.MainCamera.SetControl(false);
  23. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.5609447f, 1.380762f, -1.382336f), true);
  24. GameMain.Instance.MainCamera.SetDistance(1.6f, true);
  25. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(245.5691f, 6.273283f), true);
  26. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  27. GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu");
  28. GameMain.Instance.MainLight.SetIntensity(0.65f);
  29. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  30. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  31. GameMain.Instance.MainCamera.FadeIn(1f, false, null, true, true, default(Color));
  32. }
  33. public void EndNextScene()
  34. {
  35. GameMain.Instance.CharacterMgr.status.lockNTRPlay = this.toggleDic[SceneNetorareCheck.Type.LockNTRPlay].value;
  36. GameMain.Instance.CharacterMgr.status.lockUserDraftMaid = !this.toggleDic[SceneNetorareCheck.Type.LockUserDraftMaid].value;
  37. GameMain.Instance.CharacterMgr.status.isOldPlayer = this.toggleDic[SceneNetorareCheck.Type.IsComPlayer].value;
  38. GameMain.Instance.SoundMgr.StopBGM(1f);
  39. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnFinishFadeOut), true, default(Color));
  40. }
  41. private void OnFinishFadeOut()
  42. {
  43. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  44. GameMain.Instance.MainCamera.SetControl(true);
  45. string label_name = GameMain.Instance.ScriptMgr.adv_kag.tag_backup["label"];
  46. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(label_name);
  47. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  48. }
  49. public void SceneFinish()
  50. {
  51. if (GameMain.Instance.MainCamera != null)
  52. {
  53. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  54. }
  55. if (GameMain.Instance.CharacterMgr != null)
  56. {
  57. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  58. }
  59. }
  60. [SerializeField]
  61. private GameObject toggleParent;
  62. [SerializeField]
  63. private UIButton buttonOk;
  64. private UITable uiTable;
  65. private Dictionary<SceneNetorareCheck.Type, UIToggle> toggleDic = new Dictionary<SceneNetorareCheck.Type, UIToggle>();
  66. public enum Type
  67. {
  68. LockNTRPlay,
  69. LockUserDraftMaid,
  70. IsComPlayer
  71. }
  72. }