static MarsMarkerLibrary SelectMarkerLibrary()
        {
            var companionResourceSync = CompanionResourceSync.instance;
            var library = companionResourceSync.DefaultMarkerLibrary;

            if (library == null)
            {
                var libraries = CompanionEditorAssetUtils.LoadAllMarkerLibraryAssets();
                if (libraries == null || libraries.Length == 0)
                {
                    library = CompanionEditorAssetUtils.CreateAndSaveNewLibrary();
                    RefreshMarkerLibraryList();
                    companionResourceSync.DefaultMarkerLibrary = library;
                }
                else if (libraries.Length > 0)
                {
                    var session = MARSSession.Instance;
                    if (session != null && session.MarkerLibrary != null)
                    {
                        library = session.MarkerLibrary;
                    }

                    if (library == null)
                    {
                        library = libraries[0];
                    }
                }
            }

            return(library);
        }
        internal static (MarsMarkerLibrary[], string[]) RefreshMarkerLibraryList()
        {
            var updatedMarkerLibraries = CompanionEditorAssetUtils.LoadAllMarkerLibraryAssets();
            var updatedLibraryNames    = updatedMarkerLibraries.Length == 0
                ? new[] { string.Empty, "Add Marker Library" }
                : updatedMarkerLibraries.Select(lib => lib.name).ToArray();

            return(updatedMarkerLibraries, updatedLibraryNames);
        }