Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

BitField32.SetBits

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetBits(int pos, bool value);

Parameters

Parameter Description
pos Position in this bit field to set (must be 0-31).
value If true, sets the bit to 1. If false, sets the bit to 0.

Description

Sets a single bit to 1 or 0.


Declaration

public void SetBits(int pos, bool value, int numBits);

Parameters

Parameter Description
pos Position in the bit field of the first bit to set (must be 0-31).
value If true, sets the bits to 1. If false, sets the bits to 0.
numBits Number of bits to set (must be 1-32).

Description

Sets one or more contiguous bits to 1 or 0.