|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[ExecuteInEditMode] |
|
|
|
public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow { |
|
|
|
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>(); |
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
IEnumerator ReEnableUIWidgetsNextFrame() { |
|
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
yield return null; |
|
|
|
enabled = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
#if !UNITY_EDITOR && UNITY_ANDROID
|
|
|
|
if (!IsAndroidInitialized()) {return ;} |
|
|
|
#endif
|
|
|
|
if(canvas == null){ |
|
|
|
Debug.Log("get null canvas"); |
|
|
|
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(); |
|
|
|