Merge remote-tracking branch 'origin/master' into LouDi_Pig

This commit is contained in:
李浩 2025-03-01 12:49:55 +08:00
commit a33bcffedf
9 changed files with 47 additions and 19 deletions

View File

@ -652,8 +652,8 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Padding: m_Padding:
m_Left: 0 m_Left: 20
m_Right: 0 m_Right: 20
m_Top: 20 m_Top: 20
m_Bottom: 0 m_Bottom: 0
m_ChildAlignment: 1 m_ChildAlignment: 1

View File

@ -83,6 +83,10 @@ public class ScoreController : MonoSingleton<ScoreController>
scoreDict[key].value = 0; scoreDict[key].value = 0;
} }
} }
else
{
Debug.LogError("没有找到 评分点:" + key);
}
} }

View File

@ -39,12 +39,12 @@ public class TimeScaleController : MonoBehaviour
} }
if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
{ {
if (Input.GetKeyDown(KeyCode.Q)) if (Input.GetKeyDown(KeyCode.C))
{ {
string str = string.Empty; string str = string.Empty;
str = $"{gameObject.transform.position}|{gameObject.transform.eulerAngles}"; str = $"{gameObject.transform.position}|{gameObject.transform.eulerAngles}";
#if UNITY_WEBGL #if UNITY_WEBGL
Debug.Log("Ctrl + Q 被按下!"); Debug.Log("Ctrl + Q 被按下!"+str);
CopyToClipboard(str); CopyToClipboard(str);
#elif UNITY_STANDALONE_WIN && !UNITY_EDITOR #elif UNITY_STANDALONE_WIN && !UNITY_EDITOR
// ʾÀýÊý¾Ý // ʾÀýÊý¾Ý
@ -53,18 +53,14 @@ public class TimeScaleController : MonoBehaviour
#endif #endif
} }
#if UNITY_STANDALONE_WIN &&!UNITY_EDITOR #if UNITY_STANDALONE_WIN &&!UNITY_EDITOR
if (Input.GetKeyDown(KeyCode.E)) if (Input.GetKeyDown(KeyCode.V))
{ {
string tmp = GUIUtility.systemCopyBuffer; string tmp = GUIUtility.systemCopyBuffer;
Debug.LogError("当前剪贴板:" + tmp); Debug.Log("当前剪贴板:" + tmp);
tmp = tmp.Replace("(", ""); tmp = tmp.Replace("(", "");
Debug.LogError(tmp);
tmp = tmp.Replace(")", ""); tmp = tmp.Replace(")", "");
Debug.LogError(tmp);
var datas = tmp.Split('|'); var datas = tmp.Split('|');
Debug.LogError(datas[0]);
Debug.LogError(datas[1]);
gameObject.transform.position = Utility.GetVector3FromStrArray(datas[0]); gameObject.transform.position = Utility.GetVector3FromStrArray(datas[0]);
gameObject.transform.eulerAngles = Utility.GetVector3FromStrArray(datas[1]); gameObject.transform.eulerAngles = Utility.GetVector3FromStrArray(datas[1]);
} }

View File

@ -5,14 +5,14 @@ using System.IO;
using UnityEngine; using UnityEngine;
using System.Windows.Forms; using System.Windows.Forms;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System;
public class AsposeHelper : MonoBehaviour public class AsposeHelper : MonoBehaviour
{ {
public static void Writer(string json) public static void Writer(string json, Action<DialogResult> callback = null)
{ {
Debug.LogError(File.Exists(Global.reportDemoPath));
// 加载Word文档 // 加载Word文档
Document doc = new Document(Global.reportDemoPath); Document doc = new Document(Global.reportDemoPath);
@ -25,21 +25,23 @@ public class AsposeHelper : MonoBehaviour
doc.Range.Replace($"{{{key}}}", $"{value}", new FindReplaceOptions()); doc.Range.Replace($"{{{key}}}", $"{value}", new FindReplaceOptions());
} }
// 替换文本 // 替换文本
SaveWithDialog(doc); SaveWithDialog(doc, callback);
//Debug.Log("文档处理完成,新文档已保存到: " + outputFilePath); //Debug.Log("文档处理完成,新文档已保存到: " + outputFilePath);
} }
private static void SaveWithDialog(Document doc) private static void SaveWithDialog(Document doc, Action<DialogResult> callback)
{ {
SaveFileDialog dialog = new SaveFileDialog(); SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "Word文档|*.docx"; dialog.Filter = "Word文档|*.docx";
if (dialog.ShowDialog() == DialogResult.OK) var result = dialog.ShowDialog();
if (result == DialogResult.OK)
{ {
doc.Save(dialog.FileName); doc.Save(dialog.FileName);
} }
callback?.Invoke(result);
} }
} }

View File

@ -21,6 +21,7 @@ namespace QFramework.Example
} }
public partial class UICameraSwitch : UIPanel public partial class UICameraSwitch : UIPanel
{ {
bool firstFreeMove = true;
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
@ -114,6 +115,14 @@ namespace QFramework.Example
{ {
Near.isOn = false; Near.isOn = false;
Far.isOn = false; Far.isOn = false;
if (firstFreeMove)
{
UITipWindowData data = new UITipWindowData();
data.txt = "已切换至自由移动视角,点右下角按钮可回到预制视角。";
data.btns.Add(new UITipWindowData.ItemData() { txt = "确定" });
UIKit.OpenPanelAsync<UITipWindow>(canvasLevel: UILevel.PopUI, uiData: data).ToAction().StartGlobal();
firstFreeMove = false;
}
} }
} }

View File

@ -13,6 +13,7 @@ namespace QFramework.Example
public partial class UIInstruction : UIPanel public partial class UIInstruction : UIPanel
{ {
bool isNo = false; bool isNo = false;
bool isOperation = false;
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
@ -46,8 +47,17 @@ namespace QFramework.Example
}); });
ConfirmBtn.onClick.AddListener(() => ConfirmBtn.onClick.AddListener(() =>
{ {
Hide(); if (isOperation == false)
isNo = NoToggle.isOn; {
Operation.isOn = true;
isOperation = true;
}
else
{
Hide();
isNo = NoToggle.isOn;
}
}); });
@ -82,6 +92,7 @@ namespace QFramework.Example
protected override void OnHide() protected override void OnHide()
{ {
mData = null; mData = null;
StringEventSystem.Global.Send(this.GetType().Name + "Hide");
} }
protected override void OnClose() protected override void OnClose()

View File

@ -36,7 +36,12 @@ namespace QFramework.Example
}); });
loader.LoadAsync(); loader.LoadAsync();
#elif UNITY_STANDALONE_WIN #elif UNITY_STANDALONE_WIN
AsposeHelper.Writer(GetScoreDataJson()); DownLoad.interactable = false;
AsposeHelper.Writer(GetScoreDataJson(), result =>
{
Debug.LogError("111");
DownLoad.interactable = true;
});
#endif #endif

View File

@ -42,6 +42,7 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null) protected override void OnOpen(IUIData uiData = null)
{ {
mData = uiData as UIToolsData ?? new UIToolsData();
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject); TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
if (mData.totalScore > 0) if (mData.totalScore > 0)
{ {

View File

@ -265,7 +265,7 @@ namespace XMLTool
// 解析模块名称 // 解析模块名称
module.type = moduleElement.Element("Type")?.Value; module.type = moduleElement.Element("Type")?.Value;
module.ModuleName = moduleElement.Element("Name")?.Value; module.ModuleName = moduleElement.Element("Name")?.Value;
module.Descript = moduleElement.Element("Descript")?.Value; module.Descript = moduleElement.Element("Descript")?.Value.Trim();
module.Scene = moduleElement.Element("Scene")?.Value; module.Scene = moduleElement.Element("Scene")?.Value;
// 解析设备 // 解析设备