Setting Environments for UGS and RemoteConfig Without Needing Name and ID

For the general UGS setup I am using the environment name:

var options = new InitializationOptions();
options.SetEnvironmentName("development");
await UnityServices.InitializeAsync(options);

But for RemoteConfigs, I they reccomend using the envirnment's ID to initialize:

ConfigManager.SetEnvironmentID("aaaaaaaa-bbbb-1234-9876-abcd1234abc");

Is there a way to initialize either of these the opposite way such that I only need to store/modify a single variable an have both point to a new environment?

Hi Tomumental,

Thanks for your feedback.
I will report this to the team and see if there is a way to unify both into one.

7859566--997840--upload_2022-2-1_15-7-47.png

If the ConfigManager had :
ConfigManager.SetEnvironmentName("development") would this do the trick?

OR

It was brought to my attention that you would like to have the 1 call that would also set the environment for remote config?

We are looking into this feedback. Thanks again

Yep ConfigManager.SetEnvironmentName("development"); would be perfect!

1 Like

Hi @Tomumental ,
As a workaround you can try the following:

var options = new InitializationOptions().SetOption("com.unity.services.core.environment-name", "dev");
await UnityServices.InitializeAsync(options);

This would let you set the environment name through the options.

I have tested this locally with success. Let me know if you have any issues.

All the best,
Seb

Thanks that works!

1 Like