Version: 1.5
LanguageEnglish
  • C#

PlayerSettings.MiniGame.SetActiveSubplatform

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 void SetActiveSubplatform(string subplatform, bool isActive);

Parameters

subplatform The name of the subplatform to modify. Supports "WeChat", "DouYin", and "MiniHost" (case-insensitive).
isActive True to activate the subplatform, false to deactivate it.

Returns

void

Description

Sets the activation state of the specified MiniGame subplatform.

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"