From fe46514e739da52dbb26e878bf5aae380752b6a6 Mon Sep 17 00:00:00 2001 From: TRAfoer Date: Sun, 11 May 2025 14:12:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=90=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/ComplexSurfaceGenerator.cs | 21 ++--- Assets/Scenes/StartMenu.unity | 79 ++++++++++++++++++- .../Scripts/DynamicUI/Hierarchy/Hierarchy.cs | 16 +++- .../DynamicUI/Hierarchy/HierarchyTab.cs | 2 +- .../EditorSubmodules/SelectSubmodule.cs | 13 +-- Assets/Scripts/Manager/OperationManager.cs | 2 +- Assets/Scripts/Manager/ThemeBundleManager.cs | 1 + Assets/Scripts/Sample Assiant/SampleWindow.cs | 10 +-- Assets/Scripts/StartMenu/LoadProjectModule.cs | 7 +- Assets/Scripts/StartMenu/LoadProjectTab.cs | 7 +- .../NoteEffect/DTMNoteGenerateExpand.cs | 12 +-- 11 files changed, 134 insertions(+), 36 deletions(-) diff --git a/Assets/Dreamteck/Splines/Components/ComplexSurfaceGenerator.cs b/Assets/Dreamteck/Splines/Components/ComplexSurfaceGenerator.cs index 0f335366..13edcf2b 100644 --- a/Assets/Dreamteck/Splines/Components/ComplexSurfaceGenerator.cs +++ b/Assets/Dreamteck/Splines/Components/ComplexSurfaceGenerator.cs @@ -147,8 +147,8 @@ namespace Dreamteck.Splines private Spline[] _splines = new Spline[0]; [SerializeField] [HideInInspector] - private bool _initializedInEditor = false; - + //private bool _initializedInEditor = false; + //不把这些warning消掉就难受 private int iterations => _subdivisions * _otherComputers.Length; protected override void Awake() @@ -177,7 +177,7 @@ namespace Dreamteck.Splines { switch (mode) { - case SubdivisionMode.BSpline: return Spline.Type.BSpline; + case SubdivisionMode.BSpline: return Spline.Type.BSpline; case SubdivisionMode.Linear: return Spline.Type.Linear; default: return Spline.Type.CatmullRom; } @@ -199,7 +199,8 @@ namespace Dreamteck.Splines { _splines[i] = new Spline(ModeToSplineType(_subdivisionMode)); } - } else + } + else { for (int i = 0; i < _splines.Length; i++) { @@ -208,7 +209,7 @@ namespace Dreamteck.Splines } base.BuildMesh(); - AllocateMesh(sampleCount * (iterations + 1), iterations * (sampleCount-1) * 6); + AllocateMesh(sampleCount * (iterations + 1), iterations * (sampleCount - 1) * 6); _tsMesh.triangles = MeshUtility.GeneratePlaneTriangles(sampleCount - 1, iterations + 1, false); GenerateVertices(); _tsMesh.subMeshes.Clear(); @@ -251,7 +252,7 @@ namespace Dreamteck.Splines { _splines[j].points = new SplinePoint[_otherComputers.Length + 1]; } - + double xPercent = DMath.Lerp(clipFrom, clipTo, (double)j / (sampleCount - 1)); if (i > 0) { @@ -275,7 +276,8 @@ namespace Dreamteck.Splines if (uvMode == UVMode.UniformClamp || uvMode == UVMode.UniformClip) { AddUVDistance(x); - } else + } + else { GetSample(x, ref sample2); } @@ -292,11 +294,12 @@ namespace Dreamteck.Splines ydist += Vector3.Distance(lastPos, sample.position); } lastPos = sample.position; - if (uvMode == UVMode.UniformClamp ) + if (uvMode == UVMode.UniformClamp) { __uvs.x = CalculateUVUniformClamp(_vDist); __uvs.y = CalculateUVUniformClamp(ydist); - } else if(uvMode == UVMode.UniformClip) + } + else if (uvMode == UVMode.UniformClip) { __uvs.x = CalculateUVUniformClip(_vDist); __uvs.y = CalculateUVUniformClip(ydist); diff --git a/Assets/Scenes/StartMenu.unity b/Assets/Scenes/StartMenu.unity index a88e9c41..31d65bdd 100644 --- a/Assets/Scenes/StartMenu.unity +++ b/Assets/Scenes/StartMenu.unity @@ -6034,6 +6034,81 @@ MonoBehaviour: m_Calls: [] sliderAnimator: {fileID: 0} saveValue: 0 +--- !u!1 &1625893329 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1625893330} + - component: {fileID: 1625893332} + - component: {fileID: 1625893331} + m_Layer: 5 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1625893330 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625893329} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4337614254416964847} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.0025024, y: -0.0025024} + m_SizeDelta: {x: 1440, y: 900} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1625893331 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625893329} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.21960784, g: 1, b: 0, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1625893332 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625893329} + m_CullTransparentMesh: 1 --- !u!1 &1727811628 GameObject: m_ObjectHideFlags: 0 @@ -9986,6 +10061,7 @@ MonoBehaviour: type: 3} loadTabList: {fileID: 4337614255290428456} projectFileList: [] + MemuMask: {fileID: 1625893331} --- !u!224 &4337614253782299621 RectTransform: m_ObjectHideFlags: 0 @@ -12198,6 +12274,7 @@ RectTransform: - {fileID: 4337614255172217536} - {fileID: 4337614253295634652} - {fileID: 961677074} + - {fileID: 1625893330} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -14457,7 +14534,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 4337614255116277774} m_HandleRect: {fileID: 4337614255116277775} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: diff --git a/Assets/Scripts/DynamicUI/Hierarchy/Hierarchy.cs b/Assets/Scripts/DynamicUI/Hierarchy/Hierarchy.cs index 59944a21..60b30cda 100644 --- a/Assets/Scripts/DynamicUI/Hierarchy/Hierarchy.cs +++ b/Assets/Scripts/DynamicUI/Hierarchy/Hierarchy.cs @@ -32,6 +32,8 @@ namespace Ichni.Editor return tab; } + public ScrollRect scrollRect; + public Vector2 vector2; public void FindTab(GameElement targetElement, bool findparent = false) { if (findparent && targetElement.connectedTab != null) @@ -47,8 +49,18 @@ namespace Ichni.Editor FindTab(targetElement.parentElement, true); targetElement.connectedTab.tabButton.onClick.Invoke(); } - - + GameElement gameElement = targetElement; + HierarchyTab tab = targetElement.connectedTab; + while (tab is null) + { + gameElement = gameElement.parentElement; + if (gameElement is null) return; + tab = gameElement.connectedTab; + } + float Tablocalpos = (-tab.transform.localPosition.y) - (tabContainer.sizeDelta.y / 4f); + float pct = Tablocalpos / tabContainer.sizeDelta.y; + scrollRect.verticalNormalizedPosition = 1f - pct; } + } } \ No newline at end of file diff --git a/Assets/Scripts/DynamicUI/Hierarchy/HierarchyTab.cs b/Assets/Scripts/DynamicUI/Hierarchy/HierarchyTab.cs index 3eb9ca31..c2297c46 100644 --- a/Assets/Scripts/DynamicUI/Hierarchy/HierarchyTab.cs +++ b/Assets/Scripts/DynamicUI/Hierarchy/HierarchyTab.cs @@ -121,7 +121,7 @@ namespace Ichni.Editor } EditorManager.instance.uiManager.inspector.SetInspector(connectedGameElement); - EditorManager.instance.timeline.SetTimeLine(connectedGameElement); // TODO: Error + EditorManager.instance.timeline.SetTimeLine(connectedGameElement); } private void ExpandOrFold() diff --git a/Assets/Scripts/EditorGame/Base/GeneralSubmodules/EditorSubmodules/SelectSubmodule.cs b/Assets/Scripts/EditorGame/Base/GeneralSubmodules/EditorSubmodules/SelectSubmodule.cs index d6111eba..ca660665 100644 --- a/Assets/Scripts/EditorGame/Base/GeneralSubmodules/EditorSubmodules/SelectSubmodule.cs +++ b/Assets/Scripts/EditorGame/Base/GeneralSubmodules/EditorSubmodules/SelectSubmodule.cs @@ -8,20 +8,21 @@ namespace Ichni.RhythmGame public class SelectSubmodule : SubmoduleBase { private GameElement elementToSelect; - + public SelectSubmodule(GameElement attachedGameElement, GameElement elementToSelect = null) : base(attachedGameElement) { (attachedGameElement as IHaveSelectSubmodule).selectSubmodule = this; (attachedGameElement).gameObject.layer = LayerMask.NameToLayer("Selectable"); this.elementToSelect = elementToSelect == null ? attachedGameElement : elementToSelect; } - + public void SelectGameElement() { - EditorManager.instance.operationManager.ClearSelectedElements(); - EditorManager.instance.operationManager.AddSelectElement(elementToSelect); - EditorManager.instance.uiManager.inspector.SetInspector(elementToSelect); - EditorManager.instance.timeline.SetTimeLine(elementToSelect); + EditorManager.instance.uiManager.hierarchy.FindTab(elementToSelect); + // EditorManager.instance.operationManager.ClearSelectedElements(); + // EditorManager.instance.operationManager.AddSelectElement(elementToSelect); + // EditorManager.instance.uiManager.inspector.SetInspector(elementToSelect); + // EditorManager.instance.timeline.SetTimeLine(elementToSelect); } public override void SaveBM() diff --git a/Assets/Scripts/Manager/OperationManager.cs b/Assets/Scripts/Manager/OperationManager.cs index aa770727..0a636a7a 100644 --- a/Assets/Scripts/Manager/OperationManager.cs +++ b/Assets/Scripts/Manager/OperationManager.cs @@ -30,7 +30,7 @@ namespace Ichni.Editor gameElement.connectedTab.isSelected = true; if (gameElement.connectedTab.BgImage != null) { - gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0.2f); + gameElement.connectedTab.BgImage.color = new Color(0f, 0f, 0f, 0.8f); } } diff --git a/Assets/Scripts/Manager/ThemeBundleManager.cs b/Assets/Scripts/Manager/ThemeBundleManager.cs index f5e490ad..5c05a594 100644 --- a/Assets/Scripts/Manager/ThemeBundleManager.cs +++ b/Assets/Scripts/Manager/ThemeBundleManager.cs @@ -53,6 +53,7 @@ namespace Ichni public void LoadThemeBundles(List list) { + LogWindow.text += "Loading ThemeBundles, Please wait...\n"; waitingBundleAmount = new IntReactiveProperty(list.Count); Debug.Log("Waiting for " + list.Count + " AssetBundles to load."); LogWindow.text += "Waiting for " + list.Count + " AssetBundles to load.\n"; diff --git a/Assets/Scripts/Sample Assiant/SampleWindow.cs b/Assets/Scripts/Sample Assiant/SampleWindow.cs index 869daf30..027ee89e 100644 --- a/Assets/Scripts/Sample Assiant/SampleWindow.cs +++ b/Assets/Scripts/Sample Assiant/SampleWindow.cs @@ -156,7 +156,7 @@ public class SampleWindow : MovableWindow//该window高度为300,横的要在1 }//服了,之后整合到controler里头去 } - public GameObject selectedGameObject = EventSystem.current.currentSelectedGameObject; + public GameObject selectedGameObject; void Update() { selectedGameObject = EventSystem.current.currentSelectedGameObject; @@ -254,22 +254,22 @@ public class SampleWindow : MovableWindow//该window高度为300,横的要在1 switch (NoteCode) { case 0: - Tap a = Tap.GenerateElement("New Tap", Guid.NewGuid(), new List(), true, gameElement, time); + Tap a = Tap.GenerateElement("New Tap", Guid.NewGuid(), new List(), false, gameElement, time); noteBases.Add(a); SpawnNote(a); break; case 3: - Hold b = Hold.GenerateElement("New Hold", Guid.NewGuid(), new List(), true, gameElement, time, time + 0.5f); + Hold b = Hold.GenerateElement("New Hold", Guid.NewGuid(), new List(), false, gameElement, time, time + 0.5f); noteBases.Add(b); SpawnNote(b); break; case 1: - Stay c = Stay.GenerateElement("New Stay", Guid.NewGuid(), new List(), true, gameElement, time); + Stay c = Stay.GenerateElement("New Stay", Guid.NewGuid(), new List(), false, gameElement, time); noteBases.Add(c); SpawnNote(c); break; case 2: - Flick d = Flick.GenerateElement("New Flick", Guid.NewGuid(), new List(), true, gameElement, time, new List()); + Flick d = Flick.GenerateElement("New Flick", Guid.NewGuid(), new List(), false, gameElement, time, new List()); noteBases.Add(d); SpawnNote(d); break; diff --git a/Assets/Scripts/StartMenu/LoadProjectModule.cs b/Assets/Scripts/StartMenu/LoadProjectModule.cs index 4b3d6e83..c29bebdd 100644 --- a/Assets/Scripts/StartMenu/LoadProjectModule.cs +++ b/Assets/Scripts/StartMenu/LoadProjectModule.cs @@ -5,9 +5,10 @@ using System.Linq; using Ichni.RhythmGame.Beatmap; using Lean.Pool; using UnityEngine; +using UnityEngine.UI; namespace Ichni.StartMenu -{ +{ public class LoadProjectModule : MonoBehaviour { public GameObject LoadProjectTab; @@ -17,6 +18,7 @@ namespace Ichni.StartMenu public List projectFileList; public List projectInformationList; public List songInformationList; + public Image MemuMask; private void Start() { @@ -39,7 +41,7 @@ namespace Ichni.StartMenu projectInformationList.Add(ES3.Load("ProjectInformation", projectInformationPath)); songInformationList.Add(ES3.Load("SongInformation", songInformationPath)); } - + for (int i = 0; i < projectInformationList.Count; i++) { var currentProject = projectInformationList[i]; @@ -50,6 +52,7 @@ namespace Ichni.StartMenu LoadProjectTab tab = LeanPool.Spawn(LoadProjectTab, loadTabList).GetComponent(); tab.SetUpTab(projectName, lastSavedTime, songName); + tab.MemuMask = MemuMask; } } } diff --git a/Assets/Scripts/StartMenu/LoadProjectTab.cs b/Assets/Scripts/StartMenu/LoadProjectTab.cs index 7532230f..7997e913 100644 --- a/Assets/Scripts/StartMenu/LoadProjectTab.cs +++ b/Assets/Scripts/StartMenu/LoadProjectTab.cs @@ -14,11 +14,11 @@ namespace Ichni.StartMenu public string projectName; public TMP_Text projectNameText, lastSavedTimeText, songNameText; public Button loadButton; - + public Image MemuMask; public void SetUpTab(string projectName, string lastSavedTime, string songName) { this.projectName = projectName; - + projectNameText.text = projectName; lastSavedTimeText.text = lastSavedTime; songNameText.text = songName; @@ -28,9 +28,10 @@ namespace Ichni.StartMenu private void LoadProject() { + MemuMask.gameObject.SetActive(true); InformationTransistor.instance.isLoadedProject = true; InformationTransistor.instance.loadedProjectName = projectName; - + string projectPath = Application.streamingAssetsPath + "/Projects/" + projectName; InformationTransistor.instance.projectInfo_BM = ES3.Load("ProjectInformation", projectPath + "/ProjectInfo.json"); InformationTransistor.instance.songInfo_BM = ES3.Load("SongInformation", projectPath + "/SongInfo.json"); diff --git a/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteGenerateExpand.cs b/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteGenerateExpand.cs index 024ccf20..3c888375 100644 --- a/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteGenerateExpand.cs +++ b/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteGenerateExpand.cs @@ -18,7 +18,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse this.generateTime = generateTime; this.effectTime = effectTime; } - + public sealed override void Recover() { noteVisual.noteMain.SetActive(false); @@ -40,7 +40,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse { noteVisual.noteMain.transform.localScale = Vector3.one; } - + public override EffectBase_BM ConvertToBM() { return new Beatmap.DTMNoteGenerateExpand_BM(effectTime, generateTime); @@ -60,18 +60,18 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse { public class DTMNoteGenerateExpand_BM : NoteGenerateEffect_BM { - public float effectTime; - public float generateTime; + public new float effectTime; + public new float generateTime; public DTMNoteGenerateExpand_BM() { - + } public DTMNoteGenerateExpand_BM(float effectTime, float generateTime) : base(effectTime, generateTime) { - + } public override EffectBase ConvertToGameType(GameElement attachedGameElement)