Game.Rendering.ColorSyncFlags
Assembly: Assembly-CSharp
Namespace: Game.Rendering
Type: public enum (with [Flags])
Base: System.Enum (underlying type: System.Byte)
Summary:
ColorSyncFlags is a bitmask enum used to describe how colors should be synchronized between elements (for example, when matching colours across grouped or indexed assets). The enum is decorated with [Flags] and uses a byte as the underlying storage. Values can be combined using bitwise operations to represent multiple synchronization constraints (e.g., same group and a range variation).
Fields
-
None = 0
Represents no synchronization flags set. Use this as the default value. -
SameGroup = 1
Indicates colors should be synced for members of the same group. -
SameIndex = 2
Indicates colors should be synced for items with the same index. -
DifferentGroup = 4
Indicates colors should be synced for items that are in different groups (useful for pairing across groups). -
DifferentIndex = 8
Indicates colors should be synced for items that have different indices. -
SyncRangeVariation = 0x10
Allows synchronization while permitting a range-based variation (a tolerance or offset in the synced color).
Properties
- (none)
This enum defines constant fields only; there are no properties.
Constructors
- (none)
Enums have no explicit constructors. Underlying type is byte.
Methods
- (none)
No methods are defined on this enum type. Use standard bitwise operations and Enum utilities (e.g., HasFlag) to work with values.
Usage Example
// Combine flags
ColorSyncFlags flags = ColorSyncFlags.SameGroup | ColorSyncFlags.SyncRangeVariation;
// Test for a flag using bitwise check
bool hasSameGroup = (flags & ColorSyncFlags.SameGroup) == ColorSyncFlags.SameGroup;
// Test using Enum.HasFlag (slower boxed path, but convenient)
bool hasVariation = flags.HasFlag(ColorSyncFlags.SyncRangeVariation);
// Remove a flag
flags &= ~ColorSyncFlags.SyncRangeVariation;
// Check mutually exclusive or combined conditions
if ((flags & (ColorSyncFlags.SameGroup | ColorSyncFlags.SameIndex)) != 0)
{
// handle sync by group or index
}
Additional notes: - Because the enum uses the [Flags] attribute, values are intended to be combined. When checking flags in performance-sensitive code (e.g., in rendering loops), prefer bitwise & checks over Enum.HasFlag to avoid boxing.