|
|
|
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Unity.UIWidgets.engine2; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow { |
|
|
|
public static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>(); |
|
|
|
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>(); |
|
|
|
|
|
|
|
static bool showDebugLog = false; |
|
|
|
|
|
|
|
static void registerPanel(UIWidgetsPanel panel) { |
|
|
|
panels.Add(panel); |
|
|
|
showDebugLog = showDebugLog || panel.enableDebugAtRuntime; |
|
|
|
} |
|
|
|
|
|
|
|
static void unregisterPanel(UIWidgetsPanel panel) { |
|
|
|
panels.Remove(panel); |
|
|
|
} |
|
|
|
|
|
|
|
public static bool enableDebug => showDebugLog; |
|
|
|
static bool _ShowDebugLog; |
|
|
|
public bool enableDebugAtRuntime = false; |
|
|
|
|
|
|
|
DisplayMetrics _displayMetrics = new DisplayMetrics(); |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static bool ShowDebugLog { |
|
|
|
get { return _ShowDebugLog; } |
|
|
|
set { |
|
|
|
_ShowDebugLog = value; |
|
|
|
} |
|
|
|
} |
|
|
|
protected virtual void Update() { |
|
|
|
Input_Update(); |
|
|
|
} |
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
base.OnEnable(); |
|
|
|
registerPanel(this); |
|
|
|
|
|
|
|
D.assert(_wrapper == null); |
|
|
|
_configurations = new Configurations(); |
|
|
|
_wrapper = new UIWidgetsPanelWrapper(); |
|
|
|
|
|
|
_configurations.Clear(); |
|
|
|
texture = _wrapper.renderTexture; |
|
|
|
Input_OnEnable(); |
|
|
|
panels.Add(this); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnDisable() { |
|
|
|
|
|
|
texture = null; |
|
|
|
Input_OnDisable(); |
|
|
|
base.OnDisable(); |
|
|
|
panels.Remove(this); |
|
|
|
unregisterPanel(this); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void OnGUI() { |
|
|
|