浏览代码

[Raycast] Remove Debug.Log

/main
iizzaya 5 年前
当前提交
587607a4
共有 2 个文件被更改,包括 0 次插入11 次删除
  1. 6
      Runtime/Plugins/Raycast/RaycastManager.cs
  2. 5
      Runtime/Plugins/Raycast/RaycastableContainer.cs

6
Runtime/Plugins/Raycast/RaycastManager.cs


public static void NewWindow(int windowHashCode) {
if (!instance.raycastHandlerMap.ContainsKey(windowHashCode)) {
// Debug.Log($"New Window: @[{windowHashCode}] ({instance.raycastHandlerMap.Count})");
instance.raycastHandlerMap.Add(windowHashCode, new Dictionary<int, RaycastableRect>());
}
}

// Debug.Log($"Dispose Window: @[{windowHashCode}]");
// Debug.Log($"Add To List: [{widgetHashCode}]@[{windowHashCode}]");
D.assert(instance.raycastHandlerMap.ContainsKey(windowHashCode), () =>
$"Raycast Handler Map doesn't contain Window {windowHashCode}, " +
$"Make sure using UIWidgetsRaycastablePanel instead of UIWidgetsPanel " +

}
public static void MarkDirty(int widgetHashCode, int windowHashCode) {
// Debug.Log($"Mark Dirty: [{widgetHashCode}]@[{windowHashCode}]");
D.assert(instance.raycastHandlerMap.ContainsKey(windowHashCode), () =>
$"Raycast Handler Map doesn't contain Window {windowHashCode}");
D.assert(instance.raycastHandlerMap[windowHashCode].ContainsKey(widgetHashCode), () =>

$"Raycast Handler Map doesn't contain Widget {widgetHashCode} at Window {windowHashCode}");
if (instance.raycastHandlerMap[windowHashCode][widgetHashCode].isDirty) {
// Debug.Log($"Update Size Offset: [{widgetHashCode}]@[{windowHashCode}]");
instance.raycastHandlerMap[windowHashCode][widgetHashCode]
.UpdateRect(offset.dx, offset.dy, size.width, size.height);
instance.raycastHandlerMap[windowHashCode][widgetHashCode].UnmarkDirty();

public static void RemoveFromList(int widgetHashCode, int windowHashCode) {
// Debug.Log($"Remove From List: [{widgetHashCode}]@[{windowHashCode}]");
D.assert(instance.raycastHandlerMap.ContainsKey(windowHashCode), () =>
$"Raycast Handler Map doesn't contain Window {windowHashCode}");
D.assert(instance.raycastHandlerMap[windowHashCode].ContainsKey(widgetHashCode), () =>

5
Runtime/Plugins/Raycast/RaycastableContainer.cs


readonly int windowHashCode;
public override void paint(PaintingContext context, Offset offset) {
// Debug.Log($"[RenderRaycastableBox] Paint {this.widget.GetHashCode()}: {this.size}@{offset}");
RaycastManager.UpdateSizeOffset(this.widgetHashCode, this.windowHashCode, this.size, offset);
base.paint(context, offset);

public override void mount(Element parent, object newSlot) {
this.widgetHashCode = this.widget.GetHashCode();
// Debug.Log($"[RaycastableBox] Mount: {this.initHashCode}");
// Debug.Log($"[RaycastableBox] Update: {this.initHashCode}");
// Debug.Log($"[RaycastableBox] Unmount: {this.initHashCode}");
RaycastManager.RemoveFromList(this.widgetHashCode, this.windowHashCode);
base.unmount();
}

正在加载...
取消
保存