コード例 #1
0
        public override void SetActive(bool active)
        {
            if (!active)
            {
                Recipes.Clear();
                if (EpicLoot.HasAuga)
                {
                    EffectSelectors.Clear();
                }
                else
                {
                    foreach (var toggle in EffectSelectors)
                    {
                        toggle.gameObject.SetActive(false);
                    }
                }
            }

            if (EpicLoot.HasAuga)
            {
                if (active)
                {
                    var augmentsAvailableText = Auga.API.CustomVariantPanel_Enable("$mod_epicloot_augment_availableeffects", (showing) =>
                    {
                        if (showing)
                        {
                            ShowAvailableAugmentsDialog();
                        }
                    });

                    AvailableAugmentsDialog = augmentsAvailableText.gameObject.GetComponent <AugmentsAvailableDialog>();
                    if (AvailableAugmentsDialog == null)
                    {
                        AvailableAugmentsDialog = augmentsAvailableText.gameObject.AddComponent <AugmentsAvailableDialog>();
                    }
                    AvailableAugmentsDialog.Description = augmentsAvailableText;
                }
                else
                {
                    Auga.API.CustomVariantPanel_Disable();
                }
            }
            else
            {
                AvailableAugmentsButton.gameObject.SetActive(active);
                if (AvailableAugmentsDialog.gameObject.activeSelf && !active)
                {
                    AvailableAugmentsDialog.OnClose();
                }
                if (ChoiceDialog.gameObject.activeSelf && !active)
                {
                    ChoiceDialog.OnClose();
                }
            }

            base.SetActive(active);
        }
コード例 #2
0
 public override void SetActive(bool active)
 {
     if (!active)
     {
         Recipes.Clear();
         foreach (var toggle in EffectSelectors)
         {
             toggle.gameObject.SetActive(false);
         }
     }
     AvailableAugmentsButton.gameObject.SetActive(active);
     if (AvailableAugmentsDialog.gameObject.activeSelf && !active)
     {
         AvailableAugmentsDialog.OnClose();
     }
     if (ChoiceDialog.gameObject.activeSelf && !active)
     {
         ChoiceDialog.OnClose();
     }
     base.SetActive(active);
 }