From 886422e8ea432856467c8b4b0efef80b8ff96045 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 25 Dec 2024 18:35:38 +0800 Subject: [PATCH] =?UTF-8?q?PSVita=20=E8=BE=93=E5=85=A5=E6=B3=95=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs | 10 +++++++++- .../Script/AppMain/PSVita/SonyVitaCommonDialog.cs | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs index 2d308de..dc8d979 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/App.cs @@ -34,6 +34,11 @@ namespace AxibugEmuOnline.Client.ClientCore #region Mono public static TickLoop tickLoop; private static CoroutineRunner coRunner; + +#if UNITY_PSP2 + public static SonyVitaCommonDialog sonyVitaCommonDialog; +#endif + #endregion #if UNITY_PSP2 && !UNITY_EDITOR //PSV真机 @@ -43,9 +48,9 @@ namespace AxibugEmuOnline.Client.ClientCore #endif public static void Init(Initer initer, bool isTest = false, string testSrvIP = "") { + //其他平台必要的初始化 if (UnityEngine.Application.platform == RuntimePlatform.PSP2) { - //PSV 等平台需要手动创建目录 PSP2Init(); } @@ -88,9 +93,12 @@ namespace AxibugEmuOnline.Client.ClientCore Directory.CreateDirectory(PersistentDataPath); #if UNITY_PSP2 + //创建PSV弹窗UI + sonyVitaCommonDialog = new GameObject().AddComponent(); //释放解码 FMV的26M内存,一般游戏用不上(PSP才用那破玩意儿) UnityEngine.PSVita.PSVitaVideoPlayer.TransferMemToMonoHeap(); #endif + } private static IEnumerator AppTickFlow() diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/PSVita/SonyVitaCommonDialog.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/PSVita/SonyVitaCommonDialog.cs index 7c4b771..66de300 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/PSVita/SonyVitaCommonDialog.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/PSVita/SonyVitaCommonDialog.cs @@ -4,17 +4,17 @@ public class SonyVitaCommonDialog : MonoBehaviour { static Action resultAct = null; void Awake() - { + { #if UNITY_PSP2 Sony.Vita.Dialog.Ime.OnGotIMEDialogResult += OnGotIMEDialogResult; Sony.Vita.Dialog.Main.Initialise(); #endif - } + } - public void ShowPSVitaIME(Action callback, string placeHolder, string defaultText) + public void ShowPSVitaIME(Action callback, string placeHolder, string defaultText) { - resultAct = callback; #if UNITY_PSP2 + resultAct = callback; Sony.Vita.Dialog.Ime.ImeDialogParams info = new Sony.Vita.Dialog.Ime.ImeDialogParams(); // Set supported languages, 'or' flags together or set to 0 to support all languages. @@ -45,6 +45,7 @@ public class SonyVitaCommonDialog : MonoBehaviour if (result.result == Sony.Vita.Dialog.Ime.EnumImeDialogResult.RESULT_OK) { resultAct.Invoke(result); + resultAct = null; } } #endif