void OnDeath() { if (transform.position.y < -5) { //fell out of world } else { FollowCamera camera = RoadTileManager.checkpoint.FollowCamera; if (Vector3.Distance(transform.position, camera.target.transform.position) > camera.CullDistance) { // Culled } else if (RoadTileManager.bMainMenu) { // Main Menu screen } else { Killcount.AddKill(); if (Killcount.GetKills() % 10 == 0) { Currency.AddCurrency(); } } } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { currencyScript.AddCurrency(value); Destroy(gameObject); } }
public void CmdServerSellItem(int slot) { if (slot < 0 || slot > m_inventorySlots.Count) { return; } InventoryItem item = m_inventorySlots[slot].Item; BaseItemContainer itemContainer = item.ItemContainer; if (ServerTryRemoveItem(slot)) { m_currency.AddCurrency(itemContainer.Cost.Ammount / 2); } }
void HandleShopAd(ShowResult result) { switch (result) { case ShowResult.Finished: Currency.AddCurrency(5); Scenes.instance.LoadScene(Scenes.Scene.SHOP); break; case ShowResult.Skipped: case ShowResult.Failed: default: Scenes.instance.LoadScene(Scenes.Scene.SHOP); break; } }