浏览代码

Merge branch 'master' of gitlab.cds.internal.unity3d.com:upm-packages/ui-widgets/com.unity.uiwidgets into material

/main
xingwei.zhu 6 年前
当前提交
9f7fd9d6
共有 7 个文件被更改,包括 43 次插入22 次删除
  1. 8
      Runtime/editor/editor_window.cs
  2. 11
      Runtime/engine/UIWidgetsMessageManager.cs
  3. 20
      Runtime/engine/UIWidgetsPanel.cs
  4. 3
      Runtime/service/keyboard.cs
  5. 2
      Runtime/ui/painting/canvas_impl.cs
  6. 19
      Runtime/widgets/focus_manager.cs
  7. 2
      Samples/ReduxSample/ObjectFinder/ObjectFinderApp.cs

8
Runtime/editor/editor_window.cs


this.editorWindow.Repaint();
}
protected override bool hasFocus() {
return EditorWindow.focusedWindow == this.editorWindow;
}
public override GUIContent titleContent {
get { return this.editorWindow.titleContent; }
}

protected virtual void updateSafeArea() {
}
protected abstract bool hasFocus();
public void OnEnable() {
this._devicePixelRatio = this.queryDevicePixelRatio();

public void Update() {
Timer.update();
bool hasFocus = this.hasFocus();
WidgetsBinding.instance.focusManager.focusNone(!hasFocus);
this._updateScrollInput();
TextInput.Update();
this._timerProvider.update(this.flushMicrotasks);

11
Runtime/engine/UIWidgetsMessageManager.cs


if (!Application.isPlaying) {
return;
}
if (UIWidgetsMessageManager.instance != null) {
if (_instance != null) {
return;
}
var managerObj = new GameObject("__UIWidgetsMessageManager");

#if UNITY_IOS || UNITY_ANDROID
#endif
void OnEnable() {
D.assert(_instance == null, "Only one instance of UIWidgetsMessageManager should exists");
_instance = this;

}
void UpdateNameIfNeed() {
#if UNITY_IOS || UNITY_ANDROID
#if UNITY_IOS || UNITY_ANDROID
#endif
#endif
}
public void AddChannelMessageDelegate(string channel, MethodChannelMessageDelegate del) {

20
Runtime/engine/UIWidgetsPanel.cs


Screen.height - Screen.safeArea.height);
}
protected override bool hasFocus() {
return EventSystem.current != null &&
EventSystem.current.currentSelectedGameObject == this._uiWidgetsPanel.gameObject;
}
public override void scheduleFrame(bool regenerateLayerTree = true) {
base.scheduleFrame(regenerateLayerTree);
this._needsPaint = true;

PerformanceUtils.instance.updateDeltaTime(Time.unscaledDeltaTime);
this._displayMetrics.Update();
UIWidgetsMessageManager.ensureUIWidgetsMessageManagerIfNeeded();
if (EventSystem.current != null && EventSystem.current.currentSelectedGameObject != this.gameObject) {
this.unfocusIfNeeded();
}
if (this._mouseEntered) {
if (this._lastMouseMove.x != Input.mousePosition.x || this._lastMouseMove.y != Input.mousePosition.y) {
this.handleMouseMovement();

D.assert(this._windowAdapter != null);
this._windowAdapter.Update();
this._windowAdapter.OnGUI(_repaintEvent);
}
void OnGUI() {

physicalX: position.x,
physicalY: position.y
));
}
void unfocusIfNeeded() {
using (this._windowAdapter.getScope()) {
var focusNode = WidgetsBinding.instance.focusManager.currentFocus;
if (focusNode != null) {
focusNode.unfocus();
}
}
}
}
}

3
Runtime/service/keyboard.cs


}
}
#endif
#endif
#endif
}

2
Runtime/ui/painting/canvas_impl.cs


var tex = font.material.mainTexture;
Action<Paint> drawMesh = (Paint p) => {
if (!this._applyClip(textBlob.bounds)) {
if (!this._applyClip(matrix.mapRect(textBlob.bounds))) {
return;
}

19
Runtime/widgets/focus_manager.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.widgets {
public class FocusNode : ChangeNotifier {

}
public readonly FocusScopeNode rootScope = new FocusScopeNode();
internal readonly FocusScopeNode _noneScope = new FocusScopeNode();
internal FocusNode _currentFocus;
internal void _willDisposeFocusNode(FocusNode node) {

}
}
public void focusNone(bool focus) {
if (focus) {
if (this._noneScope._parent != null && this._noneScope.isFirstFocus) {
return;
}
this.rootScope.setFirstFocus(this._noneScope);
}
else {
if (this._noneScope._parent == null) {
return;
}
this._noneScope.detach();
}
}
public override string ToString() {
var status = this._haveScheduledUpdate ? " UPDATE SCHEDULED" : "";
var indent = " ";

2
Samples/ReduxSample/ObjectFinder/ObjectFinderApp.cs


key: new ValueKey<int>(obj.id),
child: new Text(obj.name),
padding: EdgeInsets.all(8),
color: this.widget.selected == obj.id ? new Color(0xFFFF0000) : null
color: this.widget.selected == obj.id ? new Color(0xFFFF0000) : new Color(0)
), onTap: () => {
if (this.widget.onSelect != null) {
this.widget.onSelect(obj.id);

正在加载...
取消
保存