浏览代码

Merge branch 'master' into yczhang

/main
Yuncong Zhang 6 年前
当前提交
289ea41d
共有 4 个文件被更改,包括 19 次插入7 次删除
  1. 9
      Runtime/engine/UIWidgetsPanel.cs
  2. 4
      Runtime/gestures/converter.cs
  3. 11
      Runtime/ui/painting/canvas_impl.cs
  4. 2
      Runtime/ui/painting/shadow_utils.cs

9
Runtime/engine/UIWidgetsPanel.cs


protected virtual Widget createWidget() {
return null;
}
public void recreateWidget() {
Widget root;
using (this._windowAdapter.getScope()) {
root = this.createWidget();
}
this._windowAdapter.attachRootWidget(root);
}
internal void applyRenderTexture(Rect screenRect, Texture texture, Material mat) {
this.texture = texture;

4
Runtime/gestures/converter.cs


switch (datum.change) {
case PointerChange.down: {
_PointerState state = _ensureStateForPointer(datum, position);
D.assert(!state.down);
if (state.down) {
break;
}
if (state.lastPosition != position) {
// a hover event to be here.
state.lastPosition = position;

11
Runtime/ui/painting/canvas_impl.cs


D.assert(this._layers[0].states.Count == 1);
var layer = this._currentLayer;
if (layer.draws.Count == 0) {
D.assert(layer.layers.Count == 0);
return;
}
using (var cmdBuf = new CommandBuffer()) {
cmdBuf.name = "CommandBufferCanvas";

break;
}
}
if (toClear) {
this._setRenderTarget(cmdBuf, layer.rtID, ref toClear);
}
D.assert(!toClear);
foreach (var subLayer in layer.layers) {
cmdBuf.ReleaseTemporaryRT(subLayer.rtID);

2
Runtime/ui/painting/shadow_utils.cs


namespace Unity.UIWidgets.ui {
static class ShadowUtils {
public static bool kUseFastShadow = true;
public static bool kUseFastShadow = false;
public const float kAmbientHeightFactor = 1.0f / 128.0f;
public const float kAmbientGeomFactor = 64.0f;

正在加载...
取消
保存