public bool IsParentOfOrEqualTo(GameplayTag other) { var mask = 0xFFFFFFFF; // Get the MSB parent byte that is non-zero mask = math.select(0xFFFFFFFF, 0xFFFFFF00, L2 == 0); mask = math.select(0xFFFFFFFF, 0xFFFF0000, L3 == 0); mask = math.select(0xFFFFFFFF, 0xFF000000, L1 == 0); mask = math.select(0xFFFFFFFF, 0x00000000, L0 == 0); // Apply the mask the other tag, so that the parent parts can be comapred // If the parent MSB are identical, then this tag is a parent return((mask & other.Id) == Id); }
public bool Equals(GameplayTag other) { return(other.Id == Id); }