コード例 #1
0
    public void Buy()
    {
        BackpackManager backpack_manager = objWho.GetComponent <BackpackManager>();
        int             money            = backpack_manager.GetMoney();

        if (money >= PayMoney)
        {
            for (int i = 0; i < lstItemShoppingCart.Count; i++)
            {
                backpack_manager.AddItem(lstItemShoppingCart[i]);
            }

            backpack_manager.SetMoney(money - PayMoney);
        }

        InitialShoppingCart();
    }
コード例 #2
0
 private void DisplayWhoMoney()
 {
     txtMoney.text = "金幣 : " + backpackManager.GetMoney().ToString();
 }