您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
1.1 KiB
34 行
1.1 KiB
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.rendering;
|
|
|
|
namespace Unity.UIWidgets.widgets {
|
|
public class PerformanceOverlay : LeafRenderObjectWidget {
|
|
public PerformanceOverlay(
|
|
Key key = null,
|
|
int optionsMask = 0
|
|
) : base(key: key) {
|
|
this.optionsMask = optionsMask;
|
|
}
|
|
|
|
public readonly int optionsMask;
|
|
|
|
public static PerformanceOverlay allEnabled(
|
|
Key key = null
|
|
) {
|
|
return new PerformanceOverlay(
|
|
optionsMask: (1 << (int) PerformanceOverlayOption.drawFPS) |
|
|
(1 << (int) PerformanceOverlayOption.drawFrameCost)
|
|
);
|
|
}
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) {
|
|
return new RenderPerformanceOverlay(
|
|
optionsMask: this.optionsMask);
|
|
}
|
|
|
|
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
|
|
RenderPerformanceOverlay _renderObject = (RenderPerformanceOverlay) renderObject;
|
|
_renderObject.optionsMask = this.optionsMask;
|
|
}
|
|
}
|
|
}
|