123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- using System;
- using Fove;
- using UnityEngine;
- public class SceneLogo : MonoBehaviour
- {
- private void Start()
- {
- if (Product.type == Product.Type.BBB)
- {
- this.kissLogo.SetActive(false);
- this.scortLogo.SetActive(true);
- }
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- if (GameMain.Instance.VRMode)
- {
- GameMain.Instance.BgMgr.ChangeBg("EmpireClub_Rotary_Night");
- GameMain.Instance.MainCamera.SetPos(new Vector3(0f, 1.855f, 20f));
- GameMain.Instance.MainCamera.SetRotation(new Vector3(0f, -180f, 0f));
- GameMain.Instance.OvrMgr.OvrCamera.ReCallcOffset();
- GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
- }
- GameMain.Instance.MainCamera.FadeOutNoUI(0f, true);
- GameMain.Instance.MainCamera.FadeIn(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
- this.m_eMode = SceneLogo.Mode.FadeIn;
- GameMain.Instance.SysShortcut.gameObject.SetActive(false);
- if (GameMain.Instance.VRMode)
- {
- this.m_guiStyle = new GUIStyle();
- this.m_guiStyle.fontSize = 15;
- this.m_styleState = new GUIStyleState();
- this.m_styleState.textColor = Color.gray;
- this.m_guiStyle.normal = this.m_styleState;
- }
- }
- private void Update()
- {
- if (this.m_eMode == SceneLogo.Mode.ClickWait && !GameMain.Instance.CharacterMgr.IsBusy() && this.GetAnyMouseAndKey())
- {
- GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.IClick);
- GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
- GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
- this.m_eMode = SceneLogo.Mode.FadeOut;
- }
- }
- private void OnCompleteFadeIn()
- {
- this.m_eMode = SceneLogo.Mode.ClickWait;
- }
- private void OnCompleteFadeOut()
- {
- if (GameMain.Instance.VRMode && GameMain.Instance.VRFamily == GameMain.VRFamilyType.NON)
- {
- Application.Quit();
- return;
- }
- GameMain.Instance.LoadScene("SceneWarning");
- }
- private void OnGUI()
- {
- if (GameMain.Instance.VRMode)
- {
- string text = "VR デバイスが見つけられません。";
- if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.Oculus)
- {
- text = string.Concat(new object[]
- {
- "Oculus Ver.",
- OVRPlugin.version,
- " Wrapper Ver.",
- OVRPlugin.wrapperVersion
- });
- }
- else if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.HTC)
- {
- SteamVR instance = SteamVR.instance;
- if (instance != null)
- {
- text = "SteamVR Ver.1.1.0 Model Number." + instance.hmd_ModelNumber + " TrackingSystemName." + instance.hmd_TrackingSystemName;
- }
- }
- else if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.FOVE)
- {
- try
- {
- FoveHeadset headset = FoveHeadset.GetHeadset();
- if (headset.IsHardwareConnected() && headset.IsHardwareReady())
- {
- SFVR_Versions softwareVersions = headset.GetSoftwareVersions();
- string text2 = string.Concat(new object[]
- {
- softwareVersions.runtimeMajor,
- ".",
- softwareVersions.runtimeMinor,
- ".",
- softwareVersions.runtimeBuild
- });
- string text3 = string.Concat(new object[]
- {
- softwareVersions.clientMajor,
- ".",
- softwareVersions.clientMinor,
- ".",
- softwareVersions.clientBuild
- });
- text = string.Concat(new object[]
- {
- "FOVE ClientVersion.",
- text3,
- " RuntimeVersion.",
- text2,
- " FirmwareVersion.",
- softwareVersions.firmware
- });
- }
- }
- catch (Exception ex)
- {
- Debug.LogError("FoveInterface 例外発生 in Logo:" + ex.Message);
- }
- }
- if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.NON)
- {
- GUI.Label(new Rect(10f, 10f, 200f, 40f), text + " クリックするとゲームを終了します。");
- }
- else
- {
- GUI.Label(new Rect(10f, 10f, 200f, 40f), text, this.m_guiStyle);
- }
- }
- }
- private bool GetAnyMouseAndKey()
- {
- return NInput.GetMouseButtonUp(0) || NInput.GetMouseButtonUp(1) || NInput.GetMouseButtonUp(2) || Input.GetKeyUp(KeyCode.Return) || GameMain.Instance.IsForceSkip();
- }
- [SerializeField]
- private GameObject kissLogo;
- [SerializeField]
- private GameObject scortLogo;
- private SceneLogo.Mode m_eMode;
- private GUIStyle m_guiStyle;
- private GUIStyleState m_styleState;
- private enum Mode
- {
- FadeIn,
- ClickWait,
- FadeOut
- }
- }
|