/// <summary> /// Refreshes the theme and mode popup values. /// </summary> protected void RefreshPopups() { InteractiveMusicTheme[] themes = themesProp.GetArray <InteractiveMusicTheme>(); themeNames = InteractiveMusic.GetThemeNames(themes); InteractiveMusicTheme theme = themes.Length == 0 ? null : themes[currentThemeProp.intValue]; modeNames = InteractiveMusic.GetModeNames(theme); }
/// <summary> /// Gets a list of mode names for the given theme. /// </summary> /// <param name="theme">The theme from which to get mode names.</param> /// <returns>A list of mode names for the given theme.</returns> public static string[] GetModeNames(InteractiveMusicTheme theme) { if (theme == null) { return(new string[0]); } string[] modeNames = new string[theme.modes.Length]; for (int i = 0; i < theme.modes.Length; i++) { modeNames[i] = theme.modes[i] == null ? "" : theme.modes[i].name; } return(modeNames); }
/// <summary> /// Refreshes the theme and mode popup values. /// </summary> protected void RefreshPopups() { if (musicProp.objectReferenceValue == null) { themeNames = new string[0]; enterModeNames = new string[0]; exitModeNames = new string[0]; return; } InteractiveMusicTheme[] themes = ((InteractiveMusic)musicProp.objectReferenceValue).themes; themeNames = InteractiveMusic.GetThemeNames(themes); InteractiveMusicTheme enterTheme = themes.Length == 0 ? null : themes[enterThemeProp.intValue]; enterModeNames = InteractiveMusic.GetModeNames(enterTheme); InteractiveMusicTheme exitTheme = themes.Length == 0 ? null : themes[exitThemeProp.intValue]; exitModeNames = InteractiveMusic.GetModeNames(exitTheme); }
/// <summary> /// Gets a list of mode names for the given theme. /// </summary> /// <param name="theme">The theme from which to get mode names.</param> /// <returns>A list of mode names for the given theme.</returns> public static string[] GetModeNames(InteractiveMusicTheme theme) { if (theme == null) return new string[0]; string[] modeNames = new string[theme.modes.Length]; for (int i = 0; i < theme.modes.Length; i++) modeNames[i] = theme.modes[i] == null ? "" : theme.modes[i].name; return modeNames; }
/// <summary> /// Gets a list of theme names for the given array of themes. /// </summary> /// <param name="theme">The array of themes from which to get names.</param> /// <returns>A list of theme names for the given array of themes.</returns> public static string[] GetThemeNames(InteractiveMusicTheme[] themes) { if (themes == null) return new string[0]; string[] themeNames = new string[themes.Length]; for (int i = 0; i < themes.Length; i++) themeNames[i] = themes[i] == null ? "" : themes[i].title; return themeNames; }