Skip to content

Commit

Permalink
updated binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed Oct 13, 2020
1 parent 4b0b098 commit ac144eb
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 83 deletions.
2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/package/Assets/Plugins/Android/WebViewPlugin.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/Android/WebViewPlugin.jar.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/WebView.bundle/Contents.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 79 additions & 59 deletions dist/package/Assets/Plugins/WebViewObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,58 +1011,8 @@ void Update()
break;
}
}
}

public int bitmapRefreshCycle = 1;

void OnGUI()
{
if (webView == IntPtr.Zero || !visibility)
return;

Vector3 p;
p.x = Input.mousePosition.x - rect.x;
p.y = Input.mousePosition.y - rect.y;
{
int mouseState = 0;
if (Input.GetButtonDown("Fire1")) {
mouseState = 1;
} else if (Input.GetButtonUp("Fire1")) {
mouseState = 3;
} else if (Input.GetButton("Fire1")) {
mouseState = 2;
}
_CWebViewPlugin_SendMouseEvent(webView, (int)p.x, (int)p.y, Input.GetAxis("Mouse ScrollWheel"), mouseState);
}
{
string keyChars = "";
ushort keyCode = 0;
if (!string.IsNullOrEmpty(inputString)) {
keyChars = inputString.Substring(0, 1);
keyCode = (ushort)inputString[0];
inputString = inputString.Substring(1);
}
if (!string.IsNullOrEmpty(keyChars) || keyCode != 0) {
_CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 1);
}
// if (keyChars != keyChars0) {
// if (!string.IsNullOrEmpty(keyChars0)) {
// Debug.Log("XX1 " + (short)keyChars0[0]);
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars0, keyCode0, 3);
// }
// if (!string.IsNullOrEmpty(keyChars)) {
// Debug.Log("XX2 " + (short)keyChars[0]);
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 1);
// }
// } else {
// if (!string.IsNullOrEmpty(keyChars)) {
// Debug.Log("XX3");
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 2);
// }
// }
// keyChars0 = keyChars;
// keyCode0 = keyCode;
}
bool refreshBitmap = (Time.frameCount % bitmapRefreshCycle == 0);
_CWebViewPlugin_Update(webView, refreshBitmap);
if (refreshBitmap) {
Expand All @@ -1083,15 +1033,85 @@ void OnGUI()
GL.IssuePluginEvent(GetRenderEventFunc(), -1);
#endif
}
if (texture != null) {
Matrix4x4 m = GUI.matrix;
GUI.matrix
= Matrix4x4.TRS(
new Vector3(0, Screen.height, 0),
Quaternion.identity,
new Vector3(1, -1, 1));
GUI.DrawTexture(rect, texture);
GUI.matrix = m;
}

public int bitmapRefreshCycle = 1;

void OnGUI()
{
if (webView == IntPtr.Zero || !visibility)
return;

switch (Event.current.type) {
case EventType.MouseDown:
case EventType.MouseUp:
case EventType.MouseMove:
case EventType.MouseDrag:
case EventType.ScrollWheel:
{
Vector3 p;
p.x = Input.mousePosition.x - rect.x;
p.y = Input.mousePosition.y - rect.y;
{
int mouseState = 0;
if (Input.GetButtonDown("Fire1")) {
mouseState = 1;
} else if (Input.GetButtonUp("Fire1")) {
mouseState = 3;
} else if (Input.GetButton("Fire1")) {
mouseState = 2;
}
_CWebViewPlugin_SendMouseEvent(webView, (int)p.x, (int)p.y, Input.GetAxis("Mouse ScrollWheel"), mouseState);
}
}
break;
case EventType.KeyDown:
case EventType.KeyUp:
{
string keyChars = "";
ushort keyCode = 0;
if (!string.IsNullOrEmpty(inputString)) {
keyChars = inputString.Substring(0, 1);
keyCode = (ushort)inputString[0];
inputString = inputString.Substring(1);
}
if (!string.IsNullOrEmpty(keyChars) || keyCode != 0) {
Vector3 p;
p.x = Input.mousePosition.x - rect.x;
p.y = Input.mousePosition.y - rect.y;
_CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 1);
}
// if (keyChars != keyChars0) {
// if (!string.IsNullOrEmpty(keyChars0)) {
// Debug.Log("XX1 " + (short)keyChars0[0]);
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars0, keyCode0, 3);
// }
// if (!string.IsNullOrEmpty(keyChars)) {
// Debug.Log("XX2 " + (short)keyChars[0]);
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 1);
// }
// } else {
// if (!string.IsNullOrEmpty(keyChars)) {
// Debug.Log("XX3");
// _CWebViewPlugin_SendKeyEvent(webView, (int)p.x, (int)p.y, keyChars, keyCode, 2);
// }
// }
// keyChars0 = keyChars;
// keyCode0 = keyCode;
}
break;
case EventType.Repaint:
if (texture != null) {
Matrix4x4 m = GUI.matrix;
GUI.matrix
= Matrix4x4.TRS(
new Vector3(0, Screen.height, 0),
Quaternion.identity,
new Vector3(1, -1, 1));
GUI.DrawTexture(rect, texture);
GUI.matrix = m;
}
break;
}
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/WebViewObject.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/iOS.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/Plugins/iOS/WebView.mm.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/WebGLTemplates/unity-webview.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/package/Assets/WebPlayerTemplates/unity-webview.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/unity-webview-nofragment.unitypackage
Binary file not shown.
Binary file modified dist/unity-webview-nofragment.zip
Binary file not shown.
Binary file modified dist/unity-webview.unitypackage
Binary file not shown.
Binary file modified dist/unity-webview.zip
Binary file not shown.

0 comments on commit ac144eb

Please sign in to comment.