用户工具

站点工具


侧边栏

script:unityengine:classes:handheld:handheld.startactivityindicator

Handheld.StartActivityIndicator 启用活跃指示器

JavaScript ⇒ public static function StartActivityIndicator(): void;
C# ⇒ public static void StartActivityIndicator();

Description 描述

Starts os activity indicator.

启用OS活跃指示器。

Please be warned that this informs os ui system to start. For actual animation to take effect you usually need to wait till the end of this frame. So if you want activity indicator to be animated during synced operation, please use coroutines.

通知该操作系统用户界面启动。通常实际动画生效需要等到该帧的最后一帧。因此如果你想要活跃指示器动画同步操作,请使用协同程序。

JavaScript:

	IEnumerator Load()
    {
        #if UNITY_IPHONE
            Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray);
        #elif UNITY_ANDROID
            Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small);
        #endif
 
        Handheld.StartActivityIndicator();
        yield return new WaitForSeconds(0);
        Application.LoadLevel(1);
    }
 
    void OnGUI()
    {
       if( GUI.Button(new Rect(10, 10, 200, 200), "Load!") )
            StartCoroutine(Load());
    }
Copyright © 2016 Unity Technologies. Publi

C#:

	IEnumerator Load()
    {
        #if UNITY_IPHONE
            Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray);
        #elif UNITY_ANDROID
            Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small);
        #endif
                                    
script/unityengine/classes/handheld/handheld.startactivityindicator.txt · 最后更改: 2016/08/02 05:30 (外部编辑)