Version: 2023.1
LanguageEnglish
  • C#

EditorUtility.SetDialogOptOutDecision

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

Declaration

public static void SetDialogOptOutDecision(DialogOptOutDecisionType dialogOptOutDecisionType, string dialogOptOutDecisionStorageKey, bool optOutDecision);

Parameters

dialogOptOutDecisionType The type of opt-out decision a user can make.
dialogOptOutDecisionStorageKey The unique key setting to store the decision under.
optOutDecision The unique key setting to store the decision under.

Description

This method displays a modal dialog that lets the user opt-out of being shown the current dialog box again.

Use this method as a short-hand to set the opt-out decision a user can make on a dialog displayed via DisplayDialog.

You don't need to set this after you call DisplayDialog, as Unity handles it automatically.

If the user chooses to opt-out of a dialog box, Unity stores this decision. If dialogOptOutDecisionType is set to DialogOptOutDecisionType.ForThisMachine Unity stores it via EditorPrefs.SetBool. If dialogOptOutDecisionType is set to DialogOptOutDecisionType.ForThisSession Unity stores it via SessionState.SetBool. In both cases Unity stores it under the key provided as dialogOptOutDecisionStorageKey.

This method automatically sets the decision in the storage place based on the provided dialogOptOutDecisionType.

See Also: DisplayDialog function.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961