示例#1
0
        private static void InitOdinPot()
        {
            var pfire = ZNetScene.instance.GetPrefab("fire_pit");
            var pcaul = ZNetScene.instance.GetPrefab("piece_cauldron");
            var fire  = CopyChildren(pfire);
            var caul  = CopyChildren(pcaul);

            fire.transform.SetParent(Root.transform);
            caul.transform.SetParent(Root.transform);

            fire.transform.localPosition = new Vector3(1.5f, 0, -0.5f);
            caul.transform.localPosition = new Vector3(1.5f, 0, -0.5f);

            Destroy(fire.transform.Find("PlayerBase").gameObject);
            fire.transform.Find("_enabled_high").gameObject.SetActive(true);
            caul.transform.Find("HaveFire").gameObject.SetActive(true);

            m_odinPot        = caul.AddComponent <OdinTrader>();
            m_odinPot.m_name = "$op_pot_name";
            OdinPlus.traderNameList.Add(m_odinPot.m_name);
            m_odinPot.m_talker = m_odinGod.gameObject;

            foreach (var item in OdinMeads.MeadList)
            {
                m_odinPot.m_items.Add(new Trader.TradeItem
                {
                    m_prefab = item.Value.GetComponent <ItemDrop>(),
                    m_stack  = 1,
                    m_price  = OdinData.MeadsValue[item.Key]
                });
            }
        }
示例#2
0
 private static void Postfix(StoreGui __instance, Trader trader)
 {
     if (OdinPlus.traderNameList.Contains(trader.m_name))
     {
         OdinTrader.TweakGui(__instance, true);
         return;
     }
     return;
 }
示例#3
0
            private static void Prefix(StoreGui __instance)
            {
                var trader = Traverse.Create(__instance).Field <Trader>("m_trader").Value;

                if (OdinPlus.traderNameList.Contains(trader.m_name))
                {
                    OdinTrader.TweakGui(__instance, false);
                    return;
                }
                return;
            }