private void OnHitPlayer(CoinObstacle obj)
        {
            if (obj == null)
            {
                return;
            }

            // remove the coin from the list of coins to move towards palyer if hit
            _coinsToDrawIn.Remove(obj.transform);
        }
예제 #2
0
        /// <summary>
        ///     Called when the player collects a coin during the run
        /// </summary>
        /// <param name="obj"></param>
        private void OnCoinObstacleHitPlayer(CoinObstacle obj)
        {
            if (obj == null)
            {
                return;
            }

            // increase coins this run by value of the coin
            _coinsCollectedThisRun += obj.Value;
            UpdateCoinsDuringRun?.Invoke(_coinsCollectedThisRun);
        }