using System; using System.Collections.Generic; using UnityEngine; namespace UnityEditor.Sequences { /// /// Sequence Asset builders management. /// This is the main entry point to get the right builders from a given system Type. /// internal class SequenceAssetBuilder { /// /// Make builders available for use for specific types. /// static Dictionary s_RegisteredBuilders = new Dictionary() { { typeof(GameObject), new BasicSequenceAssetBuilder() } }; /// /// Returns a registered builder for a given type. /// /// Type of the Sequence Asset. /// Returns registered builder if one is found. Otherwise, returns BasicSequenceAssetBuilder. internal static ISequenceAssetBuilder GetBuilder(Type type) { if (!s_RegisteredBuilders.ContainsKey(type)) { Debug.LogWarningFormat("SequenceAssetBuilder cannot find builder for type {0}", type); return s_RegisteredBuilders[typeof(GameObject)]; } return s_RegisteredBuilders[type]; } } }