BitMask.SetAll C# (CSharp) Method

SetAll() public method

public SetAll ( bool b ) : void
b bool
return void
    public void SetAll( bool b )
    {
        var num = b ? uint.MaxValue : 0u;
        for( var i = 0; i < _bytes.Length; i++ )
        {
            _bytes[i] = num;
        }
    }

Usage Example

Example #1
0
    public void CreateMask()
    {
        mask.SetAll(false);

        // Initialize the ECSInterface's mask from each attached Component
        var components = gameObject.GetComponents <Component>();

        foreach (var component in components)
        {
            mask[ComponentIDs.Get(component.GetType())] = true;
        }
    }