コード例 #1
0
ファイル: StoreGui_Patch.cs プロジェクト: sbtoonz/ValheimMods
        public static void Show_Postfix(StoreGui __instance)
        {
            if (!EpicLoot.IsAdventureModeEnabled())
            {
                return;
            }

            if (__instance.transform.Find(nameof(MerchantPanel)) == null)
            {
                if (MerchantPanel != null)
                {
                    Object.Destroy(MerchantPanel);
                }

                MerchantPanel = Object.Instantiate(EpicLoot.Assets.MerchantPanel, __instance.transform, false);
                MerchantPanel.AddComponent <MerchantPanel>();
            }

            MerchantPanel.gameObject.SetActive(true);
        }