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); } }
public void SubCoin() { if (plyr.money - prc >= 0) { plyr.CollectCoin(-prc); } else { Debug.Log("not enough doh"); } }