コード例 #1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "PlayerNinja")
     {
         //Destroy(this.gameObject);
         StartCoroutine(DestoryWaitTime());
         cn.CoinsNumAdd(num);
         GetComponent <AudioSource>().PlayOneShot(coinsSound);
     }
 }
コード例 #2
0
    void OnClick()
    {
        if (coinsNumber.coinsNum >= buyNum.needCoinsNum)
        {
            powerNum.PowerNumAdd(buyNum.num);
            //buyNum.num = 0;

            coinsNumber.CoinsNumAdd(-buyNum.needCoinsNum);
            //buyNum.needCoinsNum = 0;
        }
        else
        {
            newsPanel.SetActive(true);
            isShow = true;
        }
        buyNum.num          = 0;
        buyNum.needCoinsNum = 0;
    }