public virtual void OnTriggerEnter2D(Collider2D other) { IPowerUp playerCollectPowerUp = other.gameObject.GetComponent <Player>(); if (playerCollectPowerUp != null) { playerCollectPowerUp.PowerUpCollected(PowerUpIndex); ReturnPowerUp(); } }