Version: 2021.3
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); } }