Unity-Technologies/2d-extras

2021.1.22f1 HashCode Error

Kevehin opened this issue · 2 comments

I'm aware there is a similar issue report for an earlier version, however i'm running 2021.1 and still getting this issue

    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 HashCode.Combine(position.GetHashCode(), name.GetHashCode());
        }
    }

Returns "error CS0103: The name 'HashCode' does not exist in the current context"

Hi, sorry about this! Could you share how you have added the 2d Extras package and which version of it you are using?

If you are using it directly from this repository through the master branch, I have updated the master branch with a fix for this! You may need to remove the packages_lock.json in the Packages folder of your project to get the fixed version.

Works perfectly now, thanks so much!