diff --git a/Assets/Art/UIPrefab/UI3DObjShow.prefab b/Assets/Art/UIPrefab/UI3DObjShow.prefab index 06410a52..b6e0a459 100644 --- a/Assets/Art/UIPrefab/UI3DObjShow.prefab +++ b/Assets/Art/UIPrefab/UI3DObjShow.prefab @@ -338,7 +338,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -378,6 +378,7 @@ GameObject: - component: {fileID: 1915876869541640623} - component: {fileID: 7277770534815806214} - component: {fileID: 5964642934946449171} + - component: {fileID: 5887092968505518654} m_Layer: 0 m_Name: Right m_TagString: Untagged @@ -443,6 +444,22 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5887092968505518654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1587529206278800681} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: + CustomComment: + mComponentName: UnityEngine.UI.Image --- !u!1 &3408871029033640143 GameObject: m_ObjectHideFlags: 0 @@ -743,8 +760,9 @@ GameObject: - component: {fileID: 826586917723392204} - component: {fileID: 1954549762747143972} - component: {fileID: 2228057524689582266} + - component: {fileID: 4892270682288098217} m_Layer: 0 - m_Name: Bg + m_Name: ObjBg m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -791,7 +809,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -804,6 +822,22 @@ MonoBehaviour: y: 0 width: 1 height: 1 +--- !u!114 &4892270682288098217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6704188004419676826} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: + CustomComment: + mComponentName: UnityEngine.UI.RawImage --- !u!1 &6831573971870136393 GameObject: m_ObjectHideFlags: 0 @@ -967,8 +1001,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2922fa71b7d60e942b5b06b785dc37c0, type: 3} m_Name: m_EditorClassIdentifier: + Right: {fileID: 5964642934946449171} Scroll: {fileID: 4147329925826600491} Content: {fileID: 7417210800730282872} + ObjBg: {fileID: 2228057524689582266} DeviceRawImage: {fileID: 7397484820841873523} ItemPrefab: {fileID: 1826394720132835709} --- !u!1 &7986150287571393044 diff --git a/Assets/Art/UITextures/UIInstruction/操作说明.png b/Assets/Art/UITextures/UIInstruction/操作说明.png index 78f3ae1d..2bce25f6 100644 Binary files a/Assets/Art/UITextures/UIInstruction/操作说明.png and b/Assets/Art/UITextures/UIInstruction/操作说明.png differ diff --git a/Assets/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs b/Assets/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs index 1b035b97..a8c12a15 100644 --- a/Assets/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs +++ b/Assets/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs @@ -303,15 +303,22 @@ namespace HighlightPlus { } void OnMouseEnter() { + if (isActiveAndEnabled && triggerMode == TriggerMode.ColliderEventsOnlyOnThisObject) { if (!CanInteract()) return; + Debug.Log("进入"); + hb.outline = 1; Highlight(true); } } void OnMouseExit() { + + if (isActiveAndEnabled && triggerMode == TriggerMode.ColliderEventsOnlyOnThisObject) { if (!CanInteract()) return; + Debug.Log("退出"); + hb.outline = 1; Highlight(false); } } diff --git a/Assets/Plugins/System.Windows.Forms.dll b/Assets/Plugins/System.Windows.Forms.dll deleted file mode 100644 index 3a6eff82..00000000 Binary files a/Assets/Plugins/System.Windows.Forms.dll and /dev/null differ diff --git a/Assets/Plugins/System.Windows.Forms.dll.meta b/Assets/Plugins/System.Windows.Forms.dll.meta deleted file mode 100644 index 278d5520..00000000 --- a/Assets/Plugins/System.Windows.Forms.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 82549cd4bc10d654d876aaf0f7f4b64d -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index eb6c1419..f1d7f777 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -79,8 +79,9 @@ namespace QFramework int.TryParse(frame, out curFrame); anim.clip = anim[animName].clip; anim[animName].time = curFrame / anim.clip.frameRate; - anim[animName].speed = 0; anim.Play(animName); + anim[animName].speed = 0; + anim.Sample(); this.Finish(); } else diff --git a/Assets/Scripts/Actions/TimeLineAction.cs b/Assets/Scripts/Actions/TimeLineAction.cs index 1ba467fd..817604e0 100644 --- a/Assets/Scripts/Actions/TimeLineAction.cs +++ b/Assets/Scripts/Actions/TimeLineAction.cs @@ -64,6 +64,7 @@ public class TimeLineAction : IAction { play.Stop(); play.time = curEndFrame / 24; + play.Evaluate(); } if (play.state != PlayState.Playing) { @@ -109,17 +110,31 @@ public class TimeLineAction : IAction { curSpeed = 1; } - if (!play.playableGraph.IsValid()) - { - play.RebuildGraph(); - } - play.playableGraph.GetRootPlayable(0).SetSpeed(curSpeed); - play.Play(); + if (string.IsNullOrEmpty(endFrame) == false) { float.TryParse(endFrame, out curEndFrame); } + + if (!play.playableGraph.IsValid()) + { + play.RebuildGraph(); + } + if (curFrame == curEndFrame) + { + play.time = curEndFrame / 24; + play.Evaluate(); + Finished(); + } + else + { + + play.playableGraph.GetRootPlayable(0).SetSpeed(curSpeed); + play.Play(); + } + + bool iswait = true; bool.TryParse(isWait, out iswait); if (iswait == false) diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 13dff345..144067df 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -18,7 +18,8 @@ public class DeviceItem : MonoBehaviour { var effect = gameObject.GetOrAddComponent(); gameObject.GetOrAddComponent(); - effect.outlineColor = Color.green; + //ȡxmlɫת + effect.outlineColor = Utility.ToColor(device.HighColor); StringEventSystem.Global.Register(Global.HighLightTrigger, OnHighLightTriggerEvent); TypeEventSystem.Global.Register(OnStepChanged); } diff --git a/Assets/Scripts/Tools/AsposeHelper.cs b/Assets/Scripts/Tools/AsposeHelper.cs index f0bafae1..2fdf7b4a 100644 --- a/Assets/Scripts/Tools/AsposeHelper.cs +++ b/Assets/Scripts/Tools/AsposeHelper.cs @@ -1,17 +1,15 @@ using Aspose.Words; using Aspose.Words.Replacing; -using QFramework; -using System.IO; using UnityEngine; -using System.Windows.Forms; using Newtonsoft.Json.Linq; using System; +using System.IO; public class AsposeHelper : MonoBehaviour { - public static void Writer(string json, Action callback = null) + public static void Writer(string json, Action callback = null) { // Wordĵ Document doc = new Document(Global.reportDemoPath); @@ -24,25 +22,32 @@ public class AsposeHelper : MonoBehaviour string value = property.Value.ToString(); doc.Range.Replace($"{{{key}}}", $"{value}", new FindReplaceOptions()); } + + string filePath = ChinarFileController.SaveProject(Path.GetFileName(Global.reportDemoPath).Split('.')[1]); + if (string.IsNullOrEmpty(filePath) == false) + { + doc.Save(filePath); + } + callback?.Invoke(); // 滻ı - SaveWithDialog(doc, callback); + //SaveWithDialog(doc, callback); //Debug.Log("ĵɣĵѱ浽: " + outputFilePath); } - private static void SaveWithDialog(Document doc, Action callback) - { - SaveFileDialog dialog = new SaveFileDialog(); - dialog.Filter = "Wordĵ|*.docx"; - var result = dialog.ShowDialog(); - if (result == DialogResult.OK) - { - doc.Save(dialog.FileName); - } - callback?.Invoke(result); - } + //private static void SaveWithDialog(Document doc, Action callback) + //{ + // SaveFileDialog dialog = new SaveFileDialog(); + // dialog.Filter = "Wordĵ|*.docx"; + // var result = dialog.ShowDialog(); + // if (result == DialogResult.OK) + // { + // doc.Save(dialog.FileName); + // } + // callback?.Invoke(result); + //} } diff --git a/Assets/Scripts/Tools/ChinarFileController.cs b/Assets/Scripts/Tools/ChinarFileController.cs new file mode 100644 index 00000000..1e6c7dc0 --- /dev/null +++ b/Assets/Scripts/Tools/ChinarFileController.cs @@ -0,0 +1,65 @@ +using UnityEngine; +using System.Runtime.InteropServices; +using System; + + +/// +/// ļƽű +/// +public class ChinarFileController : MonoBehaviour +{ + /// + /// Ŀ + /// + public static string OpenProject() + { + string originalDir = Environment.CurrentDirectory; + string filepath = string.Empty; + OpenFileDlg pth = new OpenFileDlg(); + pth.structSize = Marshal.SizeOf(pth); + // ʽƳĩβߣ + //pth.filter = @"All Files (*.*)|*.jpg"; + pth.file = new string(new char[256]); + pth.maxFile = pth.file.Length; + pth.fileTitle = new string(new char[64]); + pth.maxFileTitle = pth.fileTitle.Length; + pth.initialDir = Application.dataPath.Replace("/", "\\") + "\\Resources"; + pth.title = "Ŀ"; + pth.defExt = "dat"; + // Flagsãؼѡ + pth.flags = 0x00080000 | 0x00001000 | 0x00000800; // OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST + + if (OpenFileDialog.GetOpenFileName(pth)) + { + filepath = pth.file; + } + Environment.CurrentDirectory = originalDir; + return filepath; + } + + + /// + /// ļĿ + /// + public static string SaveProject(string ext) + { + string filepath = string.Empty; + SaveFileDlg pth = new SaveFileDlg(); + pth.structSize = Marshal.SizeOf(pth); + pth.filter = "All files (*.*)|*.*"; + pth.file = new string(new char[256]); + pth.maxFile = pth.file.Length; + pth.fileTitle = new string(new char[64]); + pth.maxFileTitle = pth.fileTitle.Length; + pth.initialDir = Application.dataPath; //Ĭ· + pth.title = "Ŀ"; + pth.defExt = ext; + pth.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008; + if (SaveFileDialog.GetSaveFileName(pth)) + { + filepath = pth.file; //ѡļ·; + } + return filepath; + } +} + diff --git a/Assets/Scripts/Tools/ChinarFileController.cs.meta b/Assets/Scripts/Tools/ChinarFileController.cs.meta new file mode 100644 index 00000000..bf809f53 --- /dev/null +++ b/Assets/Scripts/Tools/ChinarFileController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ff1bbdf3a991ec45bbf4e8be1ca5b91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tools/ChinarFileDlog.cs b/Assets/Scripts/Tools/ChinarFileDlog.cs new file mode 100644 index 00000000..607f0996 --- /dev/null +++ b/Assets/Scripts/Tools/ChinarFileDlog.cs @@ -0,0 +1,57 @@ +using System.Runtime.InteropServices; +using System; + + +/// +/// ļ־ +/// +// [(.,ַ=ַ.Զ)] +[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] +public class ChinarFileDlog +{ + public int structSize = 0; + public IntPtr dlgOwner = IntPtr.Zero; + public IntPtr instance = IntPtr.Zero; + public String filter = null; + public String customFilter = null; + public int maxCustFilter = 0; + public int filterIndex = 0; + public String file = null; + public int maxFile = 0; + public String fileTitle = null; + public int maxFileTitle = 0; + public String initialDir = null; + public String title = null; + public int flags = 0; + public short fileOffset = 0; + public short fileExtension = 0; + public String defExt = null; + public IntPtr custData = IntPtr.Zero; + public IntPtr hook = IntPtr.Zero; + public String templateName = null; + public IntPtr reservedPtr = IntPtr.Zero; + public int reservedInt = 0; + public int flagsEx = 0; +} + +[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] +public class OpenFileDlg : ChinarFileDlog +{ +} + +public class OpenFileDialog +{ + [DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)] + public static extern bool GetOpenFileName([In, Out] OpenFileDlg ofd); +} + +public class SaveFileDialog +{ + [DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)] + public static extern bool GetSaveFileName([In, Out] SaveFileDlg ofd); +} + +[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] +public class SaveFileDlg : ChinarFileDlog +{ +} \ No newline at end of file diff --git a/Assets/Scripts/Tools/ChinarFileDlog.cs.meta b/Assets/Scripts/Tools/ChinarFileDlog.cs.meta new file mode 100644 index 00000000..8b41be2c --- /dev/null +++ b/Assets/Scripts/Tools/ChinarFileDlog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9824f58b2cf6cc64ab2ef5d8ec6153b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/UI3DObjShow.Designer.cs b/Assets/Scripts/UI/UI3DObjShow.Designer.cs index 5c81badf..d47d23c8 100644 --- a/Assets/Scripts/UI/UI3DObjShow.Designer.cs +++ b/Assets/Scripts/UI/UI3DObjShow.Designer.cs @@ -5,16 +5,20 @@ using QFramework; namespace QFramework.Example { - // Generate Id:5590b0b6-d056-4a95-a14d-4e5b14aedaac + // Generate Id:1419ca94-de6c-4a9d-9a3d-b2f838aea3ba public partial class UI3DObjShow { public const string Name = "UI3DObjShow"; + [SerializeField] + public UnityEngine.UI.Image Right; [SerializeField] public UnityEngine.UI.ScrollRect Scroll; [SerializeField] public RectTransform Content; [SerializeField] + public UnityEngine.UI.RawImage ObjBg; + [SerializeField] public UnityEngine.UI.RawImage DeviceRawImage; [SerializeField] public UnityEngine.UI.Image ItemPrefab; @@ -23,8 +27,10 @@ namespace QFramework.Example protected override void ClearUIComponents() { + Right = null; Scroll = null; Content = null; + ObjBg = null; DeviceRawImage = null; ItemPrefab = null; diff --git a/Assets/Scripts/UI/UI3DObjShow.cs b/Assets/Scripts/UI/UI3DObjShow.cs index 8c01c049..c4058761 100644 --- a/Assets/Scripts/UI/UI3DObjShow.cs +++ b/Assets/Scripts/UI/UI3DObjShow.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using TMPro; using GCSeries.Core; using UnityEngine.EventSystems; +using System; namespace QFramework.Example { @@ -82,8 +83,14 @@ namespace QFramework.Example }); } - loader.LoadAsync(); + loader.LoadAsync(() => + { + Right.gameObject.SetActive(mData.datas.Count > 1); + Content.GetChild(0).GetComponent().isOn = true; + }); } + + protected override void OnShow() { } diff --git a/Assets/Scripts/UI/UIScore.cs b/Assets/Scripts/UI/UIScore.cs index f6f3bbb5..30dfd68d 100644 --- a/Assets/Scripts/UI/UIScore.cs +++ b/Assets/Scripts/UI/UIScore.cs @@ -40,7 +40,7 @@ namespace QFramework.Example loader.LoadAsync(); #elif UNITY_STANDALONE_WIN DownLoad.interactable = false; - AsposeHelper.Writer(GetScoreDataJson(), result => + AsposeHelper.Writer(GetScoreDataJson(), () => { DownLoad.interactable = true; });