Skip to content

Assembly improvement#39

Merged
JonathanMCarter merged 9 commits into
CarterGames:contributionfrom
Gardens-Lies:assembly-improvement
May 19, 2026
Merged

Assembly improvement#39
JonathanMCarter merged 9 commits into
CarterGames:contributionfrom
Gardens-Lies:assembly-improvement

Conversation

@NoixDeXydre
Copy link
Copy Markdown
Contributor

@NoixDeXydre NoixDeXydre commented May 17, 2026

Improves assembly scan and code by...

  • Speeding up initialization for editor / runtime when searching for implementations of a type (especially if it searches in entire project each time.)
  • Avoiding assemblies loading each time it scans the project.
  • Integrating Unity 6.X changes.
  • Changing a badly name variable (copy paste ?)

It should also slighty improve SaveGame() and LoadGame().

Those changes are quite critical so let me know if you have a question or if you noticed a bug. I tested it on my end and there's nothing alarming so far.

@JonathanMCarter JonathanMCarter self-assigned this May 17, 2026
@JonathanMCarter JonathanMCarter added enhancement New feature or request 3.x Anything related to the 3.x.x versions of the asset. labels May 17, 2026
@JonathanMCarter JonathanMCarter changed the base branch from main to contribution May 17, 2026 16:57
@JonathanMCarter
Copy link
Copy Markdown
Member

  • Updated target branch to contribution.

Like #38 I want to give this a full test and check things over. May make a few adjustments myself too. But looks like some good improvements!

/// It is intended to use this cache to avoid the use
/// of <see cref="Assembly.GetTypes"/> in each call.
/// </summary>
private static readonly Dictionary<Type, List<Type>> TypeCache = new();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't compile in the base development version of 2020.3.0

Suggested change
private static readonly Dictionary<Type, List<Type>> TypeCache = new();
private static readonly Dictionary<Type, List<Type>> TypeCache = new Dictionary<Type, List<Type>>();

/// </summary>
private static readonly Dictionary<Type, List<Type>> TypeCache = new();

private static Assembly[] _cachedAssemblies;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not match naming conventions. See: https://carter.games/unity-c-style-guide/#7-fields

Suggested change
private static Assembly[] _cachedAssemblies;
private static Assembly[] cachedAssemblies;

@JonathanMCarter JonathanMCarter merged commit d29e4f3 into CarterGames:contribution May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Anything related to the 3.x.x versions of the asset. enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

2 participants