using UnityEngine;
public struct Player
{
public string playerName;
public int playerScore;
public Vector3 playerPosition;
public Player(string name, int score, Vector3 position)
{
playerName = name;
playerScore = score;
playerPosition = position;
}
public void MovePlayer(Vector3 newPosition)
{
playerPosition = newPosition;
Debug.Log(playerName + " moved to " + newPosition);
}
}
void Start()
{
Player player1 = new Player("John", 0, Vector3.zero);
Player player2 = new Player("Jane", 0, Vector3.one);
Debug.Log(player1.playerName);
player2.MovePlayer(Vector3.forward);
}