Răsfoiți Sursa

内容更新

MirzkisD1Ex0 4 ani în urmă
părinte
comite
e7e7780353

+ 14 - 14
Assets/Scripts/TTTTest.cs

@@ -3,22 +3,22 @@ using System.Net.NetworkInformation;
 
 namespace ToneTuneToolkit
 {
-    public class TTTTest : MonoBehaviour
-    {
+  public class TTTTest : MonoBehaviour
+  {
 
-        private void Start()
-        {
-    Red();
-        }
+    private void Start()
+    {
+      Red();
+    }
 
-        public void Red()
-        {
-            TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FF0000");
-        }
+    public void Red()
+    {
+      TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FF0000");
+    }
 
-        public void Yellow()
-        {
-            TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FFFF00");
-        }
+    public void Yellow()
+    {
+      TTTUDPCommunicator.Instance.SendMessageOut("[Dev]REQ=SemanticLighting&Action=DimColor&Port=1&Begin=1&End=144&Color=#FFFF00");
     }
+  }
 }

+ 60 - 60
Assets/ToneTuneToolkit/Scripts/Camera/TTTCameraFocusObject.cs

@@ -2,71 +2,71 @@
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 鼠标控制物体环绕注视对象
-    /// 推荐挂在相机上
-    /// 需要相机为MainCameraTag
-    /// </summary>
-    public class TTTCameraFocusObject : MonoBehaviour
-    {
-        public GameObject FocusObject;
+  /// <summary>
+  /// OK
+  /// 鼠标控制物体环绕注视对象
+  /// 推荐挂在相机上
+  /// 需要相机为MainCameraTag
+  /// </summary>
+  public class TTTCameraFocusObject : MonoBehaviour
+  {
+    public GameObject FocusObject;
 
-        private Transform foTrCmpt;
+    private Transform foTrCmpt;
 
-        private void Start()
-        {
-            if (!FocusObject)
-            {
-                TTTTipTools.Notice(this.name + "组件缺失");
-                this.enabled = false;
-                return;
-            }
-            if (!Camera.main)
-            {
-                TTTTipTools.Notice(this.name + "相机缺失");
-                this.enabled = false;
-                return;
-            }
+    private void Start()
+    {
+      if (!FocusObject)
+      {
+        TTTTipTools.Notice(this.name + "组件缺失");
+        this.enabled = false;
+        return;
+      }
+      if (!Camera.main)
+      {
+        TTTTipTools.Notice(this.name + "相机缺失");
+        this.enabled = false;
+        return;
+      }
 
-            foTrCmpt = FocusObject.GetComponent<Transform>();
-        }
+      foTrCmpt = FocusObject.GetComponent<Transform>();
+    }
 
-        private void LateUpdate()
-        {
-            CameraRotate();
-            CameraZoom();
-        }
+    private void LateUpdate()
+    {
+      CameraRotate();
+      CameraZoom();
+    }
 
-        /// <summary>
-        /// 相机的旋转
-        /// </summary>
-        private void CameraRotate()
-        {
-            float mouseAxisX = Input.GetAxis("Mouse X");
-            float mouseAxisY = -Input.GetAxis("Mouse Y");
-            if (Input.GetKey(KeyCode.Mouse0)) // 左键
-            {
-                Camera.main.transform.RotateAround(foTrCmpt.position, Vector3.up, mouseAxisX * 5);
-                Camera.main.transform.RotateAround(foTrCmpt.position, Camera.main.transform.right, mouseAxisY * 5);
-            }
-            return;
-        }
+    /// <summary>
+    /// 相机的旋转
+    /// </summary>
+    private void CameraRotate()
+    {
+      float mouseAxisX = Input.GetAxis("Mouse X");
+      float mouseAxisY = -Input.GetAxis("Mouse Y");
+      if (Input.GetKey(KeyCode.Mouse0)) // 左键
+      {
+        Camera.main.transform.RotateAround(foTrCmpt.position, Vector3.up, mouseAxisX * 5);
+        Camera.main.transform.RotateAround(foTrCmpt.position, Camera.main.transform.right, mouseAxisY * 5);
+      }
+      return;
+    }
 
-        /// <summary>
-        /// 相机的缩放
-        /// </summary>
-        private void CameraZoom()
-        {
-            if (Input.GetAxis("Mouse ScrollWheel") > 0)
-            {
-                Camera.main.transform.Translate(Vector3.forward * 0.1f);
-            }
-            if (Input.GetAxis("Mouse ScrollWheel") < 0)
-            {
-                Camera.main.transform.Translate(Vector3.forward * -0.1f);
-            }
-            return;
-        }
+    /// <summary>
+    /// 相机的缩放
+    /// </summary>
+    private void CameraZoom()
+    {
+      if (Input.GetAxis("Mouse ScrollWheel") > 0)
+      {
+        Camera.main.transform.Translate(Vector3.forward * 0.1f);
+      }
+      if (Input.GetAxis("Mouse ScrollWheel") < 0)
+      {
+        Camera.main.transform.Translate(Vector3.forward * -0.1f);
+      }
+      return;
     }
+  }
 }

+ 52 - 52
Assets/ToneTuneToolkit/Scripts/Camera/TTTCameraLookAround.cs

@@ -2,63 +2,63 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 鼠标拖动控制相机旋转
-    /// 推荐挂在相机上
-    /// 需要设置MainCameraTag
-    /// 如果是为了实现全景效果,建议减少球模型的面数,此外还需要在建模软件内将模型的法线翻转至球的内侧
-    /// </summary>
-    public class TTTCameraLookAround : MonoBehaviour
-    {
-        public float speed = 1000; // 旋转速度
-
-        private float xValue;
-        private float yValue;
-        private Vector3 rotationValue = Vector3.zero;
+  /// <summary>
+  /// OK
+  /// 鼠标拖动控制相机旋转
+  /// 推荐挂在相机上
+  /// 需要设置MainCameraTag
+  /// 如果是为了实现全景效果,建议减少球模型的面数,此外还需要在建模软件内将模型的法线翻转至球的内侧
+  /// </summary>
+  public class TTTCameraLookAround : MonoBehaviour
+  {
+    public float speed = 1000; // 旋转速度
 
-        private void Start()
-        {
-            if (!Camera.main)
-            {
-                TTTTipTools.Notice(this.name + "相机缺失");
-                this.enabled = false;
-                return;
-            }
-        }
+    private float xValue;
+    private float yValue;
+    private Vector3 rotationValue = Vector3.zero;
 
-        private void Update()
-        {
-            xValue = Input.GetAxis("Mouse X");
-            yValue = Input.GetAxis("Mouse Y");
+    private void Start()
+    {
+      if (!Camera.main)
+      {
+        TTTTipTools.Notice(this.name + "相机缺失");
+        this.enabled = false;
+        return;
+      }
+    }
 
-            if (Input.GetMouseButton(0)) // 按住鼠标左键
-            {
-                if (xValue != 0 || yValue != 0) // 并且鼠标移动
-                {
-                    RotateView(xValue, yValue);
-                }
-            }
-        }
+    private void Update()
+    {
+      xValue = Input.GetAxis("Mouse X");
+      yValue = Input.GetAxis("Mouse Y");
 
-        /// <summary>
-        /// 视角滚动
-        /// </summary>
-        /// <param name="x"></param>
-        /// <param name="y"></param>
-        private void RotateView(float x, float y)
+      if (Input.GetMouseButton(0)) // 按住鼠标左键
+      {
+        if (xValue != 0 || yValue != 0) // 并且鼠标移动
         {
-            rotationValue.x += y * Time.deltaTime * speed;
-            rotationValue.y += -x * Time.deltaTime * speed;
-            if (rotationValue.x > 90) // 矫正
-            {
-                rotationValue.x = 90;
-            }
-            else if (rotationValue.x < -90)
-            {
-                rotationValue.x = -90;
-            }
-            transform.rotation = Quaternion.Euler(rotationValue);
+          RotateView(xValue, yValue);
         }
+      }
+    }
+
+    /// <summary>
+    /// 视角滚动
+    /// </summary>
+    /// <param name="x"></param>
+    /// <param name="y"></param>
+    private void RotateView(float x, float y)
+    {
+      rotationValue.x += y * Time.deltaTime * speed;
+      rotationValue.y += -x * Time.deltaTime * speed;
+      if (rotationValue.x > 90) // 矫正
+      {
+        rotationValue.x = 90;
+      }
+      else if (rotationValue.x < -90)
+      {
+        rotationValue.x = -90;
+      }
+      transform.rotation = Quaternion.Euler(rotationValue);
     }
+  }
 }

+ 61 - 61
Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStart.cs

@@ -5,75 +5,75 @@ using System.Threading;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 设备冷启动
-    /// </summary>
-    public class TTTColdStart : MonoBehaviour
-    {
-        public static TTTColdStart Instance;
+  /// <summary>
+  /// OK
+  /// 设备冷启动
+  /// </summary>
+  public class TTTColdStart : MonoBehaviour
+  {
+    public static TTTColdStart Instance;
 
-        private static string targetMAC;
-        private static string targetIP;
-        private static string targetMask;
-        private static string targetPort;
+    private static string targetMAC;
+    private static string targetIP;
+    private static string targetMask;
+    private static string targetPort;
 
-        private void Awake()
-        {
-            Instance = this;
-        }
+    private void Awake()
+    {
+      Instance = this;
+    }
 
-        private void Start()
-        {
-            LoadConfig();
-        }
+    private void Start()
+    {
+      LoadConfig();
+    }
 
-        private void LoadConfig()
-        {
-            targetMAC = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetMACName);
-            targetIP = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetIPName);
-            targetMask = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetMaskName);
-            targetPort = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetPortName);
-            return;
-        }
+    private void LoadConfig()
+    {
+      targetMAC = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetMACName);
+      targetIP = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetIPName);
+      targetMask = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetMaskName);
+      targetPort = TTTTextLoader.GetJson(TTTColdStartHandler.WOLConfigPath, TTTColdStartHandler.TargetPortName);
+      return;
+    }
 
-        /// <summary>
-        /// 冷启动
-        /// </summary>
-        /// <param name="mac"></param>
-        /// <param name="ip"></param>
-        /// <param name="mask"></param>
-        /// <param name="port"></param>
-        private void ColdStartDevice(string mac, string ip, string mask, string port = "7")
-        {
-            string command = (TTTColdStartHandler.WOLAppPath + "wolcmd " + mac + " " + ip + " " + mask + " " + port).Replace(@"/", @"\");
+    /// <summary>
+    /// 冷启动
+    /// </summary>
+    /// <param name="mac"></param>
+    /// <param name="ip"></param>
+    /// <param name="mask"></param>
+    /// <param name="port"></param>
+    private void ColdStartDevice(string mac, string ip, string mask, string port = "7")
+    {
+      string command = (TTTColdStartHandler.WOLAppPath + "wolcmd " + mac + " " + ip + " " + mask + " " + port).Replace(@"/", @"\");
 
-            Process p = new Process();
-            ProcessStartInfo psi = new ProcessStartInfo();
-            psi.FileName = "cmd.exe";
-            psi.UseShellExecute = false;
-            psi.RedirectStandardError = true;
-            psi.RedirectStandardInput = true;
-            psi.RedirectStandardOutput = true;
-            psi.CreateNoWindow = true;
+      Process p = new Process();
+      ProcessStartInfo psi = new ProcessStartInfo();
+      psi.FileName = "cmd.exe";
+      psi.UseShellExecute = false;
+      psi.RedirectStandardError = true;
+      psi.RedirectStandardInput = true;
+      psi.RedirectStandardOutput = true;
+      psi.CreateNoWindow = true;
 
-            p.StartInfo = psi;
-            p.Start();
+      p.StartInfo = psi;
+      p.Start();
 
-            p.StandardInput.WriteLine(command);
-            p.StandardInput.AutoFlush = true;
-            p.StartInfo.StandardErrorEncoding = Encoding.UTF8;
-            p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
-            return;
-        }
+      p.StandardInput.WriteLine(command);
+      p.StandardInput.AutoFlush = true;
+      p.StartInfo.StandardErrorEncoding = Encoding.UTF8;
+      p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
+      return;
+    }
 
-        /// <summary>
-        /// 偷懒方法
-        /// </summary>
-        public void WakeOnLan()
-        {
-            ColdStartDevice(targetMAC, targetIP, targetMask, targetPort);
-            return;
-        }
+    /// <summary>
+    /// 偷懒方法
+    /// </summary>
+    public void WakeOnLan()
+    {
+      ColdStartDevice(targetMAC, targetIP, targetMask, targetPort);
+      return;
     }
+  }
 }

+ 22 - 22
Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStartHandler.cs

@@ -2,29 +2,29 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// 开机小助手
-    /// </summary>
-    [RequireComponent(typeof(TTTManager))]
-    [RequireComponent(typeof(TTTColdStart))]
-    public class TTTColdStartHandler : MonoBehaviour
-    {
-        #region Paths
-        public static string WOLAppPath = TTTManager.AdditionalToolsPath + "WolCmd/";
-        public static string WOLConfigPath = TTTManager.ConfigsPath + "wolconfig.json";
-        #endregion
+  /// <summary>
+  /// 开机小助手
+  /// </summary>
+  [RequireComponent(typeof(TTTManager))]
+  [RequireComponent(typeof(TTTColdStart))]
+  public class TTTColdStartHandler : MonoBehaviour
+  {
+    #region Paths
+    public static string WOLAppPath = TTTManager.AdditionalToolsPath + "WolCmd/";
+    public static string WOLConfigPath = TTTManager.ConfigsPath + "wolconfig.json";
+    #endregion
 
-        #region KeyNames
-        public static string TargetMACName = "Target MAC";
-        public static string TargetIPName = "Target IP";
-        public static string TargetMaskName = "Target Mask";
-        public static string TargetPortName = "Target Port";
-        #endregion
+    #region KeyNames
+    public static string TargetMACName = "Target MAC";
+    public static string TargetIPName = "Target IP";
+    public static string TargetMaskName = "Target Mask";
+    public static string TargetPortName = "Target Port";
+    #endregion
 
-        private void Awake()
-        {
-            TTTManager.FolderIntegrityCheck(WOLAppPath);
-            TTTManager.FileIntegrityCheck(WOLConfigPath);
-        }
+    private void Awake()
+    {
+      TTTManager.FolderIntegrityCheck(WOLAppPath);
+      TTTManager.FileIntegrityCheck(WOLConfigPath);
     }
+  }
 }

+ 51 - 51
Assets/ToneTuneToolkit/Scripts/Common/TTTManager.cs

@@ -3,60 +3,60 @@ using System.IO;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// MANAGER!
-    /// </summary>
-    [RequireComponent(typeof(TTTTipTools))]
-    [RequireComponent(typeof(TextReader))]
-    public class TTTManager : MonoBehaviour
-    {
-        #region Paths
-        private static string MainPath = Application.streamingAssetsPath + "/ToneTuneToolkit/";
-        public static string ConfigsPath = MainPath + "configs/";
-        public static string DataPath = MainPath + "data/";
-        public static string AdditionalToolsPath = MainPath + "additionaltools/";
-        #endregion
+  /// <summary>
+  /// OK
+  /// MANAGER!
+  /// </summary>
+  [RequireComponent(typeof(TTTTipTools))]
+  [RequireComponent(typeof(TextReader))]
+  public class TTTManager : MonoBehaviour
+  {
+    #region Paths
+    private static string MainPath = Application.streamingAssetsPath + "/ToneTuneToolkit/";
+    public static string ConfigsPath = MainPath + "configs/";
+    public static string DataPath = MainPath + "data/";
+    public static string AdditionalToolsPath = MainPath + "additionaltools/";
+    #endregion
 
-        private void Awake()
-        {
-            DontDestroyOnLoad(gameObject);
+    private void Awake()
+    {
+      DontDestroyOnLoad(gameObject);
 
-            FolderIntegrityCheck(MainPath);
-            FolderIntegrityCheck(ConfigsPath);
-            FolderIntegrityCheck(DataPath);
-            FolderIntegrityCheck(AdditionalToolsPath);
-        }
+      FolderIntegrityCheck(MainPath);
+      FolderIntegrityCheck(ConfigsPath);
+      FolderIntegrityCheck(DataPath);
+      FolderIntegrityCheck(AdditionalToolsPath);
+    }
 
-        /// <summary>
-        /// 文件夹完整性检查
-        /// </summary>
-        /// <param name="url"></param>
-        public static bool FolderIntegrityCheck(string url)
-        {
-            if (File.Exists(url))
-            {
-                return true;
-            }
-            Directory.CreateDirectory(url);
-            return false;
-        }
+    /// <summary>
+    /// 文件夹完整性检查
+    /// </summary>
+    /// <param name="url"></param>
+    public static bool FolderIntegrityCheck(string url)
+    {
+      if (File.Exists(url))
+      {
+        return true;
+      }
+      Directory.CreateDirectory(url);
+      return false;
+    }
 
-        /// <summary>
-        /// 文件完整性检查
-        /// </summary>
-        /// <param name="url"></param>
-        public static bool FileIntegrityCheck(string url)
-        {
-            if (File.Exists(url))
-            {
-                return true;
-            }
-            FileInfo fi = new FileInfo(url);
-            StreamWriter sw = fi.CreateText();
-            sw.Close();
-            sw.Dispose();
-            return false;
-        }
+    /// <summary>
+    /// 文件完整性检查
+    /// </summary>
+    /// <param name="url"></param>
+    public static bool FileIntegrityCheck(string url)
+    {
+      if (File.Exists(url))
+      {
+        return true;
+      }
+      FileInfo fi = new FileInfo(url);
+      StreamWriter sw = fi.CreateText();
+      sw.Close();
+      sw.Dispose();
+      return false;
     }
+  }
 }

+ 49 - 49
Assets/ToneTuneToolkit/Scripts/Common/TTTTextLoader.cs

@@ -5,58 +5,58 @@ using Newtonsoft.Json;
 
 namespace ToneTuneToolkit
 {
+  /// <summary>
+  /// OK
+  /// 文字加载工具
+  /// 后续会增加覆写功能
+  /// Get
+  /// </summary>
+  public class TTTTextLoader : MonoBehaviour
+  {
     /// <summary>
-    /// OK
-    /// 文字加载工具
-    /// 后续会增加覆写功能
-    /// Get
+    /// 读取文本内容
     /// </summary>
-    public class TTTTextLoader : MonoBehaviour
+    /// <param name="url">文件路径</param>
+    /// <param name="line">要读取的文件行数</param>
+    /// <returns></returns>
+    public static string GetText(string url, int line)
     {
-        /// <summary>
-        /// 读取文本内容
-        /// </summary>
-        /// <param name="url">文件路径</param>
-        /// <param name="line">要读取的文件行数</param>
-        /// <returns></returns>
-        public static string GetText(string url, int line)
-        {
-            if (!File.Exists(url))
-            {
-                TTTTipTools.Notice("<" + url + ">不存在");
-                return null;
-            }
-            string[] tempStringArray = File.ReadAllLines(url);
-            if (line > 0)
-            {
-                return tempStringArray[line].Split('=')[1]; // 等号分隔 // 读取第二部分
-            }
-            else
-            {
-                return null;
-            }
-        }
+      if (!File.Exists(url))
+      {
+        TTTTipTools.Notice("<" + url + ">不存在");
+        return null;
+      }
+      string[] tempStringArray = File.ReadAllLines(url);
+      if (line > 0)
+      {
+        return tempStringArray[line].Split('=')[1]; // 等号分隔 // 读取第二部分
+      }
+      else
+      {
+        return null;
+      }
+    }
 
-        /// <summary>
-        /// 配置文件获取器
-        /// json被读取时必须被序列化过
-        /// </summary>
-        /// <param name="fileName">路径</param>
-        /// <param name="keyName">字段名</param>
-        public static string GetJson(string url, string keyName)
-        {
-            if (!File.Exists(url))
-            {
-                TTTTipTools.Notice("<" + url + ">不存在");
-                return null;
-            }
-            string json = File.ReadAllText(url);
-            Dictionary<string, string> keys = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
-            if (!keys.ContainsKey(keyName))
-            {
-                return null;
-            }
-            return keys[keyName];
-        }
+    /// <summary>
+    /// 配置文件获取器
+    /// json被读取时必须被序列化过
+    /// </summary>
+    /// <param name="fileName">路径</param>
+    /// <param name="keyName">字段名</param>
+    public static string GetJson(string url, string keyName)
+    {
+      if (!File.Exists(url))
+      {
+        TTTTipTools.Notice("<" + url + ">不存在");
+        return null;
+      }
+      string json = File.ReadAllText(url);
+      Dictionary<string, string> keys = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
+      if (!keys.ContainsKey(keyName))
+      {
+        return null;
+      }
+      return keys[keyName];
     }
+  }
 }

+ 30 - 30
Assets/ToneTuneToolkit/Scripts/Common/TTTTipTools.cs

@@ -2,40 +2,40 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
+  /// <summary>
+  /// OK
+  /// TTT专属提示
+  /// </summary>
+  public class TTTTipTools : MonoBehaviour
+  {
     /// <summary>
-    /// OK
-    /// TTT专属提示
+    /// 提示
     /// </summary>
-    public class TTTTipTools : MonoBehaviour
+    /// <param name="text"></param>
+    public static void Notice(string text)
     {
-        /// <summary>
-        /// 提示
-        /// </summary>
-        /// <param name="text"></param>
-        public static void Notice(string text)
-        {
-            Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.white) + ">[TTT Notice] -> </color>" + text);
-            return;
-        }
+      Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.white) + ">[TTT Notice] -> </color>" + text);
+      return;
+    }
 
-        /// <summary>
-        /// 警告
-        /// </summary>
-        /// <param name="text"></param>
-        public static void Warning(string text)
-        {
-            Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.yellow) + ">[TTT Notice] -> </color>" + text);
-            return;
-        }
+    /// <summary>
+    /// 警告
+    /// </summary>
+    /// <param name="text"></param>
+    public static void Warning(string text)
+    {
+      Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.yellow) + ">[TTT Notice] -> </color>" + text);
+      return;
+    }
 
-        /// <summary>
-        /// 错误
-        /// </summary>
-        /// <param name="text"></param>
-        public static void Error(string text)
-        {
-            Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">[TTT Notice] -> </color>" + text);
-            return;
-        }
+    /// <summary>
+    /// 错误
+    /// </summary>
+    /// <param name="text"></param>
+    public static void Error(string text)
+    {
+      Debug.Log(@"<color=#" + ColorUtility.ToHtmlStringRGB(Color.red) + ">[TTT Notice] -> </color>" + text);
+      return;
     }
+  }
 }

+ 32 - 32
Assets/ToneTuneToolkit/Scripts/Object/TTTObjectDrag.cs

@@ -3,39 +3,39 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 对象拖拽
-    /// 挂在需要拖拽的对象上
-    /// 需要相机为MainCameraTag
-    /// 需要碰撞器
-    /// </summary>
-    public class TTTObjectDrag : MonoBehaviour
-    {
-        private Vector3 screenPosition;
-        private Vector3 offset;
-        private Vector3 currentScreenPosition;
+  /// <summary>
+  /// OK
+  /// 对象拖拽
+  /// 挂在需要拖拽的对象上
+  /// 需要相机为MainCameraTag
+  /// 需要碰撞器
+  /// </summary>
+  public class TTTObjectDrag : MonoBehaviour
+  {
+    private Vector3 screenPosition;
+    private Vector3 offset;
+    private Vector3 currentScreenPosition;
 
-        private void Start()
-        {
-            if (!Camera.main)
-            {
-                TTTTipTools.Notice(this.name + "相机缺失");
-                this.enabled = false;
-                return;
-            }
-        }
+    private void Start()
+    {
+      if (!Camera.main)
+      {
+        TTTTipTools.Notice(this.name + "相机缺失");
+        this.enabled = false;
+        return;
+      }
+    }
 
-        private IEnumerator OnMouseDown()
-        {
-            screenPosition = Camera.main.WorldToScreenPoint(gameObject.transform.position);
-            offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z));
-            while (Input.GetMouseButton(0) || Input.GetMouseButton(1))
-            {
-                currentScreenPosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z);
-                gameObject.transform.position = Camera.main.ScreenToWorldPoint(currentScreenPosition) + offset;
-                yield return new WaitForFixedUpdate();
-            }
-        }
+    private IEnumerator OnMouseDown()
+    {
+      screenPosition = Camera.main.WorldToScreenPoint(gameObject.transform.position);
+      offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z));
+      while (Input.GetMouseButton(0) || Input.GetMouseButton(1))
+      {
+        currentScreenPosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z);
+        gameObject.transform.position = Camera.main.ScreenToWorldPoint(currentScreenPosition) + offset;
+        yield return new WaitForFixedUpdate();
+      }
     }
+  }
 }

+ 21 - 21
Assets/ToneTuneToolkit/Scripts/Object/TTTObjectFloating.cs

@@ -2,29 +2,29 @@
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 物体上下漂浮功能
-    /// 挂在对象上
-    /// </summary>
-    public class TTTObjectFloating : MonoBehaviour
-    {
-        public float PerRadian = 2f; // 每次变化的弧度 // 速度
-        public float Radius = 0.2f; // 半径 // 幅度
+  /// <summary>
+  /// OK
+  /// 物体上下漂浮功能
+  /// 挂在对象上
+  /// </summary>
+  public class TTTObjectFloating : MonoBehaviour
+  {
+    public float PerRadian = 2f; // 每次变化的弧度 // 速度
+    public float Radius = 0.2f; // 半径 // 幅度
 
-        private float radian = 0; // 弧度
-        private Vector3 oldPos; // 开始时候的坐标
+    private float radian = 0; // 弧度
+    private Vector3 oldPos; // 开始时候的坐标
 
-        private void Start()
-        {
-            oldPos = transform.position; // 将最初的位置保存到oldPos
-        }
+    private void Start()
+    {
+      oldPos = transform.position; // 将最初的位置保存到oldPos
+    }
 
-        private void Update()
-        {
-            radian += PerRadian / 100f; // 弧度每次加
-            float temporaryValue = Mathf.Cos(radian) * Radius; // dy定义的是针对y轴的变量,也可以使用sin,找到一个适合的值就可以
-            transform.position = oldPos + new Vector3(0, temporaryValue, 0);
-        }
+    private void Update()
+    {
+      radian += PerRadian / 100f; // 弧度每次加
+      float temporaryValue = Mathf.Cos(radian) * Radius; // dy定义的是针对y轴的变量,也可以使用sin,找到一个适合的值就可以
+      transform.position = oldPos + new Vector3(0, temporaryValue, 0);
     }
+  }
 }

+ 44 - 44
Assets/ToneTuneToolkit/Scripts/Object/TTTTextFlick.cs

@@ -3,56 +3,56 @@ using UnityEngine.UI;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 文字闪烁
-    /// 挂在对象上
-    /// </summary>
-    public class TTTTextFlick : MonoBehaviour
-    {
-        public float minAlpha = 102f; // 最小透明度
-        public float maxAlpha = 255f; // 最大透明度
-        public float speed = 15f; // 速度
+  /// <summary>
+  /// OK
+  /// 文字闪烁
+  /// 挂在对象上
+  /// </summary>
+  public class TTTTextFlick : MonoBehaviour
+  {
+    public float minAlpha = 102f; // 最小透明度
+    public float maxAlpha = 255f; // 最大透明度
+    public float speed = 15f; // 速度
 
-        private float floatingValue = 0;
-        private bool isFull = false;
-        private Color newColor;
-        private Text tCmpt;
+    private float floatingValue = 0;
+    private bool isFull = false;
+    private Color newColor;
+    private Text tCmpt;
 
-        private void Start()
-        {
-            tCmpt = GetComponent<Text>();
-            newColor = tCmpt.color;
-        }
+    private void Start()
+    {
+      tCmpt = GetComponent<Text>();
+      newColor = tCmpt.color;
+    }
 
-        private void Update()
+    private void Update()
+    {
+      TextAlphaFlick();
+    }
+
+    /// <summary>
+    /// 文字透明度浮动
+    /// </summary>
+    private void TextAlphaFlick()
+    {
+      if (floatingValue < maxAlpha && !isFull)
+      {
+        floatingValue += Time.deltaTime * 10 * speed;
+        if (floatingValue >= maxAlpha)
         {
-            TextAlphaFlick();
+          isFull = true;
         }
-
-        /// <summary>
-        /// 文字透明度浮动
-        /// </summary>
-        private void TextAlphaFlick()
+      }
+      else if (floatingValue > minAlpha && isFull)
+      {
+        floatingValue -= Time.deltaTime * 10 * speed;
+        if (floatingValue <= minAlpha)
         {
-            if (floatingValue < maxAlpha && !isFull)
-            {
-                floatingValue += Time.deltaTime * 10 * speed;
-                if (floatingValue >= maxAlpha)
-                {
-                    isFull = true;
-                }
-            }
-            else if (floatingValue > minAlpha && isFull)
-            {
-                floatingValue -= Time.deltaTime * 10 * speed;
-                if (floatingValue <= minAlpha)
-                {
-                    isFull = false;
-                }
-            }
-            newColor.a = floatingValue / 255;
-            tCmpt.color = newColor;
+          isFull = false;
         }
+      }
+      newColor.a = floatingValue / 255;
+      tCmpt.color = newColor;
     }
+  }
 }

+ 33 - 33
Assets/ToneTuneToolkit/Scripts/Object/TTTTraverseObejctChangeColor.cs

@@ -3,45 +3,45 @@ using UnityEngine.UI;
 
 namespace ToneTuneToolkit
 {
+  /// <summary>
+  /// OK
+  /// 改变对象及所有子对象的颜色
+  /// 材质、图片、Raw图片
+  /// </summary>
+  public class TTTTraverseObejctChangeColor : MonoBehaviour
+  {
+    public Color PresettingColor = Color.white;
+
+    private void Start()
+    {
+      ChildsColorGiving();
+    }
+
     /// <summary>
-    /// OK
-    /// 改变对象及所有子对象的颜色
-    /// 材质、图片、Raw图片
+    /// 改变三种子对象包括自己的颜色
     /// </summary>
-    public class TTTTraverseObejctChangeColor : MonoBehaviour
+    private void ChildsColorGiving()
     {
-        public Color PresettingColor = Color.white;
-
-        private void Start()
+      Transform[] allChildren = gameObject.GetComponentsInChildren<Transform>();
+      foreach (Transform child in allChildren)
+      {
+        if (child.GetComponent<MeshRenderer>())
         {
-            ChildsColorGiving();
+          child.GetComponent<MeshRenderer>().material.color = PresettingColor;
+          continue;
         }
-
-        /// <summary>
-        /// 改变三种子对象包括自己的颜色
-        /// </summary>
-        private void ChildsColorGiving()
+        if (child.GetComponent<Image>())
+        {
+          child.GetComponent<Image>().color = PresettingColor;
+          continue;
+        }
+        if (child.GetComponent<RawImage>())
         {
-            Transform[] allChildren = gameObject.GetComponentsInChildren<Transform>();
-            foreach (Transform child in allChildren)
-            {
-                if (child.GetComponent<MeshRenderer>())
-                {
-                    child.GetComponent<MeshRenderer>().material.color = PresettingColor;
-                    continue;
-                }
-                if (child.GetComponent<Image>())
-                {
-                    child.GetComponent<Image>().color = PresettingColor;
-                    continue;
-                }
-                if (child.GetComponent<RawImage>())
-                {
-                    child.GetComponent<RawImage>().color = PresettingColor;
-                    continue;
-                }
-            }
-            return;
+          child.GetComponent<RawImage>().color = PresettingColor;
+          continue;
         }
+      }
+      return;
     }
+  }
 }

+ 51 - 51
Assets/ToneTuneToolkit/Scripts/Other/TTTAsyncLoadingWithProcessBar.cs

@@ -5,63 +5,63 @@ using UnityEngine.SceneManagement;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 带进度条的异步场景加载
-    /// 需要Slider和Text对象
-    /// SceneLoading.Instance.LoadingScene(01);
-    /// </summary>
-    public class TTTAsyncLoadingWithProcessBar : MonoBehaviour
-    {
-        public static TTTAsyncLoadingWithProcessBar Instance; // 懒人单例
+  /// <summary>
+  /// OK
+  /// 带进度条的异步场景加载
+  /// 需要Slider和Text对象
+  /// SceneLoading.Instance.LoadingScene(01);
+  /// </summary>
+  public class TTTAsyncLoadingWithProcessBar : MonoBehaviour
+  {
+    public static TTTAsyncLoadingWithProcessBar Instance; // 懒人单例
 
 
 
-        public Slider LoadingSlider;
-        public Text LoadingText;
+    public Slider LoadingSlider;
+    public Text LoadingText;
 
-        private void Awake()
-        {
-            Instance = this;
-        }
+    private void Awake()
+    {
+      Instance = this;
+    }
 
-        private void Start()
-        {
-            if (!LoadingSlider || !LoadingText)
-            {
-                TTTTipTools.Notice(this.name + "组件缺失");
-                this.enabled = false;
-                return;
-            }
-        }
+    private void Start()
+    {
+      if (!LoadingSlider || !LoadingText)
+      {
+        TTTTipTools.Notice(this.name + "组件缺失");
+        this.enabled = false;
+        return;
+      }
+    }
 
-        /// <summary>
-        /// 对外接口
-        /// </summary>
-        /// <param name="sceneIndex"></param>
-        public void LoadingScene(int sceneIndex)
-        {
-            StartCoroutine(LoadingProcess(sceneIndex));
-        }
+    /// <summary>
+    /// 对外接口
+    /// </summary>
+    /// <param name="sceneIndex"></param>
+    public void LoadingScene(int sceneIndex)
+    {
+      StartCoroutine(LoadingProcess(sceneIndex));
+    }
 
-        /// <summary>
-        /// 异步加载场景
-        /// </summary>
-        /// <param name="sceneIndex"></param>
-        /// <returns></returns>
-        private IEnumerator LoadingProcess(int sceneIndex)
-        {
-            float index = 0;
-            AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneIndex);
-            asyncOperation.allowSceneActivation = false;
-            while (index <= 100)
-            {
-                index++;
-                LoadingSlider.value = index / 100;
-                yield return new WaitForEndOfFrame();
-                LoadingText.text = index.ToString() + "%";
-            }
-            asyncOperation.allowSceneActivation = true; // false会卡住最后10%的进度
-        }
+    /// <summary>
+    /// 异步加载场景
+    /// </summary>
+    /// <param name="sceneIndex"></param>
+    /// <returns></returns>
+    private IEnumerator LoadingProcess(int sceneIndex)
+    {
+      float index = 0;
+      AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneIndex);
+      asyncOperation.allowSceneActivation = false;
+      while (index <= 100)
+      {
+        index++;
+        LoadingSlider.value = index / 100;
+        yield return new WaitForEndOfFrame();
+        LoadingText.text = index.ToString() + "%";
+      }
+      asyncOperation.allowSceneActivation = true; // false会卡住最后10%的进度
     }
+  }
 }

+ 156 - 156
Assets/ToneTuneToolkit/Scripts/UDP/TTTUDPCommunicator.cs

@@ -6,164 +6,164 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
+  /// <summary>
+  /// OK
+  /// 需要助手
+  /// UDP收发工具
+  /// 测试前务必关闭所有防火墙
+  /// 设备间需要ping通
+  /// </summary>
+  public class TTTUDPCommunicator : MonoBehaviour
+  {
+    public static TTTUDPCommunicator Instance;
+
+
+
+    #region Settings
+    private byte[] localIP = new byte[] { 0, 0, 0, 0 };
+    private int localPort = 0;
+    private byte[] targetIP = new byte[] { 0, 0, 0, 0 };
+    private int targetPort = 0;
+
+    private float detectSpacing = 1f; // 循环检测间隔
+    private Encoding ReciveMessageEncoding = Encoding.UTF8; // 接收消息字符编码
+    private Encoding SendMessageEncoding = Encoding.ASCII; // 发出消息字符编码
+    #endregion
+
+
+
+    #region Others
+    public static string UDPMessage; // 接受到的消息
+    private UdpClient udpClient; // UDP客户端
+    private Thread thread = null; // 单开线程
+    private IPEndPoint remoteAddress;
+    #endregion
+
+    private void Awake()
+    {
+      Instance = this;
+    }
+
+    private void Start()
+    {
+      LoadConfig();
+      Presetting();
+    }
+
+    private void OnDestroy()
+    {
+      SocketQuit();
+    }
+
+    private void OnApplicationQuit()
+    {
+      SocketQuit();
+    }
+
+    /// <summary>
+    /// 加载地址
+    /// </summary>
+    private void LoadConfig()
+    {
+      string[] localIPString = TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.LocalIPName).Split('.');
+      for (int i = 0; i < 4; i++)
+      {
+        localIP[i] = (byte)int.Parse(localIPString[i]);
+      }
+      localPort = int.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.LocalPortName));
+
+      string[] targetIPString = TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.TargetIPName).Split('.');
+      for (int i = 0; i < 4; i++)
+      {
+        targetIP[i] = (byte)int.Parse(targetIPString[i]);
+      }
+      targetPort = int.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.TargetPortName));
+      detectSpacing = float.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.DetectSpacingName));
+      return;
+    }
+
+    /// <summary>
+    /// 预设置
+    /// </summary>
+    private void Presetting()
+    {
+      remoteAddress = new IPEndPoint(IPAddress.Any, 0);
+      thread = new Thread(MessageReceive); // 单开线程接收消息
+      thread.Start();
+      InvokeRepeating("RepeatDetect", 0f, detectSpacing); // 每隔一段时间检测一次是否有消息传入
+      return;
+    }
+
+    /// <summary>
+    /// 重复检测
+    /// </summary>
+    private void RepeatDetect()
+    {
+      if (string.IsNullOrEmpty(UDPMessage)) // 如果消息为空
+      {
+        return;
+      }
+      TTTTipTools.Notice(UDPMessage);
+      UDPMessage = null; // 清空接收结果
+      return;
+    }
+
+    /// <summary>
+    /// 接收消息
+    /// </summary>
+    private void MessageReceive()
+    {
+      while (true)
+      {
+        udpClient = new UdpClient(localPort);
+        byte[] receiveData = udpClient.Receive(ref remoteAddress); // 接收数据
+        UDPMessage = ReciveMessageEncoding.GetString(receiveData);
+        udpClient.Close();
+      }
+    }
+
+    /// <summary>
+    /// 发送消息
+    /// </summary>
+    /// <param name="ip"></param>
+    /// <param name="sendMessage"></param>
+    public void MessageSend(byte[] ip, int port, string sendMessage)
+    {
+      if (sendMessage == null)
+      {
+        return;
+      }
+
+      IPAddress tempIPAddress = new IPAddress(ip);
+      IPEndPoint tempRemoteAddress = new IPEndPoint(tempIPAddress, port); // 实例化一个远程端点
+      byte[] sendData = SendMessageEncoding.GetBytes(sendMessage);
+      UdpClient client = new UdpClient(); // this.localPort + 1 // 端口不可复用 // 否则无法区分每条消息
+      client.Send(sendData, sendData.Length, tempRemoteAddress); // 将数据发送到远程端点
+      client.Close(); // 关闭连接
+      return;
+    }
+
+    /// <summary>
+    /// 退出套接字
+    /// </summary>
+    private void SocketQuit()
+    {
+      thread.Abort();
+      thread.Interrupt();
+      udpClient.Close();
+      return;
+    }
+
     /// <summary>
-    /// OK
-    /// 需要助手
-    /// UDP收发工具
-    /// 测试前务必关闭所有防火墙
-    /// 设备间需要ping通
+    /// 向固定地址和IP发消息
+    /// 偷懒方法
     /// </summary>
-    public class TTTUDPCommunicator : MonoBehaviour
+    /// <param name="message"></param>
+    public void SendMessageOut(string message)
     {
-        public static TTTUDPCommunicator Instance;
-
-
-
-        #region Settings
-        private byte[] localIP = new byte[] { 0, 0, 0, 0 };
-        private int localPort = 0;
-        private byte[] targetIP = new byte[] { 0, 0, 0, 0 };
-        private int targetPort = 0;
-
-        private float detectSpacing = 1f; // 循环检测间隔
-        private Encoding ReciveMessageEncoding = Encoding.UTF8; // 接收消息字符编码
-        private Encoding SendMessageEncoding = Encoding.ASCII; // 发出消息字符编码
-        #endregion
-
-
-
-        #region Others
-        public static string UDPMessage; // 接受到的消息
-        private UdpClient udpClient; // UDP客户端
-        private Thread thread = null; // 单开线程
-        private IPEndPoint remoteAddress;
-        #endregion
-
-        private void Awake()
-        {
-            Instance = this;
-        }
-
-        private void Start()
-        {
-            LoadConfig();
-            Presetting();
-        }
-
-        private void OnDestroy()
-        {
-            SocketQuit();
-        }
-
-        private void OnApplicationQuit()
-        {
-            SocketQuit();
-        }
-
-        /// <summary>
-        /// 加载地址
-        /// </summary>
-        private void LoadConfig()
-        {
-            string[] localIPString = TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.LocalIPName).Split('.');
-            for (int i = 0; i < 4; i++)
-            {
-                localIP[i] = (byte)int.Parse(localIPString[i]);
-            }
-            localPort = int.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.LocalPortName));
-
-            string[] targetIPString = TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.TargetIPName).Split('.');
-            for (int i = 0; i < 4; i++)
-            {
-                targetIP[i] = (byte)int.Parse(targetIPString[i]);
-            }
-            targetPort = int.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.TargetPortName));
-            detectSpacing = float.Parse(TTTTextLoader.GetJson(TTTUDPHandler.UDPConfigPath, TTTUDPHandler.DetectSpacingName));
-            return;
-        }
-
-        /// <summary>
-        /// 预设置
-        /// </summary>
-        private void Presetting()
-        {
-            remoteAddress = new IPEndPoint(IPAddress.Any, 0);
-            thread = new Thread(MessageReceive); // 单开线程接收消息
-            thread.Start();
-            InvokeRepeating("RepeatDetect", 0f, detectSpacing); // 每隔一段时间检测一次是否有消息传入
-            return;
-        }
-
-        /// <summary>
-        /// 重复检测
-        /// </summary>
-        private void RepeatDetect()
-        {
-            if (string.IsNullOrEmpty(UDPMessage)) // 如果消息为空
-            {
-                return;
-            }
-            TTTTipTools.Notice(UDPMessage);
-            UDPMessage = null; // 清空接收结果
-            return;
-        }
-
-        /// <summary>
-        /// 接收消息
-        /// </summary>
-        private void MessageReceive()
-        {
-            while (true)
-            {
-                udpClient = new UdpClient(localPort);
-                byte[] receiveData = udpClient.Receive(ref remoteAddress); // 接收数据
-                UDPMessage = ReciveMessageEncoding.GetString(receiveData);
-                udpClient.Close();
-            }
-        }
-
-        /// <summary>
-        /// 发送消息
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <param name="sendMessage"></param>
-        public void MessageSend(byte[] ip, int port, string sendMessage)
-        {
-            if (sendMessage == null)
-            {
-                return;
-            }
-
-            IPAddress tempIPAddress = new IPAddress(ip);
-            IPEndPoint tempRemoteAddress = new IPEndPoint(tempIPAddress, port); // 实例化一个远程端点
-            byte[] sendData = SendMessageEncoding.GetBytes(sendMessage);
-            UdpClient client = new UdpClient(); // this.localPort + 1 // 端口不可复用 // 否则无法区分每条消息
-            client.Send(sendData, sendData.Length, tempRemoteAddress); // 将数据发送到远程端点
-            client.Close(); // 关闭连接
-            return;
-        }
-
-        /// <summary>
-        /// 退出套接字
-        /// </summary>
-        private void SocketQuit()
-        {
-            thread.Abort();
-            thread.Interrupt();
-            udpClient.Close();
-            return;
-        }
-
-        /// <summary>
-        /// 向固定地址和IP发消息
-        /// 偷懒方法
-        /// </summary>
-        /// <param name="message"></param>
-        public void SendMessageOut(string message)
-        {
-            MessageSend(targetIP, targetPort, message);
-            TTTTipTools.Notice("Send <<color=#FF0000>" + message + "</color>> to <<color=#FF0000>" + targetIP[0] + "." + targetIP[1] + "." + targetIP[2] + "." + targetIP[3] + ":" + targetPort + "</color>>");
-            return;
-        }
+      MessageSend(targetIP, targetPort, message);
+      TTTTipTools.Notice("Send <<color=#FF0000>" + message + "</color>> to <<color=#FF0000>" + targetIP[0] + "." + targetIP[1] + "." + targetIP[2] + "." + targetIP[3] + ":" + targetPort + "</color>>");
+      return;
     }
+  }
 }

+ 24 - 24
Assets/ToneTuneToolkit/Scripts/UDP/TTTUDPHandler.cs

@@ -2,31 +2,31 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// UDP工具助手
-    /// 需要正确的配置文件
-    /// TTTUDPCommunicator.Instance.SendMessageOut("Text");
-    /// </summary>
-    [RequireComponent(typeof(TTTManager))]
-    [RequireComponent(typeof(TTTUDPCommunicator))]
-    public class TTTUDPHandler : MonoBehaviour
-    {
-        #region Paths
-        public static string UDPConfigPath = TTTManager.ConfigsPath + "/udpconfig.json";
-        #endregion
+  /// <summary>
+  /// OK
+  /// UDP工具助手
+  /// 需要正确的配置文件
+  /// TTTUDPCommunicator.Instance.SendMessageOut("Text");
+  /// </summary>
+  [RequireComponent(typeof(TTTManager))]
+  [RequireComponent(typeof(TTTUDPCommunicator))]
+  public class TTTUDPHandler : MonoBehaviour
+  {
+    #region Paths
+    public static string UDPConfigPath = TTTManager.ConfigsPath + "/udpconfig.json";
+    #endregion
 
-        #region KeyNames
-        public static string LocalIPName = "Local IP";
-        public static string LocalPortName = "Local Port";
-        public static string TargetIPName = "Target IP";
-        public static string TargetPortName = "Target Port";
-        public static string DetectSpacingName = "Detect Spacing";
-        #endregion
+    #region KeyNames
+    public static string LocalIPName = "Local IP";
+    public static string LocalPortName = "Local Port";
+    public static string TargetIPName = "Target IP";
+    public static string TargetPortName = "Target Port";
+    public static string DetectSpacingName = "Detect Spacing";
+    #endregion
 
-        private void Awake()
-        {
-            TTTManager.FileIntegrityCheck(UDPConfigPath);
-        }
+    private void Awake()
+    {
+      TTTManager.FileIntegrityCheck(UDPConfigPath);
     }
+  }
 }

+ 46 - 46
Assets/ToneTuneToolkit/Scripts/Verification/TTTAntiVerifier.cs

@@ -4,60 +4,60 @@ using System;
 
 namespace ToneTuneToolkit
 {
+  /// <summary>
+  /// OK
+  /// 反向验证工具
+  /// </summary>
+  public class TTTAntiVerifier : MonoBehaviour
+  {
+
+    #region DEBUG
+    private GameObject dtGO;
+    private TextMesh dtTMCmpt;
+    #endregion
+    private void Start()
+    {
+      PreloadDebugInfo();
+      AntiVerifikadoSystem();
+    }
+
     /// <summary>
-    /// OK
-    /// 反向验证工具
+    /// 预创建Debug文字
     /// </summary>
-    public class TTTAntiVerifier : MonoBehaviour
+    private void PreloadDebugInfo()
     {
+      dtGO = new GameObject("DebugText");
+      dtGO.transform.position = Vector3.zero;
+      dtGO.AddComponent<TextMesh>();
+
+      dtGO.GetComponent<MeshRenderer>().enabled = true; // 关闭检测文字
+
+      dtTMCmpt = dtGO.GetComponent<TextMesh>();
+      dtTMCmpt.characterSize = .25f;
+      dtTMCmpt.fontSize = 24;
+      dtTMCmpt.anchor = TextAnchor.MiddleCenter;
+      dtTMCmpt.alignment = TextAlignment.Left;
+      dtTMCmpt.text = "> AntiVerifying...";
+      return;
+    }
 
-        #region DEBUG
-        private GameObject dtGO;
-        private TextMesh dtTMCmpt;
-        #endregion
-        private void Start()
-        {
-            PreloadDebugInfo();
-            AntiVerifikadoSystem();
-        }
+    private void AntiVerifikadoSystem()
+    {
+      dtTMCmpt.text += "\n> UC: <color=#FF0000>" + SystemInfo.deviceUniqueIdentifier + "</color>"; // uc
 
-        /// <summary>
-        /// 预创建Debug文字
-        /// </summary>
-        private void PreloadDebugInfo()
+      NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
+      for (int i = 0; i < nis.Length; i++)
+      {
+        if (nis[i].NetworkInterfaceType.ToString() == "Ethernet")
         {
-            dtGO = new GameObject("DebugText");
-            dtGO.transform.position = Vector3.zero;
-            dtGO.AddComponent<TextMesh>();
-
-            dtGO.GetComponent<MeshRenderer>().enabled = true; // 关闭检测文字
-
-            dtTMCmpt = dtGO.GetComponent<TextMesh>();
-            dtTMCmpt.characterSize = .25f;
-            dtTMCmpt.fontSize = 24;
-            dtTMCmpt.anchor = TextAnchor.MiddleCenter;
-            dtTMCmpt.alignment = TextAlignment.Left;
-            dtTMCmpt.text = "> AntiVerifying...";
-            return;
+          dtTMCmpt.text += "\n> MC: <color=#FF0000>" + nis[i].GetPhysicalAddress().ToString() + "</color>"; // mc
         }
+      }
 
-        private void AntiVerifikadoSystem()
-        {
-            dtTMCmpt.text += "\n> UC: <color=#FF0000>" + SystemInfo.deviceUniqueIdentifier + "</color>"; // uc
-
-            NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
-            for (int i = 0; i < nis.Length; i++)
-            {
-                if (nis[i].NetworkInterfaceType.ToString() == "Ethernet")
-                {
-                    dtTMCmpt.text += "\n> MC: <color=#FF0000>" + nis[i].GetPhysicalAddress().ToString() + "</color>"; // mc
-                }
-            }
+      dtTMCmpt.text += "\n> MC: <color=#FF0000>" + ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString() + "</color>"; // ts
 
-            dtTMCmpt.text += "\n> MC: <color=#FF0000>" + ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString() + "</color>"; // ts
-
-            dtTMCmpt.text += "\n> Done.";
-            return;
-        }
+      dtTMCmpt.text += "\n> Done.";
+      return;
     }
+  }
 }

+ 216 - 216
Assets/ToneTuneToolkit/Scripts/Verification/TTTVerifier.cs

@@ -11,253 +11,253 @@ using UnityEngine.SceneManagement;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// Verifikado
-    /// 验证系统
-    /// 需要正确的配置文件
-    /// TS ms
-    /// http://www.txttool.com/
-    /// https://tool.lu/timestamp
-    /// </summary>
-    public class TTTVerifier : MonoBehaviour
-    {
-        private string stampURL = "http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp";
-        private string verifikadoCode;
-        private string verifikadoMAC;
-        private string verifikadoStamp;
+  /// <summary>
+  /// OK
+  /// Verifikado
+  /// 验证系统
+  /// 需要正确的配置文件
+  /// TS ms
+  /// http://www.txttool.com/
+  /// https://tool.lu/timestamp
+  /// </summary>
+  public class TTTVerifier : MonoBehaviour
+  {
+    private string stampURL = "http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp";
+    private string verifikadoCode;
+    private string verifikadoMAC;
+    private string verifikadoStamp;
 
-        private bool checker = false;
+    private bool checker = false;
 
-        // 弹窗
-        [DllImport("user32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
-        public static extern int MessageBox(IntPtr handle, String message, String title, int type);
+    // 弹窗
+    [DllImport("user32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
+    public static extern int MessageBox(IntPtr handle, String message, String title, int type);
 
-        // 网络
-        [DllImport("wininet.dll")]
-        private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
+    // 网络
+    [DllImport("wininet.dll")]
+    private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
 
-        #region DEBUG
-        private GameObject dtGO;
-        private TextMesh dtTMCmpt;
-        #endregion
+    #region DEBUG
+    private GameObject dtGO;
+    private TextMesh dtTMCmpt;
+    #endregion
 
-        private void Start()
-        {
-            PreloadDebugInfo();
-            VerifikadoSystem();
-        }
+    private void Start()
+    {
+      PreloadDebugInfo();
+      VerifikadoSystem();
+    }
 
-        /// <summary>
-        /// 预创建Debug文字
-        /// </summary>
-        private void PreloadDebugInfo()
-        {
-            dtGO = new GameObject("DebugText");
-            dtGO.transform.position = Vector3.zero;
-            dtGO.AddComponent<TextMesh>();
+    /// <summary>
+    /// 预创建Debug文字
+    /// </summary>
+    private void PreloadDebugInfo()
+    {
+      dtGO = new GameObject("DebugText");
+      dtGO.transform.position = Vector3.zero;
+      dtGO.AddComponent<TextMesh>();
 
-            dtGO.GetComponent<MeshRenderer>().enabled = true; // 关闭检测文字
+      dtGO.GetComponent<MeshRenderer>().enabled = true; // 关闭检测文字
 
-            dtTMCmpt = dtGO.GetComponent<TextMesh>();
-            dtTMCmpt.characterSize = .25f;
-            dtTMCmpt.fontSize = 24;
-            dtTMCmpt.anchor = TextAnchor.MiddleCenter;
-            dtTMCmpt.alignment = TextAlignment.Left;
-            dtTMCmpt.text = "> Verifying...";
-            return;
-        }
+      dtTMCmpt = dtGO.GetComponent<TextMesh>();
+      dtTMCmpt.characterSize = .25f;
+      dtTMCmpt.fontSize = 24;
+      dtTMCmpt.anchor = TextAnchor.MiddleCenter;
+      dtTMCmpt.alignment = TextAlignment.Left;
+      dtTMCmpt.text = "> Verifying...";
+      return;
+    }
 
-        /// <summary>
-        /// Verifikado系统
-        /// </summary>
-        private void VerifikadoSystem()
-        {
-            checker = CheckFileExist(TTTVerifierHandler.AuthorizationFilePath); // s1 file
-            dtTMCmpt.text += "\n> Check the Files Exists: <color=#FF0000>" + checker + "</color>"; // DEBUG
-            if (!checker) // 如果为否
-            {
-                ApplicationError("无效的程序验证流程。");
-                return;
-            }
+    /// <summary>
+    /// Verifikado系统
+    /// </summary>
+    private void VerifikadoSystem()
+    {
+      checker = CheckFileExist(TTTVerifierHandler.AuthorizationFilePath); // s1 file
+      dtTMCmpt.text += "\n> Check the Files Exists: <color=#FF0000>" + checker + "</color>"; // DEBUG
+      if (!checker) // 如果为否
+      {
+        ApplicationError("无效的程序验证流程。");
+        return;
+      }
 
-            checker = CheckNetwork(); // s2 net
-            dtTMCmpt.text += "\n> Check the Network: <color=#FF0000>" + checker + "</color>"; // DEBUG
-            if (!checker)
-            {
-                ApplicationError("无网络链接,请检查后重试。");
-                return;
-            }
+      checker = CheckNetwork(); // s2 net
+      dtTMCmpt.text += "\n> Check the Network: <color=#FF0000>" + checker + "</color>"; // DEBUG
+      if (!checker)
+      {
+        ApplicationError("无网络链接,请检查后重试。");
+        return;
+      }
 
-            verifikadoCode = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.UCName));
-            checker = CheckUniqueCode(verifikadoCode); // s3 uc
-            dtTMCmpt.text += "\n> Check the Code: <color=#FF0000>" + checker + "</color>"; // DEBUG
-            if (!checker)
-            {
-                ApplicationError("无效的授权。");
-                return;
-            }
+      verifikadoCode = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.UCName));
+      checker = CheckUniqueCode(verifikadoCode); // s3 uc
+      dtTMCmpt.text += "\n> Check the Code: <color=#FF0000>" + checker + "</color>"; // DEBUG
+      if (!checker)
+      {
+        ApplicationError("无效的授权。");
+        return;
+      }
 
-            verifikadoMAC = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.MCName));
-            checker = CheckMACCode(verifikadoMAC); // s4 mc
-            dtTMCmpt.text += "\n> Check the Address: <color=#FF0000>" + checker + "</color>"; // DEBUG
-            if (!checker)
-            {
-                ApplicationError("无效的地址。");
-                return;
-            }
+      verifikadoMAC = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.MCName));
+      checker = CheckMACCode(verifikadoMAC); // s4 mc
+      dtTMCmpt.text += "\n> Check the Address: <color=#FF0000>" + checker + "</color>"; // DEBUG
+      if (!checker)
+      {
+        ApplicationError("无效的地址。");
+        return;
+      }
 
-            verifikadoStamp = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.TSName));
-            StartCoroutine(CheckTimeStampChain(stampURL)); // s5 ts
-            return;
-        }
+      verifikadoStamp = BinaryToString(TTTTextLoader.GetJson(TTTVerifierHandler.AuthorizationFilePath, TTTVerifierHandler.TSName));
+      StartCoroutine(CheckTimeStampChain(stampURL)); // s5 ts
+      return;
+    }
 
-        #region Check
-        private bool CheckFileExist(string filePath)
-        {
-            if (File.Exists(filePath))
-            {
-                return true;
-            }
-            return false;
-        }
+    #region Check
+    private bool CheckFileExist(string filePath)
+    {
+      if (File.Exists(filePath))
+      {
+        return true;
+      }
+      return false;
+    }
 
-        private bool CheckNetwork()
-        {
-            int i = 0;
-            if (InternetGetConnectedState(out i, 0)) // C#网络判断
-            {
-                return true;
-            }
-            return false;
-        }
+    private bool CheckNetwork()
+    {
+      int i = 0;
+      if (InternetGetConnectedState(out i, 0)) // C#网络判断
+      {
+        return true;
+      }
+      return false;
+    }
 
-        private bool CheckUniqueCode(string vC)
-        {
-            if (vC == SystemInfo.deviceUniqueIdentifier)
-            {
-                return true;
-            }
-            return false;
-        }
+    private bool CheckUniqueCode(string vC)
+    {
+      if (vC == SystemInfo.deviceUniqueIdentifier)
+      {
+        return true;
+      }
+      return false;
+    }
 
-        private bool CheckMACCode(string vM)
+    private bool CheckMACCode(string vM)
+    {
+      NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); // Get全部网卡
+      for (int i = 0; i < nis.Length; i++)
+      {
+        if (nis[i].NetworkInterfaceType.ToString() == "Ethernet") // Get以太网
         {
-            NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces(); // Get全部网卡
-            for (int i = 0; i < nis.Length; i++)
-            {
-                if (nis[i].NetworkInterfaceType.ToString() == "Ethernet") // Get以太网
-                {
-                    if (vM == nis[i].GetPhysicalAddress().ToString()) // Mac地址确认
-                    {
-                        return true;
-                    };
-                }
-            }
-            return false;
+          if (vM == nis[i].GetPhysicalAddress().ToString()) // Mac地址确认
+          {
+            return true;
+          };
         }
+      }
+      return false;
+    }
 
-        /// <summary>
-        /// 时间验证链
-        /// </summary>
-        /// <param name="stampURL"></param>
-        /// <returns></returns>
-        private IEnumerator CheckTimeStampChain(string stampURL)
-        {
-            UnityWebRequest webRequest = UnityWebRequest.Get(stampURL);
-            yield return webRequest.SendWebRequest();
-            // if (webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError)
-            // {
-            //     // Debug.Log(webRequest.error);
-            // }
-            JObject jb = JObject.Parse(webRequest.downloadHandler.text);
-            long networkStamp = long.Parse(jb["data"]["t"].ToString());
-            // Debug.Log(jb["data"]["t"]); // 时间戳
+    /// <summary>
+    /// 时间验证链
+    /// </summary>
+    /// <param name="stampURL"></param>
+    /// <returns></returns>
+    private IEnumerator CheckTimeStampChain(string stampURL)
+    {
+      UnityWebRequest webRequest = UnityWebRequest.Get(stampURL);
+      yield return webRequest.SendWebRequest();
+      // if (webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError)
+      // {
+      //     // Debug.Log(webRequest.error);
+      // }
+      JObject jb = JObject.Parse(webRequest.downloadHandler.text);
+      long networkStamp = long.Parse(jb["data"]["t"].ToString());
+      // Debug.Log(jb["data"]["t"]); // 时间戳
 
-            long localStamp = long.Parse(verifikadoStamp); // 转long
-            if (networkStamp > localStamp)
-            {
-                checker = false;
-            }
-            else
-            {
-                checker = true;
-            }
+      long localStamp = long.Parse(verifikadoStamp); // 转long
+      if (networkStamp > localStamp)
+      {
+        checker = false;
+      }
+      else
+      {
+        checker = true;
+      }
 
-            dtTMCmpt.text += "\n> Check the Authorization Date: <color=#FF0000>" + checker + "</color>"; // DEBUG
-            if (!checker)
-            {
-                ApplicationError("授权可能已过期。");
-                yield break;
-            }
+      dtTMCmpt.text += "\n> Check the Authorization Date: <color=#FF0000>" + checker + "</color>"; // DEBUG
+      if (!checker)
+      {
+        ApplicationError("授权可能已过期。");
+        yield break;
+      }
 
-            // 跳转
-            dtTMCmpt.text += "\n> Done.";
-            LoadNextScene();
-            yield break;
-        }
-        #endregion
+      // 跳转
+      dtTMCmpt.text += "\n> Done.";
+      LoadNextScene();
+      yield break;
+    }
+    #endregion
 
-        #region TextConvert
-        /// <summary>
-        /// 字符串转二进制
-        /// </summary>
-        /// <param name="str"></param>
-        /// <returns></returns>
-        protected string StringToBinary(string str)
-        {
-            byte[] data = Encoding.Default.GetBytes(str);
-            StringBuilder sb = new StringBuilder(data.Length * 8);
-            foreach (byte item in data)
-            {
-                sb.Append(Convert.ToString(item, 2).PadLeft(8, '0'));
-            }
-            return sb.ToString();
-        }
+    #region TextConvert
+    /// <summary>
+    /// 字符串转二进制
+    /// </summary>
+    /// <param name="str"></param>
+    /// <returns></returns>
+    protected string StringToBinary(string str)
+    {
+      byte[] data = Encoding.Default.GetBytes(str);
+      StringBuilder sb = new StringBuilder(data.Length * 8);
+      foreach (byte item in data)
+      {
+        sb.Append(Convert.ToString(item, 2).PadLeft(8, '0'));
+      }
+      return sb.ToString();
+    }
 
-        /// <summary>
-        /// 二进制转字符串
-        /// </summary>
-        /// <param name="str"></param>
-        /// <returns></returns>
-        protected string BinaryToString(string str)
-        {
-            System.Text.RegularExpressions.CaptureCollection cs = System.Text.RegularExpressions.Regex.Match(str, @"([01]{8})+").Groups[1].Captures;
-            byte[] data = new byte[cs.Count];
-            for (int i = 0; i < cs.Count; i++)
-            {
-                data[i] = Convert.ToByte(cs[i].Value, 2);
-            }
-            return Encoding.Default.GetString(data, 0, data.Length);
-        }
-        #endregion
+    /// <summary>
+    /// 二进制转字符串
+    /// </summary>
+    /// <param name="str"></param>
+    /// <returns></returns>
+    protected string BinaryToString(string str)
+    {
+      System.Text.RegularExpressions.CaptureCollection cs = System.Text.RegularExpressions.Regex.Match(str, @"([01]{8})+").Groups[1].Captures;
+      byte[] data = new byte[cs.Count];
+      for (int i = 0; i < cs.Count; i++)
+      {
+        data[i] = Convert.ToByte(cs[i].Value, 2);
+      }
+      return Encoding.Default.GetString(data, 0, data.Length);
+    }
+    #endregion
 
-        #region Other
-        private void ApplicationError(string message)
-        {
-            MessageBox(IntPtr.Zero, message + "\n您可能是盗版程序的受害者,程序即将退出。\n\n<" + DateTime.Now.ToString() + ">", "Verify - Application Error", 0);
-            Invoke("ApplicationQuit", 3f);
-            return;
-        }
+    #region Other
+    private void ApplicationError(string message)
+    {
+      MessageBox(IntPtr.Zero, message + "\n您可能是盗版程序的受害者,程序即将退出。\n\n<" + DateTime.Now.ToString() + ">", "Verify - Application Error", 0);
+      Invoke("ApplicationQuit", 3f);
+      return;
+    }
 
-        private void ApplicationQuit()
-        {
+    private void ApplicationQuit()
+    {
 #if UNITY_EDITOR
-            UnityEditor.EditorApplication.isPlaying = false;
+      UnityEditor.EditorApplication.isPlaying = false;
 #else
             Application.Quit();
 #endif
-            return;
-        }
+      return;
+    }
 
-        private void LoadNextScene()
-        {
-            if (SceneManager.sceneCountInBuildSettings >= 2) // 场景大于2加载下一个场景
-            {
-                SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
-            }
-            return;
-        }
-        #endregion
+    private void LoadNextScene()
+    {
+      if (SceneManager.sceneCountInBuildSettings >= 2) // 场景大于2加载下一个场景
+      {
+        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
+      }
+      return;
     }
+    #endregion
+  }
 }

+ 21 - 21
Assets/ToneTuneToolkit/Scripts/Verification/TTTVerifierHandler.cs

@@ -2,28 +2,28 @@ using UnityEngine;
 
 namespace ToneTuneToolkit
 {
-    /// <summary>
-    /// OK
-    /// 验证系统助手
-    /// 需要正确的配置文件
-    /// </summary>
-    [RequireComponent(typeof(TTTManager))]
-    [RequireComponent(typeof(TTTVerifier))]
-    public class TTTVerifierHandler : MonoBehaviour
-    {
-        #region Paths
-        public static string AuthorizationFilePath = TTTManager.DataPath + "/authorizationcode.json";
-        #endregion
+  /// <summary>
+  /// OK
+  /// 验证系统助手
+  /// 需要正确的配置文件
+  /// </summary>
+  [RequireComponent(typeof(TTTManager))]
+  [RequireComponent(typeof(TTTVerifier))]
+  public class TTTVerifierHandler : MonoBehaviour
+  {
+    #region Paths
+    public static string AuthorizationFilePath = TTTManager.DataPath + "/authorizationcode.json";
+    #endregion
 
-        #region KeyNames
-        public static string UCName = "U C";
-        public static string MCName = "M C";
-        public static string TSName = "T S";
-        #endregion
+    #region KeyNames
+    public static string UCName = "U C";
+    public static string MCName = "M C";
+    public static string TSName = "T S";
+    #endregion
 
-        private void Awake()
-        {
-            TTTManager.FileIntegrityCheck(AuthorizationFilePath);
-        }
+    private void Awake()
+    {
+      TTTManager.FileIntegrityCheck(AuthorizationFilePath);
     }
+  }
 }

+ 0 - 251
Logs/AssetImportWorker0-prev.log

@@ -1,251 +0,0 @@
-Using pre-set license
-Built from '2020.3/china_unity/release' branch; Version is '2020.3.14f1c1 (ed787cdc2846) revision 15562876'; Using compiler version '192528614'; Build Type 'Release'
-OS: 'Windows 10 Pro; OS build 19043.1110; Version 2009; 64bit' Language: 'zh' Physical Memory: 16305 MB
-BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 0
-
- COMMAND LINE ARGUMENTS:
-C:\Program Files\Unity\Hub\Editor\2020.3.14f1c1\Editor\Unity.exe
--adb2
--batchMode
--noUpm
--name
-AssetImportWorker0
--projectPath
-D:/workflow/project/unity/ToneTuneToolkit
--logFile
-Logs/AssetImportWorker0.log
--srvPort
-60818
-Successfully changed project path to: D:/workflow/project/unity/ToneTuneToolkit
-D:/workflow/project/unity/ToneTuneToolkit
-Using Asset Import Pipeline V2.
-Refreshing native plugins compatible for Editor in 35.94 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Initialize engine version: 2020.3.14f1c1 (ed787cdc2846)
-[Subsystems] Discovering subsystems at path C:/Program Files/Unity/Hub/Editor/2020.3.14f1c1/Editor/Data/Resources/UnitySubsystems
-[Subsystems] Discovering subsystems at path D:/workflow/project/unity/ToneTuneToolkit/Assets
-GfxDevice: creating device client; threaded=0
-Direct3D:
-    Version:  Direct3D 11.0 [level 11.1]
-    Renderer: NVIDIA GeForce GTX 1070 (ID=0x1b81)
-    Vendor:   
-    VRAM:     8088 MB
-    Driver:   27.21.14.5671
-Initialize mono
-Mono path[0] = 'C:/Program Files/Unity/Hub/Editor/2020.3.14f1c1/Editor/Data/Managed'
-Mono path[1] = 'C:/Program Files/Unity/Hub/Editor/2020.3.14f1c1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit'
-Mono config path = 'C:/Program Files/Unity/Hub/Editor/2020.3.14f1c1/Editor/Data/MonoBleedingEdge/etc'
-Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56076
-Begin MonoManager ReloadAssembly
-Registering precompiled unity dll's ...
-Register platform support module: C:/Program Files/Unity/Hub/Editor/2020.3.14f1c1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
-Registered in 0.003033 seconds.
-Native extension for WindowsStandalone target not found
-Refreshing native plugins compatible for Editor in 37.31 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Mono: successfully reloaded assembly
-- Completed reload, in  0.906 seconds
-Domain Reload Profiling:
-	ReloadAssembly (906ms)
-		BeginReloadAssembly (60ms)
-			ExecutionOrderSort (0ms)
-			DisableScriptedObjects (0ms)
-			BackupInstance (0ms)
-			ReleaseScriptingObjects (0ms)
-			CreateAndSetChildDomain (1ms)
-		EndReloadAssembly (391ms)
-			LoadAssemblies (57ms)
-			RebuildTransferFunctionScriptingTraits (0ms)
-			SetupTypeCache (139ms)
-			ReleaseScriptCaches (0ms)
-			RebuildScriptCaches (30ms)
-			SetupLoadedEditorAssemblies (149ms)
-				LogAssemblyErrors (0ms)
-				InitializePlatformSupportModulesInManaged (4ms)
-				SetLoadedEditorAssemblies (0ms)
-				RefreshPlugins (37ms)
-				BeforeProcessingInitializeOnLoad (9ms)
-				ProcessInitializeOnLoadAttributes (74ms)
-				ProcessInitializeOnLoadMethodAttributes (25ms)
-				AfterProcessingInitializeOnLoad (0ms)
-				EditorAssembliesLoaded (0ms)
-			ExecutionOrderSort2 (0ms)
-			AwakeInstancesAfterBackupRestoration (0ms)
-Platform modules already initialized, skipping
-Registering precompiled user dll's ...
-Registered in 0.002864 seconds.
-Begin MonoManager ReloadAssembly
-Native extension for WindowsStandalone target not found
-Refreshing native plugins compatible for Editor in 34.99 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Mono: successfully reloaded assembly
-- Completed reload, in  1.023 seconds
-Domain Reload Profiling:
-	ReloadAssembly (1024ms)
-		BeginReloadAssembly (145ms)
-			ExecutionOrderSort (0ms)
-			DisableScriptedObjects (5ms)
-			BackupInstance (0ms)
-			ReleaseScriptingObjects (0ms)
-			CreateAndSetChildDomain (15ms)
-		EndReloadAssembly (817ms)
-			LoadAssemblies (91ms)
-			RebuildTransferFunctionScriptingTraits (0ms)
-			SetupTypeCache (260ms)
-			ReleaseScriptCaches (0ms)
-			RebuildScriptCaches (42ms)
-			SetupLoadedEditorAssemblies (317ms)
-				LogAssemblyErrors (0ms)
-				InitializePlatformSupportModulesInManaged (4ms)
-				SetLoadedEditorAssemblies (0ms)
-				RefreshPlugins (35ms)
-				BeforeProcessingInitializeOnLoad (83ms)
-				ProcessInitializeOnLoadAttributes (173ms)
-				ProcessInitializeOnLoadMethodAttributes (12ms)
-				AfterProcessingInitializeOnLoad (10ms)
-				EditorAssembliesLoaded (0ms)
-			ExecutionOrderSort2 (0ms)
-			AwakeInstancesAfterBackupRestoration (6ms)
-Platform modules already initialized, skipping
-========================================================================
-Worker process is ready to serve import requests
-Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
-Refreshing native plugins compatible for Editor in 0.42 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Unloading 2102 Unused Serialized files (Serialized files now loaded: 0)
-System memory in use before: 93.6 MB.
-System memory in use after: 93.7 MB.
-
-Unloading 28 unused Assets to reduce memory usage. Loaded Objects now: 2543.
-Total: 2.269400 ms (FindLiveObjects: 0.170500 ms CreateObjectMapping: 0.071500 ms MarkObjects: 1.938300 ms  DeleteObjects: 0.087400 ms)
-
-AssetImportParameters requested are different than current active one (requested -> active):
-  custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> 
-  custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> 
-  custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> 
-  custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> 
-  custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> 
-  custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> 
-  custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> 
-  custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
-  custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
-========================================================================
-Received Import Request.
-  path: Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStartHandler.cs
-  artifactKey: Guid(083fd709b3176b64aa8939838065a57d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStartHandler.cs using Guid(083fd709b3176b64aa8939838065a57d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: '28acb8c39052fe58abbfccc231555835') in 0.041708 seconds 
-  Import took 0.044482 seconds .
-
-========================================================================
-Received Prepare
-Registering precompiled user dll's ...
-Registered in 0.002930 seconds.
-Begin MonoManager ReloadAssembly
-Native extension for WindowsStandalone target not found
-Refreshing native plugins compatible for Editor in 0.43 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Mono: successfully reloaded assembly
-- Completed reload, in  0.934 seconds
-Domain Reload Profiling:
-	ReloadAssembly (935ms)
-		BeginReloadAssembly (108ms)
-			ExecutionOrderSort (0ms)
-			DisableScriptedObjects (6ms)
-			BackupInstance (0ms)
-			ReleaseScriptingObjects (0ms)
-			CreateAndSetChildDomain (28ms)
-		EndReloadAssembly (763ms)
-			LoadAssemblies (91ms)
-			RebuildTransferFunctionScriptingTraits (0ms)
-			SetupTypeCache (260ms)
-			ReleaseScriptCaches (1ms)
-			RebuildScriptCaches (40ms)
-			SetupLoadedEditorAssemblies (280ms)
-				LogAssemblyErrors (0ms)
-				InitializePlatformSupportModulesInManaged (5ms)
-				SetLoadedEditorAssemblies (0ms)
-				RefreshPlugins (0ms)
-				BeforeProcessingInitializeOnLoad (94ms)
-				ProcessInitializeOnLoadAttributes (163ms)
-				ProcessInitializeOnLoadMethodAttributes (6ms)
-				AfterProcessingInitializeOnLoad (10ms)
-				EditorAssembliesLoaded (0ms)
-			ExecutionOrderSort2 (0ms)
-			AwakeInstancesAfterBackupRestoration (9ms)
-Platform modules already initialized, skipping
-Refreshing native plugins compatible for Editor in 0.42 ms, found 3 plugins.
-Preloading 0 native plugins for Editor in 0.00 ms.
-Unloading 2092 Unused Serialized files (Serialized files now loaded: 0)
-System memory in use before: 93.1 MB.
-System memory in use after: 93.2 MB.
-
-Unloading 16 unused Assets to reduce memory usage. Loaded Objects now: 2547.
-Total: 2.205800 ms (FindLiveObjects: 0.160800 ms CreateObjectMapping: 0.068600 ms MarkObjects: 1.956900 ms  DeleteObjects: 0.018700 ms)
-
-AssetImportParameters requested are different than current active one (requested -> active):
-  custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> 
-  custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> 
-  custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> 
-  custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> 
-  custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> 
-  custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> 
-  custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> 
-  custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
-  custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
-========================================================================
-Received Import Request.
-  Time since last request: 13.818208 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStartHandler.cs
-  artifactKey: Guid(083fd709b3176b64aa8939838065a57d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStartHandler.cs using Guid(083fd709b3176b64aa8939838065a57d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'b69a1b1310737f646d2c7278f1ff4b00') in 0.003592 seconds 
-  Import took 0.006211 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 19.526708 seconds.
-  path: Assets/StreamingAssets/ToneTuneToolkit/additionaltools/WolCmd.exe
-  artifactKey: Guid(902146c5f6732cd4ab4971de2d18f76b) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/StreamingAssets/ToneTuneToolkit/additionaltools/WolCmd.exe using Guid(902146c5f6732cd4ab4971de2d18f76b) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: '00fde81908b32a3d17c78b71cdb948ec') in 0.017725 seconds 
-  Import took 0.020491 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 0.041338 seconds.
-  path: Assets/ToneTuneToolkit/Documentation.md
-  artifactKey: Guid(00277320b88355049b5c0adbb1dc7925) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Documentation.md using Guid(00277320b88355049b5c0adbb1dc7925) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: '3617143fcb011bd862c4104eff857a8c') in 0.003541 seconds 
-  Import took 0.006333 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 0.035780 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStart.cs
-  artifactKey: Guid(c169d5c5410e1c54b863480342a4a7de) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/ColdStart/TTTColdStart.cs using Guid(c169d5c5410e1c54b863480342a4a7de) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'fde005977570988f55424029b7b1ada2') in 0.001484 seconds 
-  Import took 0.004071 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 0.012238 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/UDP/TTTUDPCommunicator.cs
-  artifactKey: Guid(e4a67c7f470799844913cb81dcfa68bf) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/UDP/TTTUDPCommunicator.cs using Guid(e4a67c7f470799844913cb81dcfa68bf) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'f66c89e34f9842079043369a7d8d1695') in 0.002859 seconds 
-  Import took 0.005789 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 0.020221 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/Common/TTTManager.cs
-  artifactKey: Guid(ac15485f346a87047bc6b6113af31f9d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/Common/TTTManager.cs using Guid(ac15485f346a87047bc6b6113af31f9d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'b4d493ad1f3b2d89300071c2e7d32e6a') in 0.001179 seconds 
-  Import took 0.003781 seconds .
-
-========================================================================
-Received Import Request.
-  Time since last request: 0.019267 seconds.
-  path: Assets/StreamingAssets/ToneTuneToolkit/configs/wolconfig.json
-  artifactKey: Guid(7468611130b14424cbe4c0c636eb1afc) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/StreamingAssets/ToneTuneToolkit/configs/wolconfig.json using Guid(7468611130b14424cbe4c0c636eb1afc) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'dafc6d146f8711c71554486c04718ad1') in 0.004352 seconds 
-  Import took 0.020642 seconds .
-
-AssetImportWorkerClient::OnTransportError - code=2 error=End of file