void OnTriggerEnter(Collider col) { if (col.tag == "PlayerNinja") { //Destroy(this.gameObject); StartCoroutine(DestoryWaitTime()); cn.CoinsNumAdd(num); GetComponent <AudioSource>().PlayOneShot(coinsSound); } }
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; }