//Custom structure for Sample 3.
//Can also be converted to a class if more flexibility is required
public struct PlayerInfo
{
    public string playerName;
    public int playerScore;
}

public class Tuples : MonoBehaviour
{
    [SerializeField] string athleteName;
    [SerializeField] int athleteScore;
   
    private void Start()
    {
        //Sample 1.
        (string name1, int score1) = GetPlayerInfo();
        Debug.Log($"Player: {name1}, Score {score1}");

        //Sample 2.
        GrabPlayerInfo(out string name2, out int score2);
        Debug.Log($"Player: {name2}, Score {score2}");

        //Sample 3.
        PlayerInfo playerInfo = RetrievePlayerInfo();
        Debug.Log($"Player: {playerInfo.playerName}, Score: {playerInfo.playerScore}");
    }

    //Sample 1. method
    private (string, int) GetPlayerInfo()
    {
        string playerName = athleteName;
        int playerScore = athleteScore;
        return (playerName, playerScore);
    }

    //Sample 2. method
    private void GrabPlayerInfo(out string playerName, out int playerScore)
    {
        playerName = athleteName;
        playerScore = athleteScore;
    }

    //Sample 3. method
    private PlayerInfo RetrievePlayerInfo()
    {
        PlayerInfo player = new()
        {
            playerName = athleteName,
            playerScore = athleteScore
        };
        return player;
    }
}