超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class WebViewPanelFollower : MonoBehaviour
|
||||
{
|
||||
public RectTransform panelRect; // ��קҪ����� UI Panel �� RectTransform
|
||||
public Camera uiCamera; // UI �����ͨ���� Canvas �� Event Camera
|
||||
public RectTransform panelRect; // Documentation text normalized.
|
||||
public Camera uiCamera; // Documentation text normalized.
|
||||
|
||||
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 ����Ļ����
|
||||
// Documentation text normalized.
|
||||
Rect currentPanelRect = GetPanelScreenRect(panelRect);
|
||||
|
||||
// ��ȡ��ǰ Unity ����λ�ã����� build ����Ҫ��
|
||||
// Documentation text normalized.
|
||||
#if !UNITY_EDITOR
|
||||
WebViewWin32.RECT currentUnityWindowRect = new WebViewWin32.RECT();
|
||||
if (!WebViewWin32.TryGetClientScreenRect(System.Diagnostics.Process.GetCurrentProcess(), out currentUnityWindowRect))
|
||||
return;
|
||||
#endif
|
||||
|
||||
// ����Ƿ���Ҫ����
|
||||
// Update position when first initialized, panel rect changed, or window rect changed.
|
||||
if (!hasLastRect ||
|
||||
!ApproximatelyEqual(currentPanelRect, lastPanelRect)
|
||||
#if !UNITY_EDITOR
|
||||
@@ -63,18 +63,16 @@ 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 ����λ�� + �������
|
||||
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 ����
|
||||
// Documentation text normalized.
|
||||
bool success = WebViewLauncher.Instance.TryUpdateWebViewRect(x, y, w, h);
|
||||
if (success)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user