[英]Programmatically prolonging the duration of Android loading indicator on the splash screen
無論如何,有沒有通過代碼來延長啟動屏幕上Android加載指示器的持續時間?
在“播放器設置”中,我選擇較大的一個,並且還包括:
#if UNITY_ANDROID
Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large);
#endif
但是,無論執行哪一個操作,加載程序只會出現一秒鍾的時間,而這對於用戶而言並不明顯。
我們的android應用的加載時間很長,所以我想一種告訴用戶正在發生的事情...
我認為無論如何都不會在此初始屏幕上放置任何內容(例如帶有消息的UI元素等)以供用戶反饋。 在那兒??
無法增加android啟動畫面的時間。 如果您的應用加載時間較長,則必須使用進度指示器設計自己的加載屏幕。
您可以使用Unity的SplashScreen
API延長Splash屏幕。 用SplashScreen.Begin()
初始化啟動畫面,然后在調用SplashScreen.Draw();
的while
循環等待SplashScreen.Draw();
每幀繪制初始屏幕。 您還必須在該while
循環中屈服或等待,以免整個游戲凍結。
bool keepShowingSplashScreen = false;
IEnumerator Start()
{
SplashScreen.Begin();
while (keepShowingSplashScreen)
{
SplashScreen.Draw();
yield return null;
}
}
如果要退出啟動畫面,請將keepShowingSplashScreen
設置為false
。 while
循環將結束,您的游戲將繼續。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.