- Validator: Added asset validators with material texture and shader validation
- Validator: Added option to enable/disable certain validators - Project Settings: Fixed issue, where changes weren't always saved - Unity: Removed deprecated warnings in Unity 6.4
This commit is contained in:
parent
01ac17a078
commit
dd55a87740
30 changed files with 716 additions and 38 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Module.ProjectValidator.Editor
|
||||
{
|
||||
|
|
@ -11,7 +12,12 @@ namespace Module.ProjectValidator.Editor
|
|||
|
||||
public readonly List<Entry> Entries = new();
|
||||
private readonly Dictionary<GUID, MappingEntry> _assetToSeverityMapping = new();
|
||||
|
||||
#if UNITY_6000_4_OR_NEWER
|
||||
private readonly Dictionary<EntityId, MappingEntry> _instanceToSeverityMapping = new();
|
||||
#else
|
||||
private readonly Dictionary<int, MappingEntry> _instanceToSeverityMapping = new();
|
||||
#endif
|
||||
|
||||
public void Add(GUID assetGuid, string relativePath, string fieldPath, Attribute attribute, EValidatorSeverity severity, string message)
|
||||
{
|
||||
|
|
@ -58,13 +64,23 @@ namespace Module.ProjectValidator.Editor
|
|||
|
||||
public bool TryGetSeverityFor(string guid, out MappingEntry mapping)
|
||||
{
|
||||
if (GUID.TryParse(guid, out var assetGuid) && _assetToSeverityMapping.TryGetValue(assetGuid, out mapping))
|
||||
if (UnityEngine.GUID.TryParse(guid, out var assetGuid) && _assetToSeverityMapping.TryGetValue(assetGuid, out mapping))
|
||||
return true;
|
||||
|
||||
mapping = new MappingEntry();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_6000_4_OR_NEWER
|
||||
public bool TryGetSeverityFor(EntityId entityId, out MappingEntry mapping)
|
||||
{
|
||||
if (_instanceToSeverityMapping.TryGetValue(entityId, out mapping))
|
||||
return true;
|
||||
|
||||
mapping = new MappingEntry();
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
public bool TryGetSeverityFor(int instanceId, out MappingEntry mapping)
|
||||
{
|
||||
if (_instanceToSeverityMapping.TryGetValue(instanceId, out mapping))
|
||||
|
|
@ -73,6 +89,7 @@ namespace Module.ProjectValidator.Editor
|
|||
mapping = new MappingEntry();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool TryGetSeverityFor(GUID assetGuid, string relativePath, out MappingEntry mapping)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue