Closed Staarter closed 1 year ago
Thank you for bringing this to my attention! I'll include the fix in the next release but in the meantime, you can apply the fix yourself by changing these lines: https://github.com/yasirkula/UnityAssetUsageDetector/blob/8072530c2cc666007d79f0a8aae038a4d2d26878/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs#L1421-L1425
As follows:
case SerializedPropertyType.ManagedReference:
object managedReferenceValue = GetRawSerializedPropertyValue( iterator );
propertyValue = managedReferenceValue as Object;
searchResult = SearchObject( PreferablyGameObject( managedReferenceValue ) );
enterChildren = false;
break;
Thank you for your reply! This fix works like a charm, good job.
Description of the bug
Assets that are referenced by polymorphism using the tag [SerializeReference] are not found by AUD.
Reproduction steps
[System.Serializable] public class ContainerBase { }
[System.Serializable] public class ContainerGO : ContainerBase { public GameObject go; }
[CreateAssetMenu(fileName ="AUD_SerializeReference", menuName = "AUD_SerializeReference")] public class DebugAUD_SerializeReference : ScriptableObject { [SerializeReference] public List test = new List();
}
[CreateAssetMenu(fileName ="AUD_Default", menuName = "AUD_Default")] public class DebugAUD_Default : ScriptableObject { public List test = new List();
}