From 0a2ce83bea8fd8bc358eea2ac847a6bd55754982 Mon Sep 17 00:00:00 2001 From: huqibin <762612145@qq.com> Date: Tue, 6 May 2025 15:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/HQB/ToolFuncManager.cs | 26 +++++++++++++++++++ Assets/Template/Scripts/HQB/SecurityCheck.cs | 3 +-- .../Scripts/Project/Manager/DataManager.cs | 2 +- .../Project/UI/UI_Panel/UI_MainTitlePanel.cs | 16 +----------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Assets/Scripts/HQB/ToolFuncManager.cs b/Assets/Scripts/HQB/ToolFuncManager.cs index 4f8f1e6..5181e0d 100644 --- a/Assets/Scripts/HQB/ToolFuncManager.cs +++ b/Assets/Scripts/HQB/ToolFuncManager.cs @@ -1,4 +1,5 @@ using DG.Tweening; +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -92,4 +93,29 @@ public class ToolFuncManager : MonoBehaviour image.color = finalColor; }).SetLoops(-1, LoopType.Yoyo);//HQB 原始数值:1,0. } + + public static Vector3 Parse(string vectorString) + { + if (vectorString.StartsWith("(") && vectorString.EndsWith(")")) + { + vectorString = vectorString.Substring(1, vectorString.Length - 2); + } + + // 分割字符串,假设格式是 "x,y,z" + string[] parts = vectorString.Split(','); + + // 确保字符串包含三个部分 + if (parts.Length != 3) + { + throw new FormatException("Input string is not in a valid Vector3 format."); + } + + // 解析浮点数 + float x = float.Parse(parts[0].Trim()); + float y = float.Parse(parts[1].Trim()); + float z = float.Parse(parts[2].Trim()); + + // 返回新的Vector3对象 + return new Vector3(x, y, z); + } } diff --git a/Assets/Template/Scripts/HQB/SecurityCheck.cs b/Assets/Template/Scripts/HQB/SecurityCheck.cs index cf90e56..9157171 100644 --- a/Assets/Template/Scripts/HQB/SecurityCheck.cs +++ b/Assets/Template/Scripts/HQB/SecurityCheck.cs @@ -36,7 +36,6 @@ public class SecurityCheck : MonoBehaviour public bool ForcePassBlack = true; #endif - // 获取文件哈希值的方法 private string GetHash(string path) { @@ -128,7 +127,7 @@ public class SecurityCheck : MonoBehaviour #if UNITY_EDITOR if (ForcePassBlack) result = true; -#endif +#endif } private void Awake() diff --git a/Assets/Template/Scripts/Project/Manager/DataManager.cs b/Assets/Template/Scripts/Project/Manager/DataManager.cs index cfff10d..38399cb 100644 --- a/Assets/Template/Scripts/Project/Manager/DataManager.cs +++ b/Assets/Template/Scripts/Project/Manager/DataManager.cs @@ -110,7 +110,7 @@ public class DataManager : BaseManager toolAndMaterialDic.Add(tB_ToolAndMaterial.id, tB_ToolAndMaterial); } } - private void ReadSubecjtXML(string path) + public void ReadSubecjtXML(string path) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(path); diff --git a/Assets/Template/Scripts/Project/UI/UI_Panel/UI_MainTitlePanel.cs b/Assets/Template/Scripts/Project/UI/UI_Panel/UI_MainTitlePanel.cs index 8a7fc9f..59e81b7 100644 --- a/Assets/Template/Scripts/Project/UI/UI_Panel/UI_MainTitlePanel.cs +++ b/Assets/Template/Scripts/Project/UI/UI_Panel/UI_MainTitlePanel.cs @@ -72,7 +72,7 @@ public class UI_MainTitlePanel : BasePanel modelText.text = mode; } - private void InitializationUI() + public void InitializationUI() { GetControl