Unity-Technologies / 2d-extras

Fun 2D Stuff that we'd like to share!
Other
1.54k stars 342 forks source link

2021.1.22f1 HashCode Error #359

Closed Kevehin closed 1 year ago

Kevehin commented 1 year ago

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"

ChuanXin-Unity commented 1 year ago

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.

Kevehin commented 1 year ago

Works perfectly now, thanks so much!