Created
September 8, 2016 10:50
-
-
Save zeyangl/ec66614032b0bb59a630f5def7cc619c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private struct ProcessIndex : System.IEquatable<ProcessIndex> | |
{ | |
public Segment seg; | |
public int i; | |
public bool Equals(ProcessIndex other) | |
{ | |
return this.seg == other.seg && this.i == other.i; | |
} | |
public override bool Equals(object other) | |
{ | |
if(other is ProcessIndex) | |
return Equals((ProcessIndex)other); | |
return false; | |
} | |
public override int GetHashCode() | |
{ | |
int hash = 23; | |
hash = hash * 31 + (int)seg; | |
hash = hash * 31 + i; | |
return hash; | |
} | |
} | |
... | |
public enum Segment : int | |
{ | |
Update = 0, | |
FixedUpdate = 1, | |
LateUpdate = 2, | |
SlowUpdate = 3, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment