Esempio n. 1
0
 void Start()
 {
     vendorWindow = VendorWindow.instance;
     MyItems      = VendorManager.instance.GetGoods(vendorType, amountOfItems);
     player       = PlayerController.instance.transform;
     pc           = PlayerController.instance;
 }
Esempio n. 2
0
    private static void OpenShop(BinaryReader reader)
    {
        Dictionary <ushort, VendorWindow.ShopItem> shop = new Dictionary <ushort, VendorWindow.ShopItem>();

        int    characterId = reader.ReadInt32();
        ushort count       = reader.ReadUInt16();

        for (int i = 0; i < count; i++)
        {
            shop.Add(reader.ReadUInt16(), new VendorWindow.ShopItem()
            {
                itemId = reader.ReadInt32(),
                price  = reader.ReadInt32(),
                amount = reader.ReadInt32(),
            });
        }

        UnityMainThreadDispatcher.Instance().Enqueue(() =>
        {
            VendorWindow window = FindObjectOfType <VendorWindow>();
            window.GetComponent <UIWindow>().Show();

            window.Fill(characterId, shop);
        });
    }
Esempio n. 3
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }