示例#1
0
文件: store.cs 项目: OasiBoi/Scarce
 public void AddAmmo()
 {
     if (plyr.money - prc >= 0)
     {
         plyr.CollectAmmo(amnt);
     }
 }
示例#2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent("ammoObj"))
     {
         player.CollectAmmo(3);
     }
     if (other.GetComponent("hlthObj"))
     {
         player.CollectHealth(3);
     }
     if (other.GetComponent("coinObj"))
     {
         coinObj coin = other.GetComponent <coinObj>();
         int     w    = coin.worth;
         player.CollectCoin(w);
     }
     if (other.GetComponent("xpObj"))
     {
         xpObj xp = other.GetComponent <xpObj>();
         int   p  = xp.points;
         player.CollectXp(p);
     }
     if (other.GetComponent("stmnObj"))
     {
         stmnObj stmn = other.GetComponent <stmnObj>();
         int     s    = stmn.points;
         player.CollectStmn(s);
     }
 }