Esempio n. 1
0
        private static bool ValidateTarget(ModelViewsModuleSettings asset, string[] paths)
        {
            if (!asset || asset.isRebuildActive == false)
            {
                return(false);
            }
            if (asset.updateTargets.Count == 0)
            {
                return(true);
            }

            foreach (var targetPath in asset.updateTargets)
            {
                if (paths.Any(x => x.IndexOf(targetPath, StringComparison.OrdinalIgnoreCase) >= 0))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 2
0
        public static void Rebuild(ModelViewsModuleSettings settings)
        {
            settings.CleanUp();

            var baseViewType  = ViewSystemConstants.BaseViewType;
            var baseModelType = ViewSystemConstants.BaseModelType;

            var modelTypes = baseModelType.GetAssignableTypes();
            var typeArs    = new Type[1];

            //get all views
            foreach (var modelType in modelTypes)
            {
                typeArs[0] = modelType;
                var targetType = baseViewType.MakeGenericType(typeArs);
                var viewTypes  = targetType.GetAssignableTypes();
                settings.UpdateValue(modelType, viewTypes);
            }

            EditorUtility.SetDirty(settings);
        }