本文整理汇总了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;
}