Skip to content

Commit

Permalink
introduced GetType caching in MaterialPropertyData class
Browse files Browse the repository at this point in the history
  • Loading branch information
lukakldiashvili committed Mar 4, 2022
1 parent 8cbfa09 commit 6e7907e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UnifiedRenderer/MaterialPropertyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ public Texture textureValue {

public string GetNameForDisplay => $"{(UnifiedRenderer.UseDisplayPropertyName ? displayName : internalName)}";

public Type GetValueType => Type.GetType(typeName) ?? Type.GetType(typeName + ", UnityEngine.CoreModule", true);
public Type GetValueType =>
_valueType ??= Type.GetType(typeName) ?? Type.GetType(typeName + ", UnityEngine.CoreModule", true);

private Type _valueType = null;

public object GetValue {
get {
Expand Down

0 comments on commit 6e7907e

Please sign in to comment.