Skip to content

Commit

Permalink
Update GameManager.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
0oQiaoo0 committed Jan 6, 2025
1 parent fe5536c commit c5b1f7f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Demo/API_V2/Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ private void Awake()
);

// 获取微信小游戏的系统信息
#if UNITY_WEBGL && !UNITY_EDITOR
WindowInfo = WX.GetWindowInfo();
MenuButtonBoundingClientRect = WX.GetMenuButtonBoundingClientRect();
#else
WindowInfo = new WindowInfo { safeArea = new SafeArea() };
MenuButtonBoundingClientRect = new ClientRect();
#endif

// 非小游戏与预览环境下防止报错
WindowInfo ??= new WindowInfo { safeArea = new SafeArea() };
MenuButtonBoundingClientRect ??= new ClientRect();
}
);
}
Expand Down

0 comments on commit c5b1f7f

Please sign in to comment.