主题
GameCore.ClientEnvironment
ClientClipboard 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientClipboardProvides local clipboard text access for the client.
属性
Text 仅客户端
csharp
public string Text { get; set; }Gets or sets the current local clipboard text.
备注
Assigning null clears the clipboard text.
方法
Clear 仅客户端
csharp
public void Clear()Clears the local clipboard text.
ClientDiagnostics 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientDiagnosticsProvides local client diagnostics and log upload requests.
属性
Current 仅客户端
csharp
public ClientDiagnosticsSnapshot Current { get; }Gets the latest client diagnostics snapshot.
方法
TryUploadLogs 仅客户端
csharp
public bool TryUploadLogs()Requests an upload of this client's logs for the current project.
返回: True if the request was accepted, not if the upload finished successfully.
备注
Requires a client that supports ClientLogUpload. Check Runtime.Supports before calling on older clients.
ClientEnvironment 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public static class ClientEnvironmentProvides client-only access to local device and platform environment features.
备注
This API is available only in client builds. Put usage under #if CLIENT. The values exposed here describe the current player's local client. They are not synchronized to the server and should not be used as gameplay authority.
属性
Runtime 仅客户端
csharp
public static ClientRuntime Runtime { get; }Gets version and capability information supplied by the client binary.
Clipboard 仅客户端
csharp
public static ClientClipboard Clipboard { get; }Gets clipboard helpers for reading and writing local clipboard text.
Localization 仅客户端
csharp
public static ClientLocalization Localization { get; }Gets localization helpers for reading system culture and switching the current client culture.
Network 仅客户端
csharp
public static ClientNetwork Network { get; }Gets network status helpers for the local client.
Power 仅客户端
csharp
public static ClientPower Power { get; }Gets power and battery status helpers for the local device.
Diagnostics 仅客户端
csharp
public static ClientDiagnostics Diagnostics { get; }Gets local diagnostics and client log upload helpers.
方法
TryOpenUrl 仅客户端
csharp
public static bool TryOpenUrl(Uri url)Requests the client to open an external URL or app link.
url— The absolute URL or app link to open.
返回: true if the client accepted the open request; otherwise, false. This does not guarantee that the target page or app finished loading.
备注
The default allowlist is intentionally very limited. QQ group invitation links are supported for the common group-join flow; use the link generated by QQ group sharing, for example https://qm.qq.com/q/xxxx. A group number by itself normally cannot replace the share code in that URL. Other website URLs or app links must be added to the project's URL allowlist before they can be opened.
TryOpenUrl 仅客户端
csharp
public static bool TryOpenUrl(string url)Requests the client to open an external URL or app link from a string.
url— The absolute URL or app link string to open.
返回: true if is a valid absolute URL or app link and the client accepted the open request; otherwise, false.
备注
QQ group links should use the invitation link generated by QQ group sharing, such as https://qm.qq.com/q/xxxx. Other links require project URL allowlist configuration first.
ClientLocalization 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientLocalizationProvides local culture and localization settings for the client.
属性
DefaultCulture 仅客户端
csharp
public CultureInfo DefaultCulture { get; }Gets the default culture used by the project on this client.
SystemCulture 仅客户端
csharp
public CultureInfo SystemCulture { get; }Gets the culture reported by the player's operating system or platform account.
CurrentCulture 仅客户端
csharp
public CultureInfo CurrentCulture { get; set; }Gets or sets the current culture used by client-side localization.
ClientNetwork 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientNetworkProvides local network status for the client.
属性
Current 仅客户端
csharp
public ClientNetworkInfo Current { get; }Gets the current local network status.
IsWifi 仅客户端
csharp
public bool IsWifi { get; }Gets whether the current connection is reported as Wi-Fi.
ClientPower 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientPowerProvides local power and battery status for the client.
属性
Current 仅客户端
csharp
public ClientPowerInfo Current { get; }Gets the current local power status.
Battery 仅客户端
csharp
public ClientBatteryInfo Battery { get; }Gets the current local battery status.
ClientRuntime 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public sealed class ClientRuntimeReads client-binary identity/capability values without adding a new WASM import.
构造函数
ClientRuntime 仅客户端
csharp
public ClientRuntime()属性
Current 仅客户端
csharp
public static ClientRuntime Current { get; }Gets the shared client-binary runtime descriptor without loading optional environment-provider types that may be absent from older clients.
BinaryVersion 仅客户端
csharp
public long BinaryVersion { get; }Exact product/build version. This is diagnostic information and must not be used as the feature compatibility contract.
CapabilityVersion 仅客户端
csharp
public int CapabilityVersion { get; }Monotonic WASM/client capability contract version. Zero means unknown/old client.
方法
Supports 仅客户端
csharp
public bool Supports(ClientRuntimeFeature feature)ClientRuntimeFeature 仅客户端
命名空间 GameCore.ClientEnvironment
csharp
public enum ClientRuntimeFeatureDescribes optional runtime capabilities exposed by the client binary.
枚举值
GameEnvironment = 1HostDisconnectedEvent = 1SceneGraphReplicationEvents = 1SceneHashLoadResultEvent = 1LabelLinkClickEvent = 1UIAuthoringRuntimeInitialize = 2UIAuthoringSourceMapping = 2PaymentBalanceInfo = 3SimpleSkinning = 3ScreenViewportSurfaceResizeEvents = 4— Same-size surface recreation events reach the ScreenViewport change path. Requires client capability version 4 or later.RuntimeTerrainTextureEditing = 5— Scene opt-in retains discrete terrain texture weights and rebuild data. Requires client capability 5.RelativeMouseCapture = 5— 游戏视口鼠标捕获与相对位移事件。需要客户端能力版本 5。ClientLogUpload = 6— In-game client log upload request. Requires client capability 6.TmxFile2DModernLoading = 7— Finite TMX 1.x maps, including 1.11, with Base64 zlib/gzip/zstd tile layers and external TSX-relative image paths. Requires client capability 7.ApplicationLifecycleEvents = 8— Mobile application lifecycle and low-memory events. Requires client capability version 8.NativeClientServices = 9— 显示/Surface、窗口、屏幕密度与物理尺寸估算、帧调度、原生诊断、设置事件和手柄服务。客户端能力版本 9。GameRenderSettings = 9— 当前游戏实时渲染设置和快照。客户端能力版本 9。ParticleDeterminism = 10— 粒子发射器确定性 seed、固定步长推进与绝对时刻回放。需要客户端能力版本 10。