c# - Can't override GetHashCode (cannot change return type when overriding method int UnityEngine.Object.GetHashCode") -


i'm using c# in unity3d game engine. in monobehaviour script need override gethashcode. whenever do, error cannot change return type when overriding method int unityengine.object.gethashcode" (isn't gethashcode located inside system namespace?)

my overriding:

public override int gethashcode() {     return index.gethashcode(); } 

the error no longer exists if remove using unityengine; header top. tried explicitly tell override, it's not dealing interfaces, didn't work.

what's going on here, there 2 gethashcodes? how can override gethashcode here?

thanks.

edit: have removed using system; , left out unityengine, same result.

edit: tried empty class, , project, nothing :(

unityengine.object has own gethashcode() , overwrite you've done above, except return type have there wrong. see below:

public class test : monobehaviour {     public override int gethashcode() {         return base.gethashcode();     } } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -