123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.EventSystems;
- public class VRCanvasManagerMini : VRCanvasManager
- {
- public void AddCanvas(Canvas canvas)
- {
- if (this.m_StackCanvas.Contains(canvas))
- {
- Debug.Log(string.Format("[CanvasmanagerMini]既に「{0}」は追加されている", canvas.gameObject.name));
- return;
- }
- this.m_StackCanvas.Add(canvas);
- }
- public void RemoveCanvas(Canvas canvas)
- {
- if (!canvas)
- {
- Debug.Log("[CanvasmanagerMini]リストから削除するキャンバスでnullが指定された");
- return;
- }
- if (!this.m_StackCanvas.Contains(canvas))
- {
- Debug.Log(string.Format("[CanvasmanagerMini]キャンバス「{0}」は管理していない", canvas.gameObject.name));
- return;
- }
- this.m_StackCanvas.Remove(canvas);
- }
- private void Awake()
- {
- VRCanvasManager.m_Instance = this;
- }
- private void Start()
- {
- }
- private void Update()
- {
- CanvasGroup component = base.GetComponent<CanvasGroup>();
- if (!GameMain.Instance.OvrMgr.OvrCamera.IsUIShow)
- {
- component.interactable = false;
- component.blocksRaycasts = false;
- component.alpha = 0f;
- return;
- }
- component.interactable = true;
- component.blocksRaycasts = true;
- component.alpha = 1f;
- bool isRotDown = GameMain.Instance.OvrMgr.OvrCamera.OvrTablet.IsRotDown;
- bool isSideBack = GameMain.Instance.OvrMgr.OvrCamera.OvrTablet.IsSideBack;
- Vector3 zero = Vector3.zero;
- zero.z = ((!isRotDown) ? 0f : 180f);
- zero.y = ((!isSideBack) ? 0f : 180f);
- zero.x = ((!isSideBack) ? 90f : -90f);
- base.transform.localEulerAngles = zero;
- }
- private void LateUpdate()
- {
- }
- public new void OpenVRCanvas()
- {
- }
- public override void OpenVRCanvas(VRCanvasManager.VRCanvasType type)
- {
- if (type == VRCanvasManager.VRCanvasType.Dialog)
- {
- for (int i = 0; i < this.m_StackCanvas.Count; i++)
- {
- Canvas canvas = this.m_StackCanvas[i];
- if (canvas)
- {
- if (canvas.gameObject.activeInHierarchy)
- {
- UICanvasFade component = canvas.GetComponent<UICanvasFade>();
- if (component)
- {
- component.FadeOut();
- }
- else
- {
- canvas.gameObject.SetActive(false);
- }
- }
- }
- }
- VRDialogMenu vrdialogMenu = VRDialogMenu.CreateDialog();
- if (vrdialogMenu)
- {
- UICanvasFade component2 = vrdialogMenu.GetComponent<UICanvasFade>();
- component2.FadeIn();
- }
- }
- if (type == VRCanvasManager.VRCanvasType.Selector)
- {
- for (int j = 0; j < this.m_StackCanvas.Count; j++)
- {
- Canvas canvas2 = this.m_StackCanvas[j];
- if (canvas2)
- {
- if (canvas2.gameObject.activeInHierarchy)
- {
- UICanvasFade component3 = canvas2.GetComponent<UICanvasFade>();
- if (component3)
- {
- component3.FadeOut();
- }
- else
- {
- canvas2.gameObject.SetActive(false);
- }
- }
- }
- }
- VRSelectorMenu vrselectorMenu = VRSelectorMenu.CreateSelector();
- if (vrselectorMenu)
- {
- UICanvasFade component4 = vrselectorMenu.GetComponent<UICanvasFade>();
- component4.FadeIn();
- }
- }
- }
- public new void CloseVRCanvas()
- {
- }
- public override void ChangeCanvas(GameObject MainCanvas)
- {
- }
- public new void OpenBeforeVRCanvas()
- {
- }
- public new bool IsExistsBeforeVRCanvas()
- {
- return false;
- }
- public new void ClearCanvasStack()
- {
- }
- public new void UpdateCanvas()
- {
- }
- public new void OpenVRConfig(UnityAction callback)
- {
- }
- public new void OpenVRCulture(UnityAction callback_select, UnityAction callback_cancel)
- {
- }
- public new void OpenVRRentalMaid()
- {
- }
- private void SetMainMenuButtonEnable(VRMainMenu.ButtonType buttonType, bool flag)
- {
- }
- private void SetMainMenuButtonActive(VRMainMenu.ButtonType buttonType, bool flag)
- {
- }
- public new void SetSkipButtonEvent(UnityAction callback)
- {
- }
- public new void ButtonEvent_Skip()
- {
- }
- public override void OpenVRDecideUseTouch(UnityAction<bool> callback_is_oculus_touch)
- {
- GameObject gameObject = Resources.Load<GameObject>("SceneVRCommunication/Tablet/Karaoke/Prefab/Canvas (Dialog)");
- if (gameObject)
- {
- GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
- Transform transform = gameObject2.transform;
- transform.SetParent(base.transform, false);
- transform.localPosition = Vector3.zero;
- transform.localEulerAngles = Vector3.zero;
- transform.localScale = Vector3.one * 0.001f;
- Canvas component = gameObject2.GetComponent<Canvas>();
- if (component)
- {
- component.worldCamera = EventSystem.current.gameObject.GetComponentInChildren<Camera>();
- this.AddCanvas(component);
- }
- }
- GameObject gameObject3 = Resources.Load<GameObject>("SceneVRCommunication/Tablet/Karaoke/Prefab/Canvas (DecideUseTouch)");
- if (gameObject3)
- {
- GameObject Obj = UnityEngine.Object.Instantiate<GameObject>(gameObject3);
- Transform transform2 = Obj.transform;
- transform2.SetParent(base.transform, false);
- transform2.localPosition = Vector3.zero;
- transform2.localEulerAngles = Vector3.zero;
- transform2.localScale = Vector3.one * 0.001f;
- Canvas canvas = Obj.GetComponent<Canvas>();
- if (canvas)
- {
- canvas.worldCamera = EventSystem.current.gameObject.GetComponentInChildren<Camera>();
- this.AddCanvas(canvas);
- }
- UICanvasFade component2 = Obj.GetComponent<UICanvasFade>();
- VRDecideUseTouch component3 = Obj.GetComponent<VRDecideUseTouch>();
- callback_is_oculus_touch = (UnityAction<bool>)Delegate.Combine(callback_is_oculus_touch, new UnityAction<bool>(delegate(bool value)
- {
- this.RemoveCanvas(canvas);
- VRDialogMenu vrdialogMenu = VRDialogMenu.CreateDialog();
- vrdialogMenu.CloseDialog();
- UnityEngine.Object.Destroy(vrdialogMenu.gameObject);
- UnityEngine.Object.Destroy(Obj);
- }));
- component3.StartDecideController(callback_is_oculus_touch);
- }
- }
- public override void OpenVRTutorialMenu(UnityAction callback)
- {
- GameObject gameObject = Resources.Load<GameObject>("SceneVRCommunication/Tablet/Karaoke/Prefab/Canvas (Tutorial)");
- if (gameObject)
- {
- GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
- Transform transform = gameObject2.transform;
- transform.SetParent(base.transform, false);
- transform.localPosition = Vector3.zero;
- transform.localEulerAngles = Vector3.zero;
- transform.localScale = Vector3.one * 0.001f;
- Canvas canvasTutorial = gameObject2.GetComponent<Canvas>();
- if (canvasTutorial)
- {
- canvasTutorial.worldCamera = EventSystem.current.gameObject.GetComponentInChildren<Camera>();
- this.AddCanvas(canvasTutorial);
- }
- UICanvasFade component = gameObject2.GetComponent<UICanvasFade>();
- VRTutorialMenu tutorial = gameObject2.GetComponent<VRTutorialMenu>();
- callback = (UnityAction)Delegate.Combine(callback, new UnityAction(delegate
- {
- this.RemoveCanvas(canvasTutorial);
- UnityEngine.Object.Destroy(tutorial.gameObject);
- }));
- component.FadeIn();
- tutorial.Init(callback, "karaoke_tutorial.nei");
- }
- }
- public override Canvas GetVRCanvas(VRCanvasManager.VRCanvasType type)
- {
- return this.m_CanvasDummy;
- }
- [Space(16f)]
- [SerializeField]
- protected Canvas m_CanvasDummy;
- private List<Canvas> m_StackCanvas = new List<Canvas>();
- }
|