wit-ai / wit-unity

Wit-Unity is a Unity C# wrapper around the the Wit.ai rest APIs and is a core component of Voice SDK.
Other
82 stars 20 forks source link

WitConfigurationUtility.GetLoadedConfigurations() fix #84

Closed ByMedion closed 1 year ago

ByMedion commented 1 year ago

Added check if the scene is loaded for this case: If you add two or more scenes to the "Hierarchy" window and unload one of them, then every time the scripts are reloaded, an error will occur: Exception thrown while invoking [DidReloadScripts] method 'Meta.WitAi.Windows.WitConfigurationEditor:OnScriptsReloaded ()' : ArgumentException: The scene is not loaded. UnityEngine.SceneManagement.Scene.GetRootGameObjects (System.Collections.Generic.List`1[T] rootGameObjects) (at /Users/bokken/build/output/unity/unity/Runtime/Export/SceneManager/Scene.cs:100) UnityEngine.SceneManagement.Scene.GetRootGameObjects () (at /Users/bokken/build/output/unity/unity/Runtime/Export/SceneManager/Scene.cs:84) Meta.WitAi.Data.Configuration.WitConfigurationUtility.GetLoadedConfigurations () (at /Users/bymedion/Documents/GitRepos/wit-unity/Scripts/Editor/Data/Configuration/WitConfigurationUtility.cs:121) Meta.WitAi.Windows.WitConfigurationEditor.OnScriptsReloaded () (at /Users/bymedion/Documents/GitRepos/wit-unity/Scripts/Editor/Data/Configuration/WitConfigurationEditor.cs:506)

yolanother commented 1 year ago

Awesome. Thanks for the contribution, we will get it merged in ASAP.

yolanother commented 1 year ago

This got merged in and fixed a while back. Closing.