浏览代码

paste for runtime

/siyaoH-paste
siyao 3 年前
当前提交
1ee7acf7
共有 2 个文件被更改,包括 17 次插入0 次删除
  1. 9
      com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
  2. 8
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs

9
com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.ui;
using UnityEditor;
using UnityEngine;

}
void Input_OnGUIEvent(Event evt) {
Debug.Log(evt);
if (evt.type == EventType.MouseDown) {
var pos = _getPointerPosition(position: evt.mousePosition);
_wrapper.OnPointerDown(pos: pos, _buttonToPointerId(buttonId: evt.button));

else if (evt.isKey) {
_wrapper.OnKeyDown(e: evt);
Event.current.Use();
} else if (evt.type == EventType.ValidateCommand && evt.commandName == "Paste") {
foreach (var character in GUIUtility.systemCopyBuffer) {
var splitEvent = new Event();
splitEvent.type = EventType.KeyDown;
splitEvent.character = character;
PointerEventConverter.KeyEvent.Enqueue(splitEvent);
}
}
}

8
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs


using System.IO;
using Unity.UIWidgets.external.simplejson;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

var e = Event.current;
if (e.isKey) {
_wrapper.OnKeyDown(e: e);
} else if (e.type == EventType.ValidateCommand && e.commandName == "Paste") {
foreach (var character in GUIUtility.systemCopyBuffer) {
var splitEvent = new Event();
splitEvent.type = EventType.KeyDown;
splitEvent.character = character;
PointerEventConverter.KeyEvent.Enqueue(splitEvent);
}
}
}

正在加载...
取消
保存