Beispiel #1
0
 static public int ColorToInt(BlockButtonColor c)
 {
     int retVal = 0;
     retVal |= Mathf.RoundToInt(c.r * 255f) << 24;
     retVal |= Mathf.RoundToInt(c.g * 255f) << 16;
     retVal |= Mathf.RoundToInt(c.b * 255f) << 8;
     retVal |= Mathf.RoundToInt(c.a * 255f);
     return retVal;
 }
Beispiel #2
0
 public override int GetHashCode()
 {
     return BlockButtonColor.ColorToInt(this);
 }
Beispiel #3
0
 public override bool Equals(object other)
 {
     BlockButtonColor c = (BlockButtonColor)other;
     return (this == c);
 }