public static List <Type> GetAllowedGroupTypes(TrackGroup trackGroup)
        {
            // Get all the allowed Genres for this track group
            TimelineGroupGenre[] genres = new TimelineGroupGenre[0];

            TrackGroupAttribute[] tga = ReflectionHelper.GetCustomAttributes <TrackGroupAttribute>(trackGroup.GetType(), true);
            for (int i = 0; i < tga.Length; i++)
            {
                if (tga[i] != null)
                {
                    genres = tga[i].AllowedGroupGenres;
                    break;
                }
            }

            Type[]      subTypes          = DirectorRuntimeHelper.GetAllSubTypes(typeof(TrackGroup));
            List <Type> allowedTrackTypes = new List <Type>();

            for (int i = 0; i < subTypes.Length; i++)
            {
                allowedTrackTypes.Add(subTypes[i]);
            }

            return(allowedTrackTypes);
        }
Beispiel #2
0
 public List <Type> GetAllowedGroupTypes()
 {
     if (allowedGroupTypes == null)
     {
         allowedGroupTypes = DirectorRuntimeHelper.GetAllowedTrackTypes(this);
     }
     return(allowedGroupTypes);
 }
Beispiel #3
0
 /// <summary>
 /// Returns all allowed Timeline Item types.
 /// </summary>
 /// <returns>A list of allowed cutscene item types.</returns>
 public List <Type> GetAllowedCutsceneItems()
 {
     if (allowedItemTypes == null)
     {
         allowedItemTypes = DirectorRuntimeHelper.GetAllowedItemTypes(this);
     }
     return(allowedItemTypes);
 }
        /// <summary>
        /// Returns a list of Cutscene Item types that are associated with the given Track.
        /// </summary>
        /// <param name="timelineTrack">The track to look up.</param>
        /// <returns>A list of valid cutscene item types.</returns>
        public static List <Type> GetAllowedItemTypes(TimelineTrack timelineTrack)
        {
            // Get all the allowed Genres for this track group
            TrackItemGenre[] genres = new TrackItemGenre[0];

            TimelineTrackAttribute[] tta = ReflectionHelper.GetCustomAttributes <TimelineTrackAttribute>(timelineTrack.GetType(), true);
            for (int i = 0; i < tta.Length; i++)
            {
                if (tta[i] != null)
                {
                    genres = tta[i].AllowedItemGenres;
                    break;
                }
            }

            Type[]      subTypes          = DirectorRuntimeHelper.GetAllSubTypes(typeof(TimelineItem));
            List <Type> allowedTrackTypes = new List <Type>();

            for (int i = 0; i < subTypes.Length; i++)
            {
                TimelineItemAttribute[] customAttributes = ReflectionHelper.GetCustomAttributes <TimelineItemAttribute>(subTypes[i], true);
                for (int j = 0; j < customAttributes.Length; j++)
                {
                    if (customAttributes[j] != null)
                    {
                        for (int k = 0; k < customAttributes[j].Genres.Length; k++)
                        {
                            TrackItemGenre genre = customAttributes[j].Genres[k];
                            for (int l = 0; l < genres.Length; l++)
                            {
                                if (genre == genres[l])
                                {
                                    allowedTrackTypes.Add(subTypes[i]);
                                    break;
                                }
                            }
                        }
                        break;
                    }
                }
            }

            return(allowedTrackTypes);
        }