/// <summary> /// Collects the Item on Mouse Enter, and Invokes the event /// </summary> private void OnMouseEnter() { if (!GameplayManager.Instance.IsPaused) { // Increments the PCM PiecesCollectedManager.Instance.CollectedPieces[itemType]++; itemCollectedEvent.Invoke(); AudioManager.Instance.PlaySFX(AudioManager.Sounds.ITEM_PICKUP); Destroy(gameObject); } }
/// <summary> /// 0 = single fire /// 1 = rapid fire /// 2 = rocket /// 3 = short range /// 4 = med range /// 5 = long range /// 6 = armor pierce /// 7 = cryo /// 8 = incendiary /// </summary> /// <param name="towerToBuy"></param> public void Purchase(int towerToBuy) { if (GameplayManager.Instance.ScrapCollected >= 100) { GameplayManager.Instance.ScrapCollected -= 100; PiecesCollectedManager.Instance.CollectedPieces[(PiecesCollectedManager.TowerPieceEnum)towerToBuy]++; // HUD_CraftingUI = Listener, Invokes the UpdateItemCount() method itemBoughtEvent.Invoke(); UpdateCountText(); AudioManager.Instance.PlaySFX(AudioManager.Sounds.ITEM_PICKUP); } else { //TODO: ERROR SOUND / Inssufucient Funds } }
private void _myInteractableObject_InteractableObjectGrabbed(object sender, InteractableObjectEventArgs e) { _onItemCollected.Invoke(_myType); Destroy(gameObject); }