Example #1
0
    private void Set(bool value, bool sendCallback)
    {
        if (m_Selected == value)
        {
            return;
        }

        m_Selected = value;
        if (m_Group != null && Toggle)
        {
            if (m_Selected || !m_Group.AnyItemSelected())
            {
                //一旦组里有Item选择了,组里必须要有一个处于选中状态
                m_Selected = true;
                m_Group.NotifyItemOn(this);
            }
        }
        RefreshState();
        if (sendCallback)
        {
            onSelectedChanged.Invoke(Selected);
            onSelectedChangedEx.Invoke(this, Selected);
        }
    }