Hi how can i detect in unity the MAC adress of an Apple Mac?
in windows i used this one :
using UnityEngine;
using System.Collections;
using System.Net.NetworkInformation;
using System;
public class NetworkInfo {
public static string PhysicalAddress = "";
public static void DisplayTypeAndAddress()
{
//IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
Debug.Log(nics.Length + " nics");
//Debug.Log("Interface information for "+computerProperties.HostName+"."+computerProperties.DomainName);
PhysicalAddress = nics[0].GetPhysicalAddress().ToString();
Debug.Log(PhysicalAddress);
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
/* Debug.Log(adapter.Description);
Debug.Log(String.Empty.PadLeft(adapter.Description.Length, '='));
Debug.Log(" Interface type .......................... : " + adapter.NetworkInterfaceType);
Debug.Log(" Physical Address ........................ : " + adapter.GetPhysicalAddress().ToString());
Debug.Log(" Is receive only.......................... : " + adapter.IsReceiveOnly);
Debug.Log(" Multicast................................ : " + adapter.SupportsMulticast);*/
}
}
}
Are there any alternatives and solutions?