/// <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; }
protected virtual void AwakePlayerInteraction() { // Get the player interaction. if (player) { playerInteraction = player.GetComponent <GoldPlayerInteraction>(); } else if (autoFindPlayer) { playerInteraction = FindObjectOfType <GoldPlayerInteraction>(); } }