as GridInformationKey used as a Dictionary key, current version will alloc 292B GC when call dict.TryGetValue(). For better performance it should be like below:
internal struct GridInformationKey : IEquatable<GridInformationKey>
{
public Vector3Int position;
public String name;
public bool Equals(GridInformationKey key)
{
return position == key.position && name == key.name;
}
public override int GetHashCode()
{
return position.GetHashCode() + name.GetHashCode();
}
}
as GridInformationKey used as a Dictionary key, current version will alloc 292B GC when call dict.TryGetValue(). For better performance it should be like below: