Example #1
0
    public StoreAreaComponentAction parentComponent; //アウトレット接続する

    public new void buy()
    {
        SirokoStats status = FindObjectOfType <SirokoStats>();

        if (!status)
        {
            Debug.LogError("買おうとしたけどステータスない");
            return;
        }
        if (canBuyThis())
        {
            status.buy(kind, itemName, cost);
            //アクションは一つしか買えないので、アクションボタン全体のisBoughtにチェックを入れていく
            parentComponent.notifyActionIsBoughtToChildren();
            refresh();
            storeMenu.refresh();
        }
        else
        {
            Debug.Log("カエナイヨ");
        }
    }
Example #2
0
    public void buy()
    {
        SirokoStats status = FindObjectOfType <SirokoStats>();

        if (!status)
        {
            Debug.LogError("買おうとしたけどステータスない");
            return;
        }
        if (canBuyThis())
        {
            soundsController.playUICoin();
            status.buy(kind, itemName, cost);
            isBought = true;
            refresh();
            storeMenu.refresh();
        }
        else
        {
            Debug.Log("カエナイヨ");
        }
    }