Exemplo n.º 1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "PlayerNinja")
     {
         Destroy(gameObject);
         kn.KeyNumAdd(1);
     }
 }
 void OnClick()
 {
     if (stonesNumber.stonesNum >= buyNum.needStonesNum)
     {
         keyNum.KeyNumAdd(buyNum.num);
         stonesNumber.StonesNumAdd(-buyNum.needStonesNum);
     }
     else
     {
         newsPanel.SetActive(true);
         isShow = true;
     }
     buyNum.num           = 0;
     buyNum.needStonesNum = 0;
 }
Exemplo n.º 3
0
 //当主角进入触发器
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "PlayerNinja")
     {
         if (kn.keyNum > 0)
         {
             target.GetComponent <Animation>().Play();
             kn.KeyNumAdd(-1);
         }
         if (kn.keyNum <= 0)
         {
             StartCoroutine(ShowWaitTime());
         }
         newsPanel2.SetActive(false);
     }
 }