mackysoft / Unity-SerializeReferenceExtensions

Provide popup to specify the type of the field serialized by the [SerializeReference] attribute in the inspector.
https://qiita.com/makihiro_dev/items/26daeb3e5f176934bf0a
MIT License
725 stars 56 forks source link

Performance improvement: Use TypeCache instead of manual type iteration #56

Closed theo-rapidfire closed 5 months ago

theo-rapidfire commented 5 months ago

fix/use-type-cache

Description

The PropertyDrawerType cache generation had a performance bottleneck, which could be resolved by using Unity's TypeCache.

Performance before:

  1. Selecting Item A image
  2. Selecting Item B image

Performance after:

  1. Selecting Item A image
  2. Selecting Item B image

Changes made

mackysoft commented 5 months ago

Function confirmed. Thanks @theo-rapidfire !