Example #1
0
        static LSScenePropertyDrawer()
        {
            List <Type> drawerTypes = LSEditorUtility.GetFilteredTypes(typeof(LSScenePropertyDrawer));

            foreach (Type type in drawerTypes)
            {
                LSScenePropertyDrawer drawer = (LSScenePropertyDrawer)Activator.CreateInstance(type);
                Type targetType = drawer.TargetType;
                MappedDrawers.Add(targetType, drawer);
            }
        }
Example #2
0
        public static LSScenePropertyDrawer GetDrawer(Type targetType)
        {
            LSScenePropertyDrawer drawer;

            while (!MappedDrawers.TryGetValue(targetType, out drawer))
            {
                targetType = targetType.BaseType;
                if (targetType.BaseType == null)
                {
                    return(null);
                }
            }
            return(drawer);
        }