浏览代码

Merge pull request #127 from Unity-Technologies/siyaoH/1.17/android

channel message
/siyaoH-1.17-PlatformMessage
GitHub 4 年前
当前提交
63cef0f3
共有 4 个文件被更改,包括 9 次插入14 次删除
  1. 14
      com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs
  2. 2
      com.unity.uiwidgets/Runtime/services/keyboard.cs
  3. 4
      com.unity.uiwidgets/Runtime/services/text_input.cs
  4. 3
      com.unity.uiwidgets/Runtime/ui2/hooks.cs

14
com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs


using System.Collections.Generic;
using System.Runtime.InteropServices;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.engine {

}
}
Queue<string> messages = new Queue<string>();
messages.Enqueue(message);
}
public void handlePlatformMessage(){
while (!messages.isEmpty()) {
var message = messages.Dequeue();
using (Isolate.getScope(TextInput._currentConnection.isolate)) {
JSONObject jsonObject = (JSONObject) JSON.Parse(message);
string channel = jsonObject["channel"].Value;
string method = jsonObject["method"].Value;

2
com.unity.uiwidgets/Runtime/services/keyboard.cs


return;
}
var isolate = Isolate.current;
var isolate = TextInput._currentConnection.isolate;
using (Isolate.getScope(isolate)) {
switch (method) {
case "TextInputClient.updateEditingState":

4
com.unity.uiwidgets/Runtime/services/text_input.cs


_client = client;
_id = _nextId++;
}
public Isolate isolate {
get { return _window._panel.isolate; }
}
internal Size _cachedSize;
internal Matrix4 _cachedTransform;

3
com.unity.uiwidgets/Runtime/ui2/hooks.cs


[MonoPInvokeCallback(typeof(Window_drawFrameCallback))]
static void Window_drawFrame() {
try {
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
UIWidgetsMessageManager.instance.handlePlatformMessage();
#endif
Window.instance.onDrawFrame?.Invoke();
}
catch (Exception ex) {

正在加载...
取消
保存