技能主要更新,修复卡顿并加入动画,以及各种其他更新。

This commit is contained in:
FloatGaming
2026-02-07 21:05:17 +08:00
parent abeca51be5
commit 1ac3cd0104
1349 changed files with 1526749 additions and 24850 deletions
+10 -10
View File
@@ -2,8 +2,8 @@ using UnityEngine;
public class WebViewPanelFollower : MonoBehaviour
{
public RectTransform panelRect; // 拖拽要跟随的 UI Panel RectTransform
public Camera uiCamera; // UI 相机,通常是 Canvas Event Camera
public RectTransform panelRect; // קҪ UI Panel RectTransform
public Camera uiCamera; // UI ͨ Canvas Event Camera
private Rect lastPanelRect;
private WebViewWin32.RECT lastUnityWindowRect;
@@ -43,17 +43,17 @@ public class WebViewPanelFollower : MonoBehaviour
if (panelRect == null || uiCamera == null || WebViewLauncher.Instance == null)
return;
// 获取当前 panel 的屏幕矩形
// ȡǰ panel Ļ
Rect currentPanelRect = GetPanelScreenRect(panelRect);
// 获取当前 Unity 窗口位置(仅在 build 中需要)
WebViewWin32.RECT currentUnityWindowRect = new WebViewWin32.RECT();
// ȡǰ Unity λã build Ҫ
#if !UNITY_EDITOR
WebViewWin32.RECT currentUnityWindowRect = new WebViewWin32.RECT();
if (!WebViewWin32.TryGetClientScreenRect(System.Diagnostics.Process.GetCurrentProcess(), out currentUnityWindowRect))
return;
#endif
// 检查是否需要更新
// ǷҪ
if (!hasLastRect ||
!ApproximatelyEqual(currentPanelRect, lastPanelRect)
#if !UNITY_EDITOR
@@ -63,18 +63,18 @@ public class WebViewPanelFollower : MonoBehaviour
{
int x, y;
#if UNITY_EDITOR
// 在编辑器中,直接使用屏幕坐标(相对于屏幕左上角)
// ڱ༭УֱʹĻĻϽǣ
x = Mathf.RoundToInt(currentPanelRect.x);
y = Mathf.RoundToInt(Screen.height - currentPanelRect.y - currentPanelRect.height);
#else
// build 中,使用 Unity 窗口位置 + 相对坐标
// build Уʹ Unity λ +
x = Mathf.RoundToInt(currentUnityWindowRect.Left + currentPanelRect.x);
y = Mathf.RoundToInt(currentUnityWindowRect.Top + (Screen.height - currentPanelRect.y - currentPanelRect.height));
#endif
int w = Mathf.RoundToInt(currentPanelRect.width);
int h = Mathf.RoundToInt(currentPanelRect.height);
// 更新 WebView 窗口
// WebView
bool success = WebViewLauncher.Instance.TryUpdateWebViewRect(x, y, w, h);
if (success)
{
@@ -102,8 +102,8 @@ public class WebViewPanelFollower : MonoBehaviour
Rect currentPanelRect = GetPanelScreenRect(panelRect);
WebViewWin32.RECT currentUnityWindowRect = new WebViewWin32.RECT();
#if !UNITY_EDITOR
WebViewWin32.RECT currentUnityWindowRect = new WebViewWin32.RECT();
if (!WebViewWin32.TryGetClientScreenRect(System.Diagnostics.Process.GetCurrentProcess(), out currentUnityWindowRect))
return;
#endif