123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using UnityEngine;
- using UnityEngine.UI;
- public class KasaSceneMgr<T> : MonoBehaviour where T : KasaSceneMgr<T>
- {
- public static T Instance { get; protected set; }
- protected virtual void Awake()
- {
- KasaSceneMgr<T>.Instance = (this as T);
- this.MainRecet();
- GameMain.Instance.BgMgr.ChangeBg(this.m_BgName);
- GameMain.Instance.SoundMgr.PlayBGM(this.m_BgmName, 0f, true);
- GameMain.Instance.MainCamera.SetControl(this.m_IsControll);
- this.SetCamera();
- uGUIUtility.GetEventSystem();
- if (this.m_uGUIRaycaster)
- {
- this.m_uGUIRaycaster.enabled = false;
- }
- if (this.m_IscharaLoad)
- {
- base.StartCoroutine(KasaiUtility.CharaLoadWait(new Action(this.LoadEnd)));
- }
- else
- {
- GameMain.Instance.CharacterMgr.DeactivateCharaAll();
- GameMain.Instance.MainCamera.FadeIn(0.5f, false, new CameraMain.dgOnCompleteFade(this.FadeInEnd), true, true, default(Color));
- }
- }
- protected virtual void FadeInEnd()
- {
- if (this.m_uGUIRaycaster)
- {
- this.m_uGUIRaycaster.enabled = true;
- }
- }
- protected virtual void LoadEnd()
- {
- GameMain.Instance.MainCamera.FadeIn(0.5f, false, new CameraMain.dgOnCompleteFade(this.FadeInEnd), true, true, default(Color));
- }
- protected void SetCamera()
- {
- GameMain.Instance.MainCamera.SetTargetPos(this.m_TargetPos, true);
- GameMain.Instance.MainCamera.SetDistance(this.m_Distance, true);
- GameMain.Instance.MainCamera.SetAroundAngle(this.m_AroundAngle, true);
- }
- protected void MainRecet()
- {
- GameMain.Instance.CharacterMgr.ResetCharaPosAll();
- GameMain.Instance.CharacterMgr.CharaAllOfsetRot(Vector3.zero);
- GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
- GameMain.Instance.MainLight.Reset();
- }
- protected virtual void FadeOut()
- {
- GameMain.Instance.MainCamera.FadeOut(0.5f, false, new CameraMain.dgOnCompleteFade(this.FadeOutEnd), true, default(Color));
- }
- protected virtual void FadeOutEnd()
- {
- GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_JumpLabel);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- [SerializeField]
- [Header("背景名")]
- protected string m_BgName;
- [SerializeField]
- [Header("BGM")]
- protected string m_BgmName;
- [SerializeField]
- [Header("カメラ設定")]
- protected Vector3 m_TargetPos = Vector3.up * 1.61f;
- [SerializeField]
- protected float m_Distance = 2f;
- [SerializeField]
- protected Vector2 m_AroundAngle = new Vector2(-180f, 10f);
- [SerializeField]
- protected bool m_IsControll = true;
- [SerializeField]
- [Header("キャラクターロードするか")]
- protected bool m_IscharaLoad;
- [SerializeField]
- [Header("uGUI操作管理")]
- private GraphicRaycaster m_uGUIRaycaster;
- protected string m_NextLabel = string.Empty;
- protected string m_CancelLabel = string.Empty;
- protected string m_JumpLabel = string.Empty;
- }
|