Exemplo n.º 1
0
        protected override void Logic(ValidationTarget target)
        {
            var hitObjectPaths = target.GetAllAssetGuids()
                                 .Where(targetGuid => Array.Exists(guids, guid => guid == targetGuid))
                                 .Select(guid => AssetDatabase.GUIDToAssetPath(guid));

            foreach (var path in hitObjectPaths)
            {
                var obj     = AssetDatabase.LoadMainAssetAtPath(path);
                var message = "該当するアセットが検出されました。" + Environment.NewLine + path;
                AddIssue(new Issue(obj, IssueLevel.Error, message, string.Empty, string.Empty));
            }
        }
        protected override void Logic(ValidationTarget target)
        {
            var hitObjectPaths = target.GetAllAssetGuids()
                                 .Where(targetGuid => IsUnauthorized(targetGuid, target.GetBaseFolderPath()))
                                 .Select(guid => AssetDatabase.GUIDToAssetPath(guid));

            foreach (var path in hitObjectPaths)
            {
                var obj      = AssetDatabase.LoadMainAssetAtPath(path);
                var message  = LocalizedMessage.Get("AssetGuidBlacklistRule.UnauthorizedAssetDetected", path);
                var solution = LocalizedMessage.Get("AssetGuidBlacklistRule.UnauthorizedAssetDetected.Solution");
                AddIssue(new Issue(obj, IssueLevel.Error, message, solution, string.Empty));
            }
        }