Version: 1.7
LanguageEnglish
  • C#

PlayerSettings.MiniGame.CheckActiveSubplatform

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public static bool CheckActiveSubplatform(string subplatform);

Parameters

subplatform The name of the subplatform to check. Supports "WeChat", "DouYin", and "MiniHost" (case-insensitive).

Returns

bool Returns true if the subplatform is active and valid; otherwise, returns false.

Description

Checks whether the specified MiniGame subplatform is active and valid.

If the subplatform is unknown, an error is logged, and false is returned. Otherwise, the function verifies whether the subplatform is active.

Only one subplatform can be active at a time. When a subplatform is activated, its corresponding code will be included in compilation, and the associated macro will take effect. The currently supported subplatform macros are:

* Macro of "WeChat" subplatform: "MINIGAME_SUBPLATFORM_WEIXIN"

* Macro of "DouYin" subplatform: "MINIGAME_SUBPLATFORM_DOUYIN"

* Macro of "MiniHost" subplatform: "MINIGAME_SUBPLATFORM_MINIHOST"