I was just wondering, if Mono supported WindowsIdentity.GetCurrent().Name and if there is an equivalent for OSX as I want to set the current user as the player name in a string
When in doubt, try it and see :-) ...
using System.Security.Principal;
using UnityEngine;
public class WhoAmI : MonoBehaviour
{
void Awake()
{
WindowsIdentity wi = WindowsIdentity.GetCurrent();
Debug.Log("Identity = " + wi.Name);
}
}
Bingo, you're in luck!
Or if you just want the user name then use `System.Environment.UserName`.