Hello, in my MonoBehaviour script i need to override GetHashCode. But whenever I do, I get the error cannot change return type when overriding method int UnityEngine.Object.GetHashCode"
(Isn’t GetHashCode located inside the System namespace?)
My overriding:
public override int GetHashCode()
{
return index.GetHashCode();
}
The error no longer exists if I remove the using UnityEngine header from the top.
I tried to explicitly tell it what to override, it didn’t work.
What’s going on here, how can I override GetHashCode here?
Thanks.
EDIT: I tried a brand new empty class, same result.
using UnityEngine;
public class Entry : MonoBehaviour
{
public override int GetHashCode()
{
return base.GetHashCode();
}
}
I also tried it in another project, it didn’t work.