TTTTest.cs 1017 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEngine;
  2. using System.Net.NetworkInformation;
  3. namespace ToneTuneToolkit
  4. {
  5. public class TTTTest : MonoBehaviour
  6. {
  7. private void Start()
  8. {
  9. // Debug.Log(SystemInfo.deviceUniqueIdentifier);
  10. NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); // Get全部网卡
  11. for (int i = 0; i < nis.Length; i++)
  12. {
  13. if (nis[i].NetworkInterfaceType.ToString() == "Ethernet") // Get以太网
  14. {
  15. Debug.Log(nis[i].GetPhysicalAddress().ToString()); // Mac地址确认
  16. }
  17. }
  18. }
  19. public void Red()
  20. {
  21. TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FF0000");
  22. }
  23. public void Yellow()
  24. {
  25. TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FFFF00");
  26. }
  27. }
  28. }