JOLT/Assets/Scripts/Entity/Collectables/Collectable.cs
/// <summary>
/// Called by the player's paddle to collect this collectable.
/// </summary>
Called by the player's paddle to collect this collectable.
Called by the player ' s paddle to collect this collectable .
internal void Collect() {
			OnCollectedEvent();
			if(givesGem) {
				AddGemToPlayer();
			}
            SoundManager.Instance.PlaySoundBySoundType(SoundType.GEM_COLLECT);
            CreateCollectedEffect();
			Destroy(gameObject);
			#region Local_Function
			void CreateCollectedEffect() {
                var collectedEffect = collectableEffects.CreateCollectedEffect();
                collectedEffect.transform.position = transform.position;
            }
			void AddGemToPlayer() {
				GameManager.CurrencyManager.Instance.ModifyGemValue(gemCount);
			}
			#endregion
		}
internal void Collect ( ) { OnCollectedEvent ( ) ; if ( givesGem ) { AddGemToPlayer ( ) ; } SoundManager . Instance . PlaySoundBySoundType ( SoundType . GEM_COLLECT ) ; CreateCollectedEffect ( ) ; Destroy ( gameObject ) ; region  Local_Function void CreateCollectedEffect ( ) { var collectedEffect = collectableEffects . CreateCollectedEffect ( ) ; collectedEffect . transform . position = transform . position ; } void AddGemToPlayer ( ) { GameManager . CurrencyManager . Instance . ModifyGemValue ( gemCount ) ; } endregion }
Called by the player's paddle to collect this collectable.
Called by the player ' s paddle to collect this collectable .