浏览代码

Merge pull request #213 from Unity-Technologies/siyaoH/1.17/fixCopy

Siyao h/1.17/fix copy
/main
GitHub 3 年前
当前提交
7b1d8903
共有 1 个文件被更改,包括 20 次插入10 次删除
  1. 30
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs

30
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs


}
}
[ExecuteInEditMode]
public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow {
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>();

#endif
#endregion
IEnumerator ReEnableUIWidgetsNextFrame() {
yield return null;
enabled = true;
}
IEnumerator DoInitAndroid() {
yield return new WaitForEndOfFrame();
AndroidPlatformUtil.Init();
yield return new WaitForEndOfFrame();
enabled = true;
}
startCoroutine(DoInitAndroid());
AndroidPlatformUtil.Init();
startCoroutine(ReEnableUIWidgetsNextFrame());
return false;
}
return true;

#if !UNITY_EDITOR && UNITY_ANDROID
if (!IsAndroidInitialized()) {return ;}
#endif
// If user duplicates uiwidgets gameobject in scene, canvas could be null during OnEnable, which results in error. Skip to avoid error.
// More explanation: during duplication, editor wakes and enables behaviors in certain order. GameObject behaviors are enabled before canvas.
if(canvas == null){
enabled = false;
startCoroutine(ReEnableUIWidgetsNextFrame());
return;
}
#if !UNITY_EDITOR && UNITY_IOS
//the hook API cannot be automatically called on IOS, so we need try hook it here
Hooks.tryHook();

}
protected override void OnDisable() {
unregisterPanel(this);
D.assert(_wrapper != null);
_wrapper?.Destroy();
if (_wrapper != null) {
unregisterPanel(this);
_wrapper.Destroy();
}
_wrapper = null;
texture = null;
Input_OnDisable();

正在加载...
取消
保存