Version: 2023.1
LanguageEnglish
  • C#

RemoteSettings.GetDictionary

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 IDictionary<string,object> GetDictionary(string key);

Parameters

key The key identifying the setting.

Returns

IDictionary<string,object> An instance of Dictionary<string, object> containing the corresponding remote value or values.

Description

Gets a dictionary corresponding to the remote setting identified by key, if it exists.

Remote Settings creates a Dictionary<string, object> instance and adds the remote setting corresponding to the key parameter to it. If the setting is a simple type, then the dictionary contains a single element, which has a key matching the key parameter. If the remote setting is an object, then Remote Settings adds the field names and values of that object to the dictionary as the key-value pairs. If a remote value is an object rather than a simple type, Remote Settings adds a sub-dictionary containing the key-value pairs for the sub-object.

If you do not specify a key when calling GetDictionary(), Remote Settings treats all of your remote settings as a single object. If you specify a key that does not exist, this function returns null.

using UnityEngine;
using System.Collections.Generic;

public class HandleRemoteSettings : MonoBehaviour { private void Start() { IDictionary<string, object> ms = RemoteSettings.GetDictionary("myGameSettings"); Debug.Log(ms); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961