MirzkisD1Ex0 1 year ago
parent
commit
ac4ff3ada3
20 changed files with 1633 additions and 942 deletions
  1. 74 0
      Materials/ScrollView/ScrollViewHandler.cs
  2. BIN
      Materials/ScrollView/Snipaste_2024-06-18_16-29-37.png
  3. 98 57
      Materials/SerialPortUtilityPro/SerialPortUtilityProManager.cs
  4. 79 0
      Materials/SerialPortUtilityPro/SerialPortUtilityProStorage.cs
  5. 0 0
      Materials/SerialPortUtilityPro/新建文本文档.txt
  6. 45 0
      ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat
  7. 7 0
      ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat.meta
  8. 5 5
      ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/configs/udpconfig.json
  9. 6 4
      ToneTuneToolkit/Assets/ToneTuneToolkit/README.md
  10. 107 0
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/Media/WebCamHandler.cs
  11. 11 0
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/Media/WebCamHandler.cs.meta
  12. 70 58
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorLite.cs
  13. 198 0
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorServer.cs
  14. 11 0
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorServer.cs.meta
  15. 2 2
      ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPResponder.cs
  16. 374 346
      ToneTuneToolkit/Logs/AssetImportWorker0-prev.log
  17. 60 68
      ToneTuneToolkit/Logs/AssetImportWorker0.log
  18. 383 299
      ToneTuneToolkit/Logs/AssetImportWorker1-prev.log
  19. 58 58
      ToneTuneToolkit/Logs/AssetImportWorker1.log
  20. 45 45
      ToneTuneToolkit/UserSettings/Layouts/default-2022.dwlt

+ 74 - 0
Materials/ScrollView/ScrollViewHandler.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening;
+using UnityEngine.Events;
+
+namespace VolkswagenIDUNYXMusicPlayer
+{
+  public class ScrollViewHandler : MonoBehaviour
+  {
+    public static ScrollViewHandler Instance;
+    public UnityAction<int> OnContentIndexChange;
+
+    private ScrollRect scrollRect;
+    private Vector2 scrollviewLocation;
+    private int currentContentIndex = 0;
+    private const float animTime = .66f;
+
+    // ==================================================
+
+    private void Awake()
+    {
+      Instance = this;
+    }
+
+    private void Start()
+    {
+      Init();
+    }
+
+    // ==================================================
+
+    private void Init()
+    {
+      scrollRect = GetComponent<ScrollRect>();
+      return;
+    }
+
+
+
+    public void GetVector2Location(Vector2 value)
+    {
+      scrollviewLocation = value;
+      return;
+    }
+
+    public void AdjustView()
+    {
+      int newContentIndex = (int)Math.Round(scrollviewLocation.x, 0);
+
+      scrollRect.horizontal = false;
+      scrollRect.DOHorizontalNormalizedPos(newContentIndex, animTime).OnComplete(() =>
+        {
+          scrollRect.horizontal = true;
+
+          if (currentContentIndex == newContentIndex) // 无变化
+          {
+            return;
+          }
+          else
+          {
+            currentContentIndex = newContentIndex;
+            if (OnContentIndexChange != null)
+            {
+              OnContentIndexChange(newContentIndex);
+            }
+          }
+        });
+      return;
+    }
+  }
+}

BIN
Materials/ScrollView/Snipaste_2024-06-18_16-29-37.png


+ 98 - 57
Materials/SerialPortUtilityPro/SerialPortUtilityProManager.cs

@@ -2,82 +2,123 @@ using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using System;
-using System.IO;
 using System.Text;
-using Newtonsoft.Json;
+using SerialPortUtility;
 
-namespace PomellatoPomPomDotHeartbeat
+public class SerialPortUtilityProManager : MonoBehaviour
 {
-  /// <summary>
-  /// 通常来说设置产品的VID/PID就足以识别硬件了
-  /// 填入序列号将导致识别唯一
-  /// </summary>
-  public class SerialPortUtilityProStorage : MonoBehaviour
+  public static SerialPortUtilityProManager Instance;
+
+  private SerialPortUtilityPro serialPortUtilityPro;
+
+  // ==============================
+
+  private void Awake()
+  {
+    Instance = this;
+  }
+
+  private void Start()
   {
-    public static SerialPortUtilityProStorage Instance;
+    Init();
+  }
 
-    #region Path
-    private string ssupSettingPath = Application.streamingAssetsPath + "/SerialPortUtilityProSetting.json";
-    #endregion
+  // ==============================
 
-    #region Value
-    public List<DeviceInfoData> DeviceInfoDatas;
-    #endregion
+  private void Init()
+  {
+    serialPortUtilityPro = GetComponent<SerialPortUtilityPro>();
+    return;
+  }
 
-    // ==================================================
+  // ==============================
 
-    private void Awake()
+  /// <summary>
+  /// 
+  /// </summary>
+  /// <param name="index">设备序号</param>
+  public void LoadPortInfo(int portInfoIndex)
+  {
+    serialPortUtilityPro.VendorID = SerialPortUtilityProStorage.Instance.GetDeviceVendorID(portInfoIndex);
+    serialPortUtilityPro.ProductID = SerialPortUtilityProStorage.Instance.GetDeviceProductID(portInfoIndex);
+    serialPortUtilityPro.SerialNumber = SerialPortUtilityProStorage.Instance.GetDeviceSerialNumber(portInfoIndex);
+    return;
+  }
+
+  /// <summary>
+  /// 串口开关
+  /// </summary>
+  /// <param name="value"></param>
+  public void SwitchSerialPortUtilityPro(bool value)
+  {
+    if (value)
     {
-      Instance = this;
+      serialPortUtilityPro.Open();
     }
-
-    private void Start()
+    else
     {
-      Init();
+      serialPortUtilityPro.Close();
     }
+    return;
+  }
 
-    // ==================================================
+  // ==============================
+  // 发包
 
-    private void Init()
-    {
-      string ssupSettingJson = File.ReadAllText(ssupSettingPath, Encoding.UTF8);
-      Dictionary<string, List<string>> dic = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(ssupSettingJson);
-      List<string> DeviceInfos = dic["DeviceInfo"];
-
-      for (int i = 0; i < DeviceInfos.Count; i++)
-      {
-        DeviceInfoData tempDID = new DeviceInfoData();
-        string[] infoSlice = DeviceInfos[i].Split('_');
-        tempDID.VendorID = infoSlice[0];
-        tempDID.ProductID = infoSlice[1];
-        tempDID.SerialNumber = infoSlice[2];
-
-        DeviceInfoDatas.Add(tempDID);
-      }
-      return;
-    }
+  /// <summary>
+  /// 发送信号给设备
+  /// </summary>
+  /// <param name="value"></param>
+  /// <param name="modeIndex"></param>
+  public void SendMessage2Device(string value)
+  {
+    // byte[] data = OutMessageProcessing(value);
+    // serialPortUtilityPro.Write(data);
 
-    public string GetDeviceVendorID(int index)
-    {
-      return DeviceInfoDatas[index].VendorID;
-    }
+    serialPortUtilityPro.Write(Encoding.ASCII.GetBytes(value)); // 插件
+    Debug.Log("SerialPort Send: " + value);
+    return;
+  }
 
-    public string GetDeviceProductID(int index)
-    {
-      return DeviceInfoDatas[index].ProductID;
-    }
+  // ==============================
+  // 收包
 
-    public string GetDeviceSerialNumber(int index)
-    {
-      return DeviceInfoDatas[index].SerialNumber;
-    }
+  /// <summary>
+  /// 读原流
+  /// 配合SerialPortUtilityPro使用
+  /// </summary>
+  /// <param name="streaming"></param>
+  public void ReadStreaming(object streaming)
+  {
+    Debug.Log("Arduino Recive: " + streaming);
+    string stringRawData = streaming.ToString();
+    InMessageProcessing(stringRawData);
+    return;
   }
 
-  [Serializable]
-  public class DeviceInfoData
+  /// <summary>
+  /// 读二进制流
+  /// 配合SerialPortUtilityPro使用
+  /// </summary>
+  /// <param name="byteData"></param>
+  public void ReadBinaryStreaming(object byteData)
   {
-    public string VendorID;
-    public string ProductID;
-    public string SerialNumber;
+    Debug.Log(byteData);
+    string stringRawData = BitConverter.ToString((byte[])byteData); // 比特流翻译
+    Debug.Log("Arduino Recive: " + stringRawData.Replace('-', ' '));
+    InMessageProcessing(stringRawData);
+    return;
+  }
+
+  private void InMessageProcessing(string value)
+  {
+    int resultValue;
+    bool canTrans = int.TryParse(value, out resultValue);
+
+    if (!canTrans) // 转换失败
+    {
+      return;
+    }
+    return;
   }
 }

+ 79 - 0
Materials/SerialPortUtilityPro/SerialPortUtilityProStorage.cs

@@ -0,0 +1,79 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+using System.IO;
+using System.Text;
+using Newtonsoft.Json;
+using UnityEngine.Events;
+
+/// <summary>
+/// 通常来说设置产品的VID/PID就足以识别硬件了
+/// 填入序列号将导致识别唯一
+/// </summary>
+public class SerialPortUtilityProStorage : MonoBehaviour
+{
+  public static SerialPortUtilityProStorage Instance;
+
+  #region Path
+  private string ssupSettingPath = Application.streamingAssetsPath + "/SerialPortUtilityProSetting.json";
+  #endregion
+
+  #region Value
+  public List<DeviceInfoData> DeviceInfoDatas;
+  #endregion
+
+  // ==================================================
+
+  private void Awake()
+  {
+    Instance = this;
+    Init();
+  }
+
+  // ==================================================
+
+  private void Init()
+  {
+    string ssupSettingJson = File.ReadAllText(ssupSettingPath, Encoding.UTF8);
+    Dictionary<string, List<string>> dic = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(ssupSettingJson);
+    List<string> DeviceInfos = dic["DeviceInfo"];
+
+    for (int i = 0; i < DeviceInfos.Count; i++)
+    {
+      DeviceInfoData tempDID = new DeviceInfoData();
+      string[] infoSlice = DeviceInfos[i].Split('_');
+      tempDID.VendorID = infoSlice[0];
+      tempDID.ProductID = infoSlice[1];
+      tempDID.SerialNumber = infoSlice[2];
+
+      DeviceInfoDatas.Add(tempDID);
+    }
+    return;
+  }
+
+  // ==================================================
+
+  public string GetDeviceVendorID(int index)
+  {
+    return DeviceInfoDatas[index].VendorID;
+  }
+
+  public string GetDeviceProductID(int index)
+  {
+    return DeviceInfoDatas[index].ProductID;
+  }
+
+  public string GetDeviceSerialNumber(int index)
+  {
+    return DeviceInfoDatas[index].SerialNumber;
+  }
+}
+
+[Serializable]
+public class DeviceInfoData
+{
+  public string VendorID;
+  public string ProductID;
+  public string SerialNumber;
+}

+ 0 - 0
Materials/SerialPortUtilityPro/新建文本文档.txt


+ 45 - 0
ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat

@@ -0,0 +1,45 @@
+@echo off
+chcp 65001
+setlocal enabledelayedexpansion
+
+set /p port="[TTT] 输入端口号: "
+echo.
+
+echo [TTT] 正在查询端口 %port% 的占用情况...
+netstat -ano | findstr :%port%
+echo.
+
+set "pid="
+
+for /f "tokens=4" %%i in ('netstat -ano ^| findstr :%port%') do (
+    set "pid=%%i"
+    goto :result
+)
+
+:result
+if defined pid (
+    echo [TTT] 找到占用端口 %port% 的进程ID: !pid!
+) else (
+    echo [TTT] 没有找到占用端口 %port% 的进程。
+    goto end
+)
+
+:: 询问用户是否结束这个进程
+set /p kill="[TTT] 是否要结束这个进程? (y/n): "
+if /i "!kill!"=="y" (
+    echo [TTT] 正在结束进程 !pid!...
+    taskkill /F /PID !pid!
+    if !errorlevel! equ 0 (
+        echo [TTT] 成功结束进程 !pid!。
+    ) else (
+        echo [TTT] 无法结束进程 !pid!。
+    )
+) else (
+    echo [TTT] 操作已取消。
+)
+
+:end
+echo [TTT] 操作已结束。
+
+pause
+endlocal

+ 7 - 0
ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 411e93da73d019b449dd53809a652dfa
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 5 - 5
ToneTuneToolkit/Assets/StreamingAssets/ToneTuneToolkit/configs/udpconfig.json

@@ -1,7 +1,7 @@
 {
-    "Local IP": "192.168.1.2",
-    "Local Port": "11100",
-    "Target IP": "192.168.1.3",
-    "Target Port": "11100",
-    "Detect Spacing": "1"
+  "local_ip": "192.168.1.100",
+  "local_port": "9999",
+  "target_ip": "192.168.1.100",
+  "target_port": "3456",
+  "recive_frequency": "0.04"
 }

+ 6 - 4
ToneTuneToolkit/Assets/ToneTuneToolkit/README.md

@@ -45,6 +45,7 @@
 24. 2023/12/28 分离“TextLoader”的json读写功能至“Data”分类下的“JsonManager”。
 25. 2024/06/03 添加了“TextureProcessor”,读/写/旋转/缩放Texture。
 26. 2024/06/18 添加了“LongTimeNoOperationDetector”,用于检测用户长时间无操作。
+27. 2024/07/18 添加了“UDPCommunicatorServer”,单端口非一次性play,用于作为server大量接收数据。
 
 </br>
 
@@ -100,10 +101,11 @@
 * LongTimeNoOperationDetector.cs        // 长时间无操作检测
 
 ### -> ToneTuneToolkit.UDP/
-* UDPCommunicator.cs      // UDP通讯器
-* UDPCommunicatorLite.cs  // UDP通讯器轻量版
-* UDPHandler.cs           // UDP助手
-* UDPResponder.cs         // UDP响应器
+* UDPCommunicator.cs        // UDP通讯器 // 已残
+* UDPCommunicatorLite.cs    // UDP通讯器客户端轻量版
+* UDPCommunicatorServer.cs  // UDP通讯器服务端
+* UDPHandler.cs             // UDP助手
+* UDPResponder.cs           // UDP响应器
 
 ### -> ToneTuneToolkit.UI/
 * Parallax.cs         // 多层次视差

+ 107 - 0
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/Media/WebCamHandler.cs

@@ -0,0 +1,107 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class WebCamHandler : MonoBehaviour
+{
+  public static WebCamHandler Instance;
+
+  public RawImage previewRawImage;
+
+  private WebCamDevice _webCamDevice;
+  private WebCamTexture _webCamTexture;
+  private bool _isWebCamReady = false;
+
+  // ==================================================
+
+  private void Awake()
+  {
+    Instance = this;
+  }
+
+  private void Start()
+  {
+    // InitWebcam();
+    // StartWebcam();
+  }
+
+  // ==================================================
+  // 相机配置
+
+  // private const string _RequestedDeviceName = "Logitech BRIO";
+  private string _webCamName = "GC21 Video";
+  private int _webCamWidth = 1280;
+  private int _webCamHeight = 720;
+  private int _webCamFPS = 30;
+
+  private void InitWebcam()
+  {
+    foreach (WebCamDevice device in WebCamTexture.devices)
+    {
+      // Debug.Log(device.name);
+      if (device.name == _webCamName)
+      {
+        _webCamDevice = device;
+        _webCamTexture = new WebCamTexture(_webCamDevice.name, _webCamWidth, _webCamHeight, _webCamFPS);
+        // _webCamTexture.Play();
+        _isWebCamReady = true;
+
+        if (previewRawImage) // Preview
+        {
+          previewRawImage.texture = _webCamTexture;
+        }
+        break;
+      }
+    }
+    return;
+  }
+
+  public WebCamTexture GetWebcamTexture()
+  {
+    if (_isWebCamReady)
+    {
+      return _webCamTexture;
+    }
+    else
+    {
+      return null;
+    }
+  }
+
+  public void SetWebcam(string name, int width, int height, int fps)
+  {
+    _webCamName = name;
+    _webCamWidth = width;
+    _webCamHeight = height;
+    _webCamFPS = fps;
+    return;
+  }
+
+  public void StartWebcam()
+  {
+    if (_isWebCamReady)
+    {
+      _webCamTexture.Play();
+    }
+    return;
+  }
+
+  public void PauseWebcam()
+  {
+    if (_isWebCamReady)
+    {
+      _webCamTexture.Pause();
+    }
+    return;
+  }
+
+  public void StopWebcam()
+  {
+    if (_isWebCamReady)
+    {
+      _webCamTexture.Stop();
+    }
+    return;
+  }
+}

+ 11 - 0
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/Media/WebCamHandler.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: db322a5350c33b0469ea7087a15d48e7
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 70 - 58
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorLite.cs

@@ -1,6 +1,6 @@
 /// <summary>
-/// Copyright (c) 2023 MirzkisD1Ex0 All rights reserved.
-/// Code Version 1.1
+/// Copyright (c) 2024 MirzkisD1Ex0 All rights reserved.
+/// Code Version 1.2
 /// </summary>
 
 using System.Net;
@@ -16,9 +16,8 @@ using UnityEngine.Events;
 namespace ToneTuneToolkit.UDP
 {
   /// <summary>
-  /// UDP通讯器轻量版
-  ///
-  /// 无需助手
+  /// UDP通讯器轻量版 // 客户端
+  /// 收发端口即用即删
   /// 测试前务必关闭所有防火墙 // 设备之间需要互相ping通
   /// </summary>
   public class UDPCommunicatorLite : MonoBehaviour
@@ -26,23 +25,23 @@ namespace ToneTuneToolkit.UDP
     public static UDPCommunicatorLite Instance;
 
     #region Path
-    private static string udpConfigPath = Application.streamingAssetsPath + "/udpconfig.json";
+    private string udpConfigPath = Application.streamingAssetsPath + "/udpconfig.json";
     #endregion
 
-    #region Settings
-    private byte[] localIP = new byte[] { 0, 0, 0, 0 };
+    #region Config
+    private string localIP = null;
     private int localPort = 0;
-    private byte[] targetIP = new byte[] { 0, 0, 0, 0 };
+    private string targetIP = null;
     private int targetPort = 0;
-    private float detectSpacing = 1f; // 循环检测间隔
-    private Encoding ReciveMessageEncoding = Encoding.UTF8; // 接收消息字符编码
-    private Encoding SendMessageEncoding = Encoding.UTF8; // 发出消息字符编码
+    private float reciveFrequency = .5f; // 循环检测间隔
+    private Encoding ReciveMessageEncoding = Encoding.ASCII; // 接收消息字符编码
+    private Encoding SendMessageEncoding = Encoding.ASCII; // 发出消息字符编码
     #endregion
 
-    #region Others
-    private UdpClient udpClient; // UDP客户端
-    private Thread thread = null; // 单开线程
-    private IPEndPoint remoteAddress;
+    #region Receive
+    private UdpClient receiveUDPClient; // UDP客户端
+    private Thread receiveThread = null; // 单开线程
+    private IPEndPoint remoteAddress; // 收
     #endregion
 
     #region Values
@@ -62,6 +61,14 @@ namespace ToneTuneToolkit.UDP
       Init();
     }
 
+    private void Update()
+    {
+      if (Input.GetKeyDown(KeyCode.Q))
+      {
+        SendMessageOut("sdasd");
+      }
+    }
+
     private void OnDestroy()
     {
       Uninit();
@@ -78,45 +85,47 @@ namespace ToneTuneToolkit.UDP
     {
       LoadConfig();
       remoteAddress = new IPEndPoint(IPAddress.Any, 0);
-      thread = new Thread(MessageReceive); // 单开线程接收消息
-      thread.Start();
-      InvokeRepeating("RepeatDetect", 0f, detectSpacing); // 每隔一段时间检测一次是否有消息传入
+      receiveThread = new Thread(new ThreadStart(MessageReceive))
+      {
+        IsBackground = true
+      }; // 单开线程接收消息
+      receiveThread.Start();
+      InvokeRepeating("RepeatHookMessage", 0f, reciveFrequency); // 每隔一段时间检测一次是否有消息传入
       return;
     }
 
+
     /// <summary>
     /// 卸载
     /// 退出套接字
     /// </summary>
     public void Uninit()
     {
-      CancelInvoke("RepeatDetect");
-      thread.Abort();
-      thread.Interrupt();
-      udpClient.Close();
+      CancelInvoke("RepeatHookMessage");
+      if (receiveThread != null)
+      {
+        receiveThread.Abort();
+      }
+      if (receiveUDPClient != null)
+      {
+        receiveUDPClient.Close();
+      }
       return;
     }
 
+    /// <summary>
+    /// 加载配置文件
+    /// </summary>
     private void LoadConfig()
     {
       string json = File.ReadAllText(udpConfigPath, Encoding.UTF8);
       Dictionary<string, string> keys = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
 
-      string[] localIPString = keys["Local IP"].Split('.');
-      for (int i = 0; i < 4; i++)
-      {
-        localIP[i] = (byte)int.Parse(localIPString[i]);
-      }
-      localPort = int.Parse(keys["Local Port"]);
-
-      string[] targetIPString = keys["Target IP"].Split('.');
-      for (int i = 0; i < 4; i++)
-      {
-        targetIP[i] = (byte)int.Parse(targetIPString[i]);
-      }
-      targetPort = int.Parse(keys["Target Port"]);
-
-      detectSpacing = float.Parse(keys["Detect Spacing"]);
+      localIP = keys["local_ip"];
+      localPort = int.Parse(keys["local_port"]);
+      targetIP = keys["target_ip"];
+      targetPort = int.Parse(keys["target_port"]);
+      reciveFrequency = float.Parse(keys["recive_frequency"]);
       return;
     }
 
@@ -138,69 +147,72 @@ namespace ToneTuneToolkit.UDP
     // ==================================================
 
     /// <summary>
-    /// 重复检测
+    /// 重复钩出回执消息
     /// </summary>
-    private void RepeatDetect()
+    private void RepeatHookMessage()
     {
       if (string.IsNullOrEmpty(udpMessage)) // 如果消息为空
       {
         return;
       }
-      Debug.Log($"<color=white>[TTT UDPCommunicatorLite]</color> Recived message: <color=white>[{udpMessage}]</color>...[OK]");
 
-      if (OnMessageRecive == null) // 如果没人订阅
+      Debug.Log($"<color=white>[TTT UDPCommunicatorLite]</color> Recived message: <color=white>[{udpMessage}]</color> form <color=white>[{remoteAddress}]</color>...[OK]");
+      if (OnMessageRecive != null) // 如果有订阅
       {
-        return;
+        OnMessageRecive(udpMessage); // 把数据丢出去
       }
-      OnMessageRecive(udpMessage); // 把数据丢出去
       udpMessage = null; // 清空接收结果
       return;
     }
 
     /// <summary>
     /// 接收消息
+    /// 独立线程
     /// </summary>
     private void MessageReceive()
     {
       while (true)
       {
-        udpClient = new UdpClient(localPort);
-        byte[] receiveData = udpClient.Receive(ref remoteAddress); // 接收数据
+        receiveUDPClient = new UdpClient(localPort); // 新建客户端
+        byte[] receiveData = receiveUDPClient.Receive(ref remoteAddress);
         udpMessage = ReciveMessageEncoding.GetString(receiveData);
-        udpClient.Close();
+        receiveUDPClient.Close(); // 关闭客户端
       }
     }
 
     /// <summary>
     /// 发送消息
+    /// 为何不将远程端点提出,因为可能需要用此方法1对多发消息
     /// </summary>
     /// <param name="ip"></param>
-    /// <param name="sendMessage"></param>
-    public void MessageSend(byte[] ip, int port, string sendMessage)
+    /// <param name="port"></param>
+    /// <param name="message"></param>
+    public void MessageSend(string ip, int port, string message)
     {
-      if (sendMessage == null)
+      if (message == null)
       {
         return;
       }
 
-      IPAddress tempIPAddress = new IPAddress(ip);
-      IPEndPoint tempRemoteAddress = new IPEndPoint(tempIPAddress, port); // 实例化一个远程端点
-      byte[] sendData = SendMessageEncoding.GetBytes(sendMessage);
-      UdpClient client = new UdpClient(); // localPort + 1 // 端口不可复用 // 否则无法区分每条消息
-      client.Send(sendData, sendData.Length, tempRemoteAddress); // 将数据发送到远程端点
-      client.Close(); // 关闭连接
+      byte[] sendData = SendMessageEncoding.GetBytes(message);
+
+      IPEndPoint tempRemoteAddress = new IPEndPoint(IPAddress.Parse(ip), port); // 实例化一个远程端点
+
+      UdpClient sendClient = new UdpClient(); // localPort + 1 // 端口不可复用 // 否则无法区分每条消息 // 接收端消息粘连
+      sendClient.Send(sendData, sendData.Length, tempRemoteAddress); // 将数据发送到远程端点
+      sendClient.Close(); // 关闭连接
+      Debug.Log($"<color=white>[TTT UDPCommunicatorLite]</color> Lazy send [<color=white>{message}</color> to <color=white>{targetIP}:{targetPort}</color>]...[OK]");
       return;
     }
 
     /// <summary>
-    /// 向固定地址和IP发消息
+    /// 向预设地址发消息
     /// 偷懒方法
     /// </summary>
     /// <param name="message"></param>
     public void SendMessageOut(string message)
     {
       MessageSend(targetIP, targetPort, message);
-      Debug.Log($"<color=white>[TTT UDPCommunicatorLite]</color> Send [<color=white>{message}</color> to <color=white>{targetIP[0]}.{targetIP[1]}.{targetIP[2]}.{targetIP[3]}:{targetPort}</color>]...[OK]");
       return;
     }
   }

+ 198 - 0
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorServer.cs

@@ -0,0 +1,198 @@
+/// <summary>
+/// Copyright (c) 2024 MirzkisD1Ex0 All rights reserved.
+/// Code Version 1.2
+/// </summary>
+
+using System.IO;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using UnityEngine;
+using UnityEngine.Events;
+using Newtonsoft.Json;
+
+namespace ToneTuneToolkit.UDP
+{
+  /// <summary>
+  /// UDP通讯器轻量版 // 服务端
+  /// 单端口play // 发送的消息会粘连/定向接收连续的消息
+  /// 测试前务必关闭所有防火墙 // 设备之间需要互相ping通
+  /// </summary>
+  public class UDPCommunicatorServer : MonoBehaviour
+  {
+    public static UDPCommunicatorServer Instance;
+
+    #region Path
+    private string udpConfigPath = Application.streamingAssetsPath + "/udpconfig.json";
+    #endregion
+
+    #region Config
+    private string targetIP = null;
+    private int targetPort = 0;
+    private int localPort = 0;
+    private float reciveFrequency = .5f; // 循环检测间隔
+    #endregion
+
+    #region Other
+    private UdpClient udpClient; // 单端口
+    private Thread receiveThread;
+    private IPEndPoint remoteClient; // 客户端的IP和端口信息
+    #endregion
+
+
+    #region Value
+    private string udpMessage; // 接受到的消息
+    private event UnityAction<string> OnMessageRecive;
+    #endregion
+
+    // ==================================================
+
+    private void Awake()
+    {
+      Instance = this;
+    }
+
+    private void Start()
+    {
+      Init();
+    }
+
+    private void OnDisable()
+    {
+      Uninit();
+    }
+
+    // ==================================================
+
+    private void Init()
+    {
+      LoadConfig();
+
+      udpClient = new UdpClient(localPort); // 创建UDP客户端并绑定到指定端口
+      Debug.Log($"<color=white>[TTT UDPCommunicatorServer]</color> UDP Server started on port : <color=white>[{localPort}]</color>...[OK]");
+      remoteClient = new IPEndPoint(IPAddress.Any, 0); // 初始化客户端端点
+
+      receiveThread = new Thread(new ThreadStart(MessageReceive)) // 创建并启动接收线程
+      {
+        IsBackground = true
+      };
+      receiveThread.Start();
+
+      InvokeRepeating("RepeatHookMessage", 0f, reciveFrequency); // 每隔一段时间检测一次是否有消息传入
+      return;
+    }
+
+    /// <summary>
+    /// 卸载
+    /// 退出套接字
+    /// </summary>
+    public void Uninit()
+    {
+      CancelInvoke("RepeatHookMessage");
+      if (receiveThread != null)
+      {
+        receiveThread.Abort();
+      }
+      if (udpClient != null)
+      {
+        udpClient.Close();
+      }
+      return;
+    }
+
+    // ==================================================
+    // 接收消息事件订阅
+
+    public void AddEventListener(UnityAction<string> unityAction)
+    {
+      OnMessageRecive += unityAction;
+      return;
+    }
+
+    public void RemoveEventListener(UnityAction<string> unityAction)
+    {
+      OnMessageRecive -= unityAction;
+      return;
+    }
+
+    // ==================================================
+
+    /// <summary>
+    /// 加载配置文件
+    /// </summary>
+    private void LoadConfig()
+    {
+      string json = File.ReadAllText(udpConfigPath, Encoding.UTF8);
+      Dictionary<string, string> keys = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
+      localPort = int.Parse(keys["local_port"]);
+      targetIP = keys["target_ip"];
+      targetPort = int.Parse(keys["target_port"]);
+      reciveFrequency = float.Parse(keys["recive_frequency"]);
+      return;
+    }
+
+    /// <summary>
+    /// 重复钩出回执消息
+    /// </summary>
+    private void RepeatHookMessage()
+    {
+      if (string.IsNullOrEmpty(udpMessage)) // 如果消息为空
+      {
+        return;
+      }
+      Debug.Log($"<color=white>[TTT UDPCommunicatorServer]</color> Recived message: <color=white>[{udpMessage}]</color>...[OK]");
+
+      if (OnMessageRecive != null) // 如果有订阅
+      {
+        OnMessageRecive(udpMessage); // 把数据丢出去
+      }
+      udpMessage = null; // 清空接收结果
+      return;
+    }
+
+    /// <summary>
+    /// 接收消息
+    /// 独立线程
+    /// </summary>
+    private void MessageReceive()
+    {
+      while (true)
+      {
+        byte[] result = udpClient.Receive(ref remoteClient);
+        udpMessage = Encoding.UTF8.GetString(result);
+      }
+    }
+
+    /// <summary>
+    /// 发送消息
+    /// </summary>
+    /// <param name="message"></param>
+    /// <param name="ip"></param>
+    /// <param name="port"></param>
+    public void MessageSend(string ip, int port, string message)
+    {
+      if (message == null)
+      {
+        return;
+      }
+      byte[] messageBytes = Encoding.UTF8.GetBytes(message);
+      IPEndPoint sendEndPoint = new IPEndPoint(IPAddress.Parse(ip), port);
+      udpClient.Send(messageBytes, messageBytes.Length, sendEndPoint);
+      return;
+    }
+
+    /// <summary>
+    /// 向预设地址发消息
+    /// 偷懒方法
+    /// </summary>
+    /// <param name="message"></param>
+    public void MessageSendOut(string message)
+    {
+      MessageSend(targetIP, targetPort, message);
+      Debug.Log($"<color=white>[TTT UDPCommunicatorServer]</color> Lazy send [<color=white>{message}</color> to <color=white>{targetIP}:{targetPort}</color>]...[OK]");
+      return;
+    }
+  }
+}

+ 11 - 0
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPCommunicatorServer.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 44547e173eec1124e8a1fc03b7d44686
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 2
ToneTuneToolkit/Assets/ToneTuneToolkit/Scripts/UDP/UDPResponder.cs

@@ -1,6 +1,6 @@
 /// <summary>
-/// Copyright (c) 2021 MirzkisD1Ex0 All rights reserved.
-/// Code Version 1.0
+/// Copyright (c) 2024 MirzkisD1Ex0 All rights reserved.
+/// Code Version 1.1
 /// </summary>
 
 using UnityEngine;

File diff suppressed because it is too large
+ 374 - 346
ToneTuneToolkit/Logs/AssetImportWorker0-prev.log


+ 60 - 68
ToneTuneToolkit/Logs/AssetImportWorker0.log

@@ -15,7 +15,7 @@ D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 -logFile
 Logs/AssetImportWorker0.log
 -srvPort
-12047
+12569
 Successfully changed project path to: D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 [UnityMemory] Configuration Parameters - Can be set up in boot.config
@@ -49,12 +49,12 @@ D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
     "memorysetup-temp-allocator-size-cloud-worker=32768"
     "memorysetup-temp-allocator-size-gi-baking-worker=262144"
     "memorysetup-temp-allocator-size-gfx=262144"
-Player connection [27896] Host "[IP] 172.31.64.1 [Port] 0 [Flags] 2 [Guid] 213987564 [EditorId] 213987564 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]...
+Player connection [28956] Host "[IP] 192.168.1.100 [Port] 0 [Flags] 2 [Guid] 41087511 [EditorId] 41087511 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]...
 
-Player connection [27896] Host "[IP] 172.31.64.1 [Port] 0 [Flags] 2 [Guid] 213987564 [EditorId] 213987564 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]...
+Player connection [28956] Host "[IP] 192.168.1.100 [Port] 0 [Flags] 2 [Guid] 41087511 [EditorId] 41087511 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]...
 
 [Physics::Module] Initialized MultithreadedJobDispatcher with 15 workers.
-Refreshing native plugins compatible for Editor in 7.91 ms, found 3 plugins.
+Refreshing native plugins compatible for Editor in 10.90 ms, found 3 plugins.
 Preloading 0 native plugins for Editor in 0.00 ms.
 Initialize engine version: 2022.3.30f1 (70558241b701)
 [Subsystems] Discovering subsystems at path C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/Resources/UnitySubsystems
@@ -70,7 +70,7 @@ Initialize mono
 Mono path[0] = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/Managed'
 Mono path[1] = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32'
 Mono config path = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/MonoBleedingEdge/etc'
-Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56076
+Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56400
 Begin MonoManager ReloadAssembly
 Registering precompiled unity dll's ...
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
@@ -78,8 +78,8 @@ Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/MetroSupport/UnityEditor.UWP.Extensions.dll
-Registered in 0.013625 seconds.
-- Loaded All Assemblies, in  0.392 seconds
+Registered in 0.017495 seconds.
+- Loaded All Assemblies, in  0.412 seconds
 Native extension for UWP target not found
 Native extension for WindowsStandalone target not found
 [usbmuxd] Start listen thread
@@ -88,36 +88,36 @@ Native extension for iOS target not found
 Native extension for Android target not found
 Native extension for WebGL target not found
 Mono: successfully reloaded assembly
-- Finished resetting the current domain, in  0.368 seconds
-Domain Reload Profiling: 759ms
-	BeginReloadAssembly (116ms)
+- Finished resetting the current domain, in  0.351 seconds
+Domain Reload Profiling: 761ms
+	BeginReloadAssembly (130ms)
 		ExecutionOrderSort (0ms)
 		DisableScriptedObjects (0ms)
 		BackupInstance (0ms)
 		ReleaseScriptingObjects (0ms)
 		CreateAndSetChildDomain (1ms)
-	RebuildCommonClasses (34ms)
-	RebuildNativeTypeToScriptingClass (11ms)
-	initialDomainReloadingComplete (67ms)
-	LoadAllAssembliesAndSetupDomain (163ms)
-		LoadAssemblies (115ms)
+	RebuildCommonClasses (37ms)
+	RebuildNativeTypeToScriptingClass (9ms)
+	initialDomainReloadingComplete (74ms)
+	LoadAllAssembliesAndSetupDomain (160ms)
+		LoadAssemblies (127ms)
 		RebuildTransferFunctionScriptingTraits (0ms)
-		AnalyzeDomain (159ms)
-			TypeCache.Refresh (156ms)
-				TypeCache.ScanAssembly (139ms)
-			ScanForSourceGeneratedMonoScriptInfo (1ms)
-			ResolveRequiredComponents (1ms)
-	FinalizeReload (369ms)
+		AnalyzeDomain (156ms)
+			TypeCache.Refresh (154ms)
+				TypeCache.ScanAssembly (140ms)
+			ScanForSourceGeneratedMonoScriptInfo (0ms)
+			ResolveRequiredComponents (0ms)
+	FinalizeReload (352ms)
 		ReleaseScriptCaches (0ms)
 		RebuildScriptCaches (0ms)
-		SetupLoadedEditorAssemblies (304ms)
+		SetupLoadedEditorAssemblies (291ms)
 			LogAssemblyErrors (0ms)
-			InitializePlatformSupportModulesInManaged (112ms)
-			SetLoadedEditorAssemblies (6ms)
+			InitializePlatformSupportModulesInManaged (109ms)
+			SetLoadedEditorAssemblies (7ms)
 			RefreshPlugins (0ms)
 			BeforeProcessingInitializeOnLoad (3ms)
-			ProcessInitializeOnLoadAttributes (129ms)
-			ProcessInitializeOnLoadMethodAttributes (54ms)
+			ProcessInitializeOnLoadAttributes (125ms)
+			ProcessInitializeOnLoadMethodAttributes (47ms)
 			AfterProcessingInitializeOnLoad (0ms)
 			EditorAssembliesLoaded (0ms)
 		ExecutionOrderSort2 (0ms)
@@ -125,8 +125,8 @@ Domain Reload Profiling: 759ms
 ========================================================================
 Worker process is ready to serve import requests
 Begin MonoManager ReloadAssembly
-- Loaded All Assemblies, in  0.736 seconds
-Refreshing native plugins compatible for Editor in 2.52 ms, found 3 plugins.
+- Loaded All Assemblies, in  0.938 seconds
+Refreshing native plugins compatible for Editor in 3.72 ms, found 3 plugins.
 Native extension for UWP target not found
 Native extension for WindowsStandalone target not found
 Native extension for iOS target not found
@@ -137,47 +137,47 @@ Package Manager log level set to [2]
 [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process).
 [Package Manager] Cannot connect to Unity Package Manager local server
 Mono: successfully reloaded assembly
-- Finished resetting the current domain, in  0.645 seconds
-Domain Reload Profiling: 1380ms
-	BeginReloadAssembly (179ms)
+- Finished resetting the current domain, in  0.800 seconds
+Domain Reload Profiling: 1736ms
+	BeginReloadAssembly (163ms)
 		ExecutionOrderSort (0ms)
 		DisableScriptedObjects (6ms)
 		BackupInstance (0ms)
 		ReleaseScriptingObjects (0ms)
-		CreateAndSetChildDomain (36ms)
-	RebuildCommonClasses (34ms)
-	RebuildNativeTypeToScriptingClass (10ms)
-	initialDomainReloadingComplete (30ms)
-	LoadAllAssembliesAndSetupDomain (482ms)
-		LoadAssemblies (361ms)
+		CreateAndSetChildDomain (26ms)
+	RebuildCommonClasses (38ms)
+	RebuildNativeTypeToScriptingClass (14ms)
+	initialDomainReloadingComplete (61ms)
+	LoadAllAssembliesAndSetupDomain (659ms)
+		LoadAssemblies (500ms)
 		RebuildTransferFunctionScriptingTraits (0ms)
-		AnalyzeDomain (215ms)
-			TypeCache.Refresh (190ms)
-				TypeCache.ScanAssembly (170ms)
-			ScanForSourceGeneratedMonoScriptInfo (16ms)
+		AnalyzeDomain (258ms)
+			TypeCache.Refresh (230ms)
+				TypeCache.ScanAssembly (201ms)
+			ScanForSourceGeneratedMonoScriptInfo (20ms)
 			ResolveRequiredComponents (6ms)
-	FinalizeReload (646ms)
+	FinalizeReload (801ms)
 		ReleaseScriptCaches (0ms)
 		RebuildScriptCaches (0ms)
-		SetupLoadedEditorAssemblies (477ms)
+		SetupLoadedEditorAssemblies (592ms)
 			LogAssemblyErrors (0ms)
-			InitializePlatformSupportModulesInManaged (41ms)
-			SetLoadedEditorAssemblies (3ms)
+			InitializePlatformSupportModulesInManaged (53ms)
+			SetLoadedEditorAssemblies (4ms)
 			RefreshPlugins (0ms)
-			BeforeProcessingInitializeOnLoad (63ms)
-			ProcessInitializeOnLoadAttributes (334ms)
-			ProcessInitializeOnLoadMethodAttributes (29ms)
-			AfterProcessingInitializeOnLoad (7ms)
+			BeforeProcessingInitializeOnLoad (89ms)
+			ProcessInitializeOnLoadAttributes (413ms)
+			ProcessInitializeOnLoadMethodAttributes (26ms)
+			AfterProcessingInitializeOnLoad (8ms)
 			EditorAssembliesLoaded (0ms)
 		ExecutionOrderSort2 (0ms)
-		AwakeInstancesAfterBackupRestoration (8ms)
-Launched and connected shader compiler UnityShaderCompiler.exe after 0.06 seconds
-Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins.
+		AwakeInstancesAfterBackupRestoration (9ms)
+Launched and connected shader compiler UnityShaderCompiler.exe after 0.09 seconds
+Refreshing native plugins compatible for Editor in 5.90 ms, found 3 plugins.
 Preloading 0 native plugins for Editor in 0.00 ms.
-Unloading 3206 Unused Serialized files (Serialized files now loaded: 0)
-Unloading 36 unused Assets / (59.0 KB). Loaded Objects now: 3668.
+Unloading 3208 Unused Serialized files (Serialized files now loaded: 0)
+Unloading 36 unused Assets / (58.7 KB). Loaded Objects now: 3670.
 Memory consumption went from 127.7 MB to 127.7 MB.
-Total: 3.190300 ms (FindLiveObjects: 0.277100 ms CreateObjectMapping: 0.185800 ms MarkObjects: 2.609100 ms  DeleteObjects: 0.117300 ms)
+Total: 5.434000 ms (FindLiveObjects: 0.607300 ms CreateObjectMapping: 0.388000 ms MarkObjects: 4.249800 ms  DeleteObjects: 0.187000 ms)
 
 AssetImportParameters requested are different than current active one (requested -> active):
   custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> 
@@ -194,17 +194,9 @@ AssetImportParameters requested are different than current active one (requested
   custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
 ========================================================================
 Received Import Request.
-  Time since last request: 322922.681801 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/Editor
-  artifactKey: Guid(ada8a605da138b241a9152b82665891d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/Editor using Guid(ada8a605da138b241a9152b82665891d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'def97266e4fddfa45fc316af77cb46f5') in 0.002472 seconds
+  Time since last request: 81165.529900 seconds.
+  path: Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat
+  artifactKey: Guid(411e93da73d019b449dd53809a652dfa) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
+Start importing Assets/StreamingAssets/ToneTuneToolkit/additionaltools/portreleaser.bat using Guid(411e93da73d019b449dd53809a652dfa) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'ee57dd8f53de9f54f32149f7c697c44a') in 0.010736 seconds
 Number of updated asset objects reloaded before import = 0
-Number of asset objects unloaded after import = 0
-========================================================================
-Received Import Request.
-  Time since last request: 0.869249 seconds.
-  path: Assets/ToneTuneToolkit/Scripts/Editor/CreateAssetBundles.cs
-  artifactKey: Guid(4ed1ab1447390554aaaf09c73660763a) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/ToneTuneToolkit/Scripts/Editor/CreateAssetBundles.cs using Guid(4ed1ab1447390554aaaf09c73660763a) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'ea249121a6be4d1ec333d2316ab526f7') in 0.000385 seconds
-Number of updated asset objects reloaded before import = 0
-Number of asset objects unloaded after import = 0
+Number of asset objects unloaded after import = 1

File diff suppressed because it is too large
+ 383 - 299
ToneTuneToolkit/Logs/AssetImportWorker1-prev.log


+ 58 - 58
ToneTuneToolkit/Logs/AssetImportWorker1.log

@@ -15,7 +15,7 @@ D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 -logFile
 Logs/AssetImportWorker1.log
 -srvPort
-12047
+12569
 Successfully changed project path to: D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
 [UnityMemory] Configuration Parameters - Can be set up in boot.config
@@ -49,12 +49,12 @@ D:/Workflow/Project/Unity/ToneTuneToolkit/ToneTuneToolkit
     "memorysetup-temp-allocator-size-cloud-worker=32768"
     "memorysetup-temp-allocator-size-gi-baking-worker=262144"
     "memorysetup-temp-allocator-size-gfx=262144"
-Player connection [23516] Host "[IP] 172.31.64.1 [Port] 0 [Flags] 2 [Guid] 415784469 [EditorId] 415784469 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]...
+Player connection [38916] Host "[IP] 192.168.1.100 [Port] 0 [Flags] 2 [Guid] 1831763300 [EditorId] 1831763300 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]...
 
-Player connection [23516] Host "[IP] 172.31.64.1 [Port] 0 [Flags] 2 [Guid] 415784469 [EditorId] 415784469 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]...
+Player connection [38916] Host "[IP] 192.168.1.100 [Port] 0 [Flags] 2 [Guid] 1831763300 [EditorId] 1831763300 [Version] 1048832 [Id] WindowsEditor(7,Capsule-Unity) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]...
 
 [Physics::Module] Initialized MultithreadedJobDispatcher with 15 workers.
-Refreshing native plugins compatible for Editor in 7.71 ms, found 3 plugins.
+Refreshing native plugins compatible for Editor in 11.56 ms, found 3 plugins.
 Preloading 0 native plugins for Editor in 0.00 ms.
 Initialize engine version: 2022.3.30f1 (70558241b701)
 [Subsystems] Discovering subsystems at path C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/Resources/UnitySubsystems
@@ -70,7 +70,7 @@ Initialize mono
 Mono path[0] = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/Managed'
 Mono path[1] = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32'
 Mono config path = 'C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/MonoBleedingEdge/etc'
-Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56872
+Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56748
 Begin MonoManager ReloadAssembly
 Registering precompiled unity dll's ...
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
@@ -78,7 +78,7 @@ Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
 Register platform support module: C:/Workflow/Software/Unity/Editor/2022.3.30f1/Editor/Data/PlaybackEngines/MetroSupport/UnityEditor.UWP.Extensions.dll
-Registered in 0.013875 seconds.
+Registered in 0.017139 seconds.
 - Loaded All Assemblies, in  0.410 seconds
 Native extension for UWP target not found
 Native extension for WindowsStandalone target not found
@@ -88,36 +88,36 @@ Native extension for iOS target not found
 Native extension for Android target not found
 Native extension for WebGL target not found
 Mono: successfully reloaded assembly
-- Finished resetting the current domain, in  0.369 seconds
-Domain Reload Profiling: 778ms
-	BeginReloadAssembly (127ms)
+- Finished resetting the current domain, in  0.349 seconds
+Domain Reload Profiling: 758ms
+	BeginReloadAssembly (135ms)
 		ExecutionOrderSort (0ms)
 		DisableScriptedObjects (0ms)
 		BackupInstance (0ms)
 		ReleaseScriptingObjects (0ms)
 		CreateAndSetChildDomain (1ms)
-	RebuildCommonClasses (35ms)
+	RebuildCommonClasses (37ms)
 	RebuildNativeTypeToScriptingClass (10ms)
-	initialDomainReloadingComplete (71ms)
-	LoadAllAssembliesAndSetupDomain (166ms)
-		LoadAssemblies (126ms)
+	initialDomainReloadingComplete (72ms)
+	LoadAllAssembliesAndSetupDomain (154ms)
+		LoadAssemblies (134ms)
 		RebuildTransferFunctionScriptingTraits (0ms)
-		AnalyzeDomain (163ms)
-			TypeCache.Refresh (160ms)
-				TypeCache.ScanAssembly (145ms)
+		AnalyzeDomain (149ms)
+			TypeCache.Refresh (148ms)
+				TypeCache.ScanAssembly (134ms)
 			ScanForSourceGeneratedMonoScriptInfo (0ms)
-			ResolveRequiredComponents (1ms)
-	FinalizeReload (369ms)
+			ResolveRequiredComponents (0ms)
+	FinalizeReload (350ms)
 		ReleaseScriptCaches (0ms)
 		RebuildScriptCaches (0ms)
-		SetupLoadedEditorAssemblies (305ms)
+		SetupLoadedEditorAssemblies (289ms)
 			LogAssemblyErrors (0ms)
 			InitializePlatformSupportModulesInManaged (110ms)
-			SetLoadedEditorAssemblies (6ms)
+			SetLoadedEditorAssemblies (5ms)
 			RefreshPlugins (0ms)
 			BeforeProcessingInitializeOnLoad (2ms)
-			ProcessInitializeOnLoadAttributes (133ms)
-			ProcessInitializeOnLoadMethodAttributes (53ms)
+			ProcessInitializeOnLoadAttributes (123ms)
+			ProcessInitializeOnLoadMethodAttributes (48ms)
 			AfterProcessingInitializeOnLoad (0ms)
 			EditorAssembliesLoaded (0ms)
 		ExecutionOrderSort2 (0ms)
@@ -125,8 +125,8 @@ Domain Reload Profiling: 778ms
 ========================================================================
 Worker process is ready to serve import requests
 Begin MonoManager ReloadAssembly
-- Loaded All Assemblies, in  0.753 seconds
-Refreshing native plugins compatible for Editor in 3.63 ms, found 3 plugins.
+- Loaded All Assemblies, in  0.945 seconds
+Refreshing native plugins compatible for Editor in 2.44 ms, found 3 plugins.
 Native extension for UWP target not found
 Native extension for WindowsStandalone target not found
 Native extension for iOS target not found
@@ -137,47 +137,47 @@ Package Manager log level set to [2]
 [Package Manager] UpmClient::Send -- Unable to send message (not connected to UPM process).
 [Package Manager] Cannot connect to Unity Package Manager local server
 Mono: successfully reloaded assembly
-- Finished resetting the current domain, in  0.650 seconds
-Domain Reload Profiling: 1402ms
-	BeginReloadAssembly (178ms)
+- Finished resetting the current domain, in  0.808 seconds
+Domain Reload Profiling: 1751ms
+	BeginReloadAssembly (168ms)
 		ExecutionOrderSort (0ms)
-		DisableScriptedObjects (11ms)
+		DisableScriptedObjects (9ms)
 		BackupInstance (0ms)
 		ReleaseScriptingObjects (0ms)
-		CreateAndSetChildDomain (30ms)
-	RebuildCommonClasses (35ms)
-	RebuildNativeTypeToScriptingClass (15ms)
-	initialDomainReloadingComplete (37ms)
-	LoadAllAssembliesAndSetupDomain (486ms)
-		LoadAssemblies (361ms)
+		CreateAndSetChildDomain (28ms)
+	RebuildCommonClasses (43ms)
+	RebuildNativeTypeToScriptingClass (18ms)
+	initialDomainReloadingComplete (60ms)
+	LoadAllAssembliesAndSetupDomain (651ms)
+		LoadAssemblies (493ms)
 		RebuildTransferFunctionScriptingTraits (0ms)
-		AnalyzeDomain (221ms)
-			TypeCache.Refresh (192ms)
-				TypeCache.ScanAssembly (172ms)
-			ScanForSourceGeneratedMonoScriptInfo (17ms)
-			ResolveRequiredComponents (8ms)
-	FinalizeReload (650ms)
+		AnalyzeDomain (259ms)
+			TypeCache.Refresh (228ms)
+				TypeCache.ScanAssembly (202ms)
+			ScanForSourceGeneratedMonoScriptInfo (19ms)
+			ResolveRequiredComponents (9ms)
+	FinalizeReload (809ms)
 		ReleaseScriptCaches (0ms)
 		RebuildScriptCaches (0ms)
-		SetupLoadedEditorAssemblies (475ms)
+		SetupLoadedEditorAssemblies (601ms)
 			LogAssemblyErrors (0ms)
-			InitializePlatformSupportModulesInManaged (44ms)
-			SetLoadedEditorAssemblies (3ms)
+			InitializePlatformSupportModulesInManaged (50ms)
+			SetLoadedEditorAssemblies (5ms)
 			RefreshPlugins (0ms)
-			BeforeProcessingInitializeOnLoad (61ms)
-			ProcessInitializeOnLoadAttributes (334ms)
-			ProcessInitializeOnLoadMethodAttributes (21ms)
-			AfterProcessingInitializeOnLoad (10ms)
+			BeforeProcessingInitializeOnLoad (89ms)
+			ProcessInitializeOnLoadAttributes (421ms)
+			ProcessInitializeOnLoadMethodAttributes (27ms)
+			AfterProcessingInitializeOnLoad (8ms)
 			EditorAssembliesLoaded (0ms)
 		ExecutionOrderSort2 (0ms)
-		AwakeInstancesAfterBackupRestoration (11ms)
-Launched and connected shader compiler UnityShaderCompiler.exe after 0.05 seconds
-Refreshing native plugins compatible for Editor in 2.57 ms, found 3 plugins.
+		AwakeInstancesAfterBackupRestoration (9ms)
+Launched and connected shader compiler UnityShaderCompiler.exe after 0.07 seconds
+Refreshing native plugins compatible for Editor in 5.00 ms, found 3 plugins.
 Preloading 0 native plugins for Editor in 0.00 ms.
-Unloading 3206 Unused Serialized files (Serialized files now loaded: 0)
-Unloading 36 unused Assets / (58.7 KB). Loaded Objects now: 3668.
-Memory consumption went from 127.7 MB to 127.6 MB.
-Total: 6.715400 ms (FindLiveObjects: 0.413300 ms CreateObjectMapping: 0.208100 ms MarkObjects: 5.793500 ms  DeleteObjects: 0.298400 ms)
+Unloading 3208 Unused Serialized files (Serialized files now loaded: 0)
+Unloading 36 unused Assets / (59.0 KB). Loaded Objects now: 3670.
+Memory consumption went from 127.8 MB to 127.7 MB.
+Total: 5.334100 ms (FindLiveObjects: 0.329500 ms CreateObjectMapping: 0.376400 ms MarkObjects: 4.469000 ms  DeleteObjects: 0.157900 ms)
 
 AssetImportParameters requested are different than current active one (requested -> active):
   custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> 
@@ -194,9 +194,9 @@ AssetImportParameters requested are different than current active one (requested
   custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> 
 ========================================================================
 Received Import Request.
-  Time since last request: 322920.074116 seconds.
-  path: Assets/StreamingAssets/ToneTuneToolkit
-  artifactKey: Guid(45971226eaca30d45bb2867324d1141d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
-Start importing Assets/StreamingAssets/ToneTuneToolkit using Guid(45971226eaca30d45bb2867324d1141d) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: '7f972c3ec29e90f6eef8d2feb4a41e7c') in 0.002881 seconds
+  Time since last request: 81126.982969 seconds.
+  path: Assets/StreamingAssets/ToneTuneToolkit/additionaltools
+  artifactKey: Guid(a088443807821a04498283499b4beb3c) Importer(815301076,1909f56bfc062723c751e8b465ee728b)
+Start importing Assets/StreamingAssets/ToneTuneToolkit/additionaltools using Guid(a088443807821a04498283499b4beb3c) Importer(815301076,1909f56bfc062723c751e8b465ee728b)  -> (artifact id: 'e2a4660e66588e1e00d1aa4f976961fd') in 0.003881 seconds
 Number of updated asset objects reloaded before import = 0
 Number of asset objects unloaded after import = 0

+ 45 - 45
ToneTuneToolkit/UserSettings/Layouts/default-2022.dwlt

@@ -41,7 +41,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 569.6
+    width: 565.6
     height: 1018.80005
   m_MinSize: {x: 201, y: 221}
   m_MaxSize: {x: 4001, y: 4021}
@@ -69,7 +69,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 1304.8
+    width: 1300.8
     height: 1018.80005
   m_MinSize: {x: 200, y: 50}
   m_MaxSize: {x: 16192, y: 8096}
@@ -150,7 +150,7 @@ MonoBehaviour:
   m_MinSize: {x: 400, y: 100}
   m_MaxSize: {x: 32384, y: 16192}
   vertical: 0
-  controlID: 115
+  controlID: 111
 --- !u!114 &7
 MonoBehaviour:
   m_ObjectHideFlags: 52
@@ -187,7 +187,7 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 569.6
+    x: 565.6
     y: 0
     width: 735.2001
     height: 1018.80005
@@ -215,14 +215,14 @@ MonoBehaviour:
   - {fileID: 12}
   m_Position:
     serializedVersion: 2
-    x: 1304.8
+    x: 1300.8
     y: 0
     width: 723.19995
     height: 1018.80005
   m_MinSize: {x: 100, y: 100}
   m_MaxSize: {x: 8096, y: 16192}
   vertical: 1
-  controlID: 69
+  controlID: 112
 --- !u!114 &10
 MonoBehaviour:
   m_ObjectHideFlags: 52
@@ -238,9 +238,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 2028
+    x: 2024
     y: 0
-    width: 724
+    width: 728
     height: 1018.80005
   m_MinSize: {x: 276, y: 71}
   m_MaxSize: {x: 4001, y: 4021}
@@ -267,7 +267,7 @@ MonoBehaviour:
     x: 0
     y: 0
     width: 723.19995
-    height: 448.8
+    height: 448
   m_MinSize: {x: 202, y: 221}
   m_MaxSize: {x: 4002, y: 4021}
   m_ActualView: {fileID: 18}
@@ -291,9 +291,9 @@ MonoBehaviour:
   m_Position:
     serializedVersion: 2
     x: 0
-    y: 448.8
+    y: 448
     width: 723.19995
-    height: 570.00006
+    height: 570.80005
   m_MinSize: {x: 232, y: 271}
   m_MaxSize: {x: 10002, y: 10021}
   m_ActualView: {fileID: 15}
@@ -322,10 +322,10 @@ MonoBehaviour:
     m_Tooltip: 
   m_Pos:
     serializedVersion: 2
-    x: 1304.8
-    y: 522.4
+    x: 1300.8
+    y: 521.60004
     width: 721.19995
-    height: 549.00006
+    height: 549.80005
   m_SerializedDataModeController:
     m_DataMode: 0
     m_PreferredDataMode: 0
@@ -356,9 +356,9 @@ MonoBehaviour:
     m_Tooltip: 
   m_Pos:
     serializedVersion: 2
-    x: 2028
+    x: 2024
     y: 73.6
-    width: 723
+    width: 727
     height: 997.80005
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -403,10 +403,10 @@ MonoBehaviour:
     m_Tooltip: 
   m_Pos:
     serializedVersion: 2
-    x: 1304.8
-    y: 522.4
+    x: 1300.8
+    y: 521.60004
     width: 721.19995
-    height: 549.00006
+    height: 549.80005
   m_SerializedDataModeController:
     m_DataMode: 0
     m_PreferredDataMode: 0
@@ -428,7 +428,7 @@ MonoBehaviour:
     m_SkipHidden: 0
     m_SearchArea: 1
     m_Folders:
-    - Assets/ToneTuneToolkit/Scripts/Editor
+    - Assets/ToneTuneToolkit/Scripts/UDP
     m_Globs: []
     m_OriginalText: 
     m_ImportLogFlags: 0
@@ -436,16 +436,16 @@ MonoBehaviour:
   m_ViewMode: 1
   m_StartGridSize: 16
   m_LastFolders:
-  - Assets/ToneTuneToolkit/Scripts/Editor
+  - Assets/ToneTuneToolkit/Scripts/UDP
   m_LastFoldersGridSize: 16
   m_LastProjectPath: D:\Workflow\Project\Unity\ToneTuneToolkit\ToneTuneToolkit
   m_LockTracker:
     m_IsLocked: 0
   m_FolderTreeState:
     scrollPos: {x: 0, y: 0}
-    m_SelectedIDs: 525b0000
-    m_LastClickedID: 23378
-    m_ExpandedIDs: 00000000e85a0000ea5a0000fc5a0000fe5a0000045b0000
+    m_SelectedIDs: 065b0000
+    m_LastClickedID: 23302
+    m_ExpandedIDs: 00000000ec5a0000ee5a0000025b0000045b0000085b0000325b0000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -473,7 +473,7 @@ MonoBehaviour:
     scrollPos: {x: 0, y: 0}
     m_SelectedIDs: 
     m_LastClickedID: 0
-    m_ExpandedIDs: 00000000e85a0000ea5a0000
+    m_ExpandedIDs: 00000000ec5a0000ee5a0000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -551,7 +551,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 73.6
-    width: 568.6
+    width: 564.6
     height: 997.80005
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -569,7 +569,7 @@ MonoBehaviour:
   m_ShowGizmos: 0
   m_TargetDisplay: 0
   m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
-  m_TargetSize: {x: 2048, y: 1536}
+  m_TargetSize: {x: 1408, y: 768}
   m_TextureFilterMode: 0
   m_TextureHideFlags: 61
   m_RenderIMGUI: 1
@@ -578,16 +578,16 @@ MonoBehaviour:
   m_VSyncEnabled: 0
   m_Gizmos: 0
   m_Stats: 0
-  m_SelectedSizes: 0f000000000000000000000000000000000000000000000000000000000000000000000000000000
+  m_SelectedSizes: 0e000000000000000000000000000000000000000000000000000000000000000000000000000000
   m_ZoomArea:
     m_HRangeLocked: 0
     m_VRangeLocked: 0
     hZoomLockedByDefault: 0
     vZoomLockedByDefault: 0
-    m_HBaseRangeMin: -819.2
-    m_HBaseRangeMax: 819.2
-    m_VBaseRangeMin: -614.4
-    m_VBaseRangeMax: 614.4
+    m_HBaseRangeMin: -563.2
+    m_HBaseRangeMax: 563.2
+    m_VBaseRangeMin: -307.2
+    m_VBaseRangeMax: 307.2
     m_HAllowExceedBaseRangeMin: 1
     m_HAllowExceedBaseRangeMax: 1
     m_VAllowExceedBaseRangeMin: 1
@@ -605,23 +605,23 @@ MonoBehaviour:
       serializedVersion: 2
       x: 0
       y: 21
-      width: 568.6
+      width: 564.6
       height: 976.80005
-    m_Scale: {x: 0.34704587, y: 0.34704587}
-    m_Translation: {x: 284.3, y: 488.40005}
+    m_Scale: {x: 0.5012429, y: 0.5012429}
+    m_Translation: {x: 282.3, y: 488.40002}
     m_MarginLeft: 0
     m_MarginRight: 0
     m_MarginTop: 0
     m_MarginBottom: 0
     m_LastShownAreaInsideMargins:
       serializedVersion: 2
-      x: -819.2
-      y: -1407.3069
-      width: 1638.4
-      height: 2814.6138
+      x: -563.2
+      y: -974.378
+      width: 1126.4
+      height: 1948.756
     m_MinimalGUI: 1
-  m_defaultScale: 0.34704587
-  m_LastWindowPixelSize: {x: 710.75, y: 1247.25}
+  m_defaultScale: 0.5012429
+  m_LastWindowPixelSize: {x: 705.75, y: 1247.25}
   m_ClearInEditMode: 1
   m_NoCameraWarning: 1
   m_LowResolutionForAspectRatios: 00000000000000000000
@@ -647,7 +647,7 @@ MonoBehaviour:
     m_Tooltip: 
   m_Pos:
     serializedVersion: 2
-    x: 569.60004
+    x: 565.60004
     y: 73.6
     width: 733.2001
     height: 997.80005
@@ -1108,10 +1108,10 @@ MonoBehaviour:
     m_Tooltip: 
   m_Pos:
     serializedVersion: 2
-    x: 1304.8
+    x: 1300.8
     y: 73.6
     width: 721.19995
-    height: 427.8
+    height: 427
   m_SerializedDataModeController:
     m_DataMode: 0
     m_PreferredDataMode: 0
@@ -1125,7 +1125,7 @@ MonoBehaviour:
   m_SceneHierarchy:
     m_TreeViewState:
       scrollPos: {x: 0, y: 0}
-      m_SelectedIDs: a24a0000
+      m_SelectedIDs: 68490000
       m_LastClickedID: 0
       m_ExpandedIDs: 2cfbffff
       m_RenameOverlay:

Some files were not shown because too many files changed in this diff