Skip to content

Instantly share code, notes, and snippets.

@melikeeroglu
Created December 29, 2020 10:24
Show Gist options
  • Save melikeeroglu/7303dd709afa139e37fc9a4a42b9fc03 to your computer and use it in GitHub Desktop.
Save melikeeroglu/7303dd709afa139e37fc9a4a42b9fc03 to your computer and use it in GitHub Desktop.
remoteConfigManager = new RemoteConfigManager();
remoteConfigManager.GetInstance();
remoteConfigManager.Fetch();
Debug.Log($"Value: {remoteConfigManager.GetValueAsString("Key1")}");
Dictionary<string, object> values = remoteConfigManager.GetMergedAll();
foreach (KeyValuePair<string, object> kvp in values)
{
Debug.Log($"[Remote Config]: key:{kvp.Key} / value:{kvp.Value}");
}
if (remoteConfigManager.GetValueAsString("Key1") == "Value1")
{
GameObject[] btn = GameObject.FindGameObjectsWithTag("Button");
// Iterate through the array of 'btn' and add them to the 'buttons' list
for (int i = 0; i < btn.Length; i++)
{
ColorBlock cb = btn[i].GetComponent<Button>().colors;
cb.normalColor = Color.red;
btn[i].GetComponent<Button>().colors = cb;
}
Dictionary<string, object> map = new Dictionary<string, object>();
map.Add("Key1", "Value2");
remoteConfigManager.ApplyDefault(map);
}
else
{
Dictionary<string, object> map = new Dictionary<string, object>();
map.Add("Key1", "Value1");
remoteConfigManager.ApplyDefault(map);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment