Example #1
0
    public void OnClickGold()
    {
        if (imageGoldIcon.fillAmount < 1)
        {
            UIPopupManager.ShowInstantPopup("세금이 충분히 모이지 않았습니다.");
            return;
        }

        if (coroutineScaleImage != null)
        {
            StopCoroutine(coroutineScaleImage);
            coroutineScaleImage = null;
        }
        coroutineScaleImage = StartCoroutine(ScaleImage());

        if (currentGoldAmount > 0)
        {
            if (spawnCoroutine != null)
            {
                return;
            }
            coinAmount        = currentGoldAmount * Probability();
            currentGoldAmount = 0;
            taxCount          = 0;
            OnSave();

            imageBGGoldIcon.gameObject.SetActive(false);

            spawnCoroutine = StartCoroutine(Spawn());

            imageBGGoldIcon.sprite = spriteGoldList[0];
            imageGoldIcon.sprite   = spriteGoldList[0];

            //particleSystem.gameObject.SetActive(true);

            slot = UIMoney.Instance.shopMoneyGoldText.gameObject.AddComponent <UIMoneySlot>();
            //slot.isUserMoney = true;
            //slot.moneyType = MoneyType.gold;
            money = new MoneyManager.Money();
            MoneyManager.Money m = MoneyManager.GetMoney(MoneyType.gold);
            money.id    = m.id;
            money.value = m.value;
            money.type  = m.type;

            slot.textValue = UIMoney.Instance.shopMoneyGoldText;
            slot.Init(money);
            CoinObject coin = CreatCoinObject();
            coin.Init(coinAmount, coinParent);
            coin.gameObject.SetActive(true);

            //사운드 재생
            soundPlayerTakeCoins.Play();
        }
        //AutoGoldGenStart();
    }
Example #2
0
    /// <summary> 골드 획득 </summary>
    public void TakeTax(Transform target, double taxAmount)
    {
        if (target == null)
        {
            target = coinParent;
        }

        taxAmount *= (1d + (percentIncreaseTaxAmount * 0.01d));

        // 주민 머리위 골드 연출
        CoinObject coin = CreatCoinObject();

        coin.Init(taxAmount, target);
        coin.gameObject.SetActive(true);



        Tax(taxAmount);
    }