public void ClearSelection()
    {
        GameObject[] array = buttonObjects;
        foreach (GameObject gameObject in array)
        {
            KToggle component = gameObject.GetComponent <KToggle>();
            if ((UnityEngine.Object)component != (UnityEngine.Object)null)
            {
                component.Deselect();
                component.isOn = false;
            }
            else
            {
                KBasicToggle component2 = gameObject.GetComponent <KBasicToggle>();
                if ((UnityEngine.Object)component2 != (UnityEngine.Object)null)
                {
                    component2.isOn = false;
                }
            }
            ImageToggleState component3 = gameObject.GetComponent <ImageToggleState>();
            if (component3.GetIsActive())
            {
                component3.SetInactive();
            }
        }
        ToggleGroup component4 = GetComponent <ToggleGroup>();

        if ((UnityEngine.Object)component4 != (UnityEngine.Object)null)
        {
            component4.SetAllTogglesOff();
        }
        SelectToggle(null);
    }
 protected void SelectToggle(KToggle selectedToggle)
 {
     if (!((UnityEngine.Object)UnityEngine.EventSystems.EventSystem.current == (UnityEngine.Object)null) && UnityEngine.EventSystems.EventSystem.current.enabled)
     {
         if ((UnityEngine.Object)currentlySelectedToggle == (UnityEngine.Object)selectedToggle)
         {
             currentlySelectedToggle = null;
         }
         else
         {
             currentlySelectedToggle = selectedToggle;
         }
         GameObject[] array = buttonObjects;
         foreach (GameObject gameObject in array)
         {
             KToggle component = gameObject.GetComponent <KToggle>();
             if ((UnityEngine.Object)component != (UnityEngine.Object)null)
             {
                 if ((UnityEngine.Object)component == (UnityEngine.Object)currentlySelectedToggle)
                 {
                     component.Select();
                     component.isOn = true;
                 }
                 else
                 {
                     component.Deselect();
                     component.isOn = false;
                 }
             }
         }
     }
 }
    public void DeselectDeliverable()
    {
        if ((UnityEngine.Object)controller != (UnityEngine.Object)null)
        {
            controller.RemoveDeliverable(info);
        }
        ImageToggleState component = selectButton.GetComponent <ImageToggleState>();

        component.SetInactive();
        selectButton.Deselect();
        selectButton.ClearOnClick();
        selectButton.onClick += delegate
        {
            SelectDeliverable();
        };
        selectedBorder.SetActive(false);
        titleBar.color = deselectedTitleColor;
    }
Exemplo n.º 4
0
 public void DeselectDeliverable()
 {
     if ((UnityEngine.Object)controller != (UnityEngine.Object)null)
     {
         controller.RemoveDeliverable(stats);
     }
     selectButton.GetComponent <ImageToggleState>().SetInactive();
     selectButton.Deselect();
     selectButton.ClearOnClick();
     selectButton.onClick += delegate
     {
         SelectDeliverable();
     };
     selectedBorder.SetActive(false);
     titleBar.color = deselectedTitleColor;
     animController.Queue("cheer_pst", KAnim.PlayMode.Once, 1f, 0f);
     animController.Queue("idle_default", KAnim.PlayMode.Loop, 1f, 0f);
 }
    public void Activate(int itemIdx, int previouslyActiveTabIdx)
    {
        int childCount = base.transform.childCount;

        if (itemIdx < childCount)
        {
            for (int i = 0; i < childCount; i++)
            {
                Transform child = base.transform.GetChild(i);
                if (child.gameObject.activeSelf)
                {
                    KButton componentInChildren = child.GetComponentInChildren <KButton>();
                    if ((Object)componentInChildren != (Object)null)
                    {
                        Text componentInChildren2 = componentInChildren.GetComponentInChildren <Text>();
                        if ((Object)componentInChildren2 != (Object)null && i == itemIdx)
                        {
                            ActivateTabArtwork(itemIdx);
                        }
                    }
                    KToggle component = child.GetComponent <KToggle>();
                    if ((Object)component != (Object)null)
                    {
                        ActivateTabArtwork(itemIdx);
                        if (i == itemIdx)
                        {
                            component.Select();
                        }
                        else
                        {
                            component.Deselect();
                        }
                    }
                }
            }
        }
    }