예제 #1
0
        /// <summary>
        /// Sets the player and finds all required components.
        /// </summary>
        private void SetPlayer(GoldPlayerController player)
        {
#if !GOLD_PLAYER_DISABLE_INTERACTION
            // Only get the interaction if the previous set player isn't the new player.
            if (player != null && this.player != player)
            {
                playerInteraction = player.GetComponent <GoldPlayerInteraction>();
            }
#endif
            // Set the player.
            this.player = player;
        }
예제 #2
0
 protected virtual void AwakePlayerInteraction()
 {
     // Get the player interaction.
     if (player)
     {
         playerInteraction = player.GetComponent <GoldPlayerInteraction>();
     }
     else if (autoFindPlayer)
     {
         playerInteraction = FindObjectOfType <GoldPlayerInteraction>();
     }
 }