本文整理匯總了C#中UnityEditor.SerializedProperty.SetBitAtIndexForAllTargetsImmediate方法的典型用法代碼示例。如果您正苦於以下問題:C# SerializedProperty.SetBitAtIndexForAllTargetsImmediate方法的具體用法?C# SerializedProperty.SetBitAtIndexForAllTargetsImmediate怎麽用?C# SerializedProperty.SetBitAtIndexForAllTargetsImmediate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEditor.SerializedProperty
的用法示例。
在下文中一共展示了SerializedProperty.SetBitAtIndexForAllTargetsImmediate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BitToggleField
internal static bool BitToggleField(string label, SerializedProperty bitFieldProperty, int flag)
{
bool flag2 = (bitFieldProperty.intValue & flag) != 0;
bool flag3 = (bitFieldProperty.hasMultipleDifferentValuesBitwise & flag) != 0;
EditorGUI.showMixedValue = flag3;
EditorGUI.BeginChangeCheck();
flag2 = EditorGUILayout.Toggle(label, flag2, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
if (flag3)
{
flag2 = true;
}
flag3 = false;
int index = -1;
for (int i = 0; i < 32; i++)
{
if ((1 << i & flag) != 0)
{
index = i;
break;
}
}
bitFieldProperty.SetBitAtIndexForAllTargetsImmediate(index, flag2);
}
EditorGUI.showMixedValue = false;
return flag2 && !flag3;
}
示例2: BitToggleField
internal static bool BitToggleField(string label, SerializedProperty bitFieldProperty, int flag)
{
bool flag1 = (bitFieldProperty.intValue & flag) != 0;
bool flag2 = (bitFieldProperty.hasMultipleDifferentValuesBitwise & flag) != 0;
EditorGUI.showMixedValue = flag2;
EditorGUI.BeginChangeCheck();
bool flag3 = EditorGUILayout.Toggle(label, flag1, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
if (flag2)
flag3 = true;
flag2 = false;
int index1 = -1;
for (int index2 = 0; index2 < 32; ++index2)
{
if ((1 << index2 & flag) != 0)
{
index1 = index2;
break;
}
}
bitFieldProperty.SetBitAtIndexForAllTargetsImmediate(index1, flag3);
}
EditorGUI.showMixedValue = false;
if (flag3)
return !flag2;
return false;
}