Closed JAQuent closed 1 year ago
I've tried to use this https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.keycollection?view=net-8.0 by accessing session.settings.Keys.Contains(key)
because session.settings.Keys
seem to be a 'Dictionary<string, object>.KeyCollection' , however I still get
error CS1061: 'Dictionary<string, object>.KeyCollection' does not contain a definition for 'Contains' and no accessible extension method 'Contains' accepting a first argument of type 'Dictionary<string, object>.KeyCollection' could be found (are you missing a using directive or an assembly reference?)
This works
foreach(var key in session.settings.Keys){
Debug.Log(key);
}
I'd like to check if my session .json contains a certain key (e.g. objectRotationSpeed) and use that value if it exists and assign a default value if it doesn't. For that I have to check whether the key objectRotationSpeed exists in the settings heirarchy but I don't know how to do this.
Something like:
But if I do this I get the following error:
KeyNotFoundException: The key "objectRotationSpeed" was not found in the settings heirarchy. Use UXF Session Debugger (UXF menu at top of unity editor) to check your settings are being applied correctly.