Beispiel #1
0
        /// <summary>
        /// Manage the toggling of collectible states in response to the player collecting them
        /// </summary>
        /// <param name="obj">The object that was collected by the player</param>
        private IEnumerator DelayCollectibleRespawn_CR(CollectibleObject obj)
        {
            obj.gameObject.SetActive(false);
            yield return(new WaitForSeconds(collectibleRespawnTime));

            obj.gameObject.SetActive(true);
        }
Beispiel #2
0
        /// <summary>
        /// Handle the updating of the displayed score based on the collected objects
        /// </summary>
        /// <param name="obj">The object that was collected by the player</param>
        /// <param name="score">The value of the collectible at the time of collection</param>
        public void UpdateDisplayScore(CollectibleObject obj, int score)
        {
            //Increment the score value
            this.score += score;

            //Update the display label
            scoreDisplay.text = string.Format(scoreFormatting, this.score);
        }
Beispiel #3
0
 /// <summary>
 /// Start the process of 'respawning' a collectible object
 /// </summary>
 /// <param name="obj">The object that was collected by the player</param>
 /// <param name="score">The score of the collectible when it was collected</param>
 public void CollectedCollectible(CollectibleObject obj, int score)
 {
     StartCoroutine(DelayCollectibleRespawn_CR(obj));
 }