示例#1
0
        public static bool DisclosureToggle(String title, ref bool value, bool forceHorizontal = true, float width = 175, params Action[] actions)
        {
            bool changed = UI.TogglePrivate(title, ref value, true, forceHorizontal, width);

            UI.If(value, actions);
            return(changed);
        }
示例#2
0
        public static bool DisclosureBitFieldToggle(String title, ref int bitfield, int offset, bool exclusive = true, bool forceHorizontal = true, float width = 175, params Action[] actions)
        {
            bool bit    = ((1 << offset) & bitfield) != 0;
            bool newBit = bit;

            TogglePrivate(title, ref newBit, true, forceHorizontal, width);
            if (bit != newBit)
            {
                if (exclusive)
                {
                    bitfield = (newBit ? 1 << offset : 0);
                }
                else
                {
                    bitfield ^= (1 << offset);
                }
            }
            UI.If(newBit, actions);
            return(bit != newBit);
        }