部分改动

我还是难以理解(
This commit is contained in:
2025-02-22 12:35:56 +08:00
parent 23c7e30be1
commit f941ca7dbc
6 changed files with 89 additions and 44 deletions

View File

@@ -95,6 +95,8 @@ MonoBehaviour:
ElementPrefab: {fileID: 67623903627768998, guid: 43149b488eb37d14185b05d5d2ee0a9a,
type: 3}
GelementPointer: []
MoveArea: {fileID: 7453192480244305691}
timeline: {fileID: 0}
--- !u!1 &1843458013635033358
GameObject:
m_ObjectHideFlags: 0
@@ -261,7 +263,7 @@ RectTransform:
m_Father: {fileID: 2856594644468795856}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 1046.8994, y: 0.0000076293945}
m_SizeDelta: {x: 1494.721, y: 25.652}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 897.3994, y: 0.0000076293945}
m_SizeDelta: {x: 1195.721, y: 25.652}
m_Pivot: {x: 0.5, y: 0.5}

File diff suppressed because one or more lines are too long

View File

@@ -24,24 +24,28 @@ public class SubTab : MonoBehaviour
Time = time;
connectObj.Add(Objs);
button.GetComponentInChildren<TMP_Text>().text = connectObj.Count().ToString();
}
public void Update()
{
if (Time - timePointerModule.leftSideSongTime < 0)
{
transform.localScale = Vector3.zero;
return;
}
else
{
transform.localScale = Vector3.one;
float devideTime = Time - timePointerModule.leftSideSongTime;
transform.position = new Vector3(
devideTime / timeline.timePerBeat * timePointerModule.timePointerInterval + 165f - timePointerModule.delayDistanceOffset
transform.position = new Vector3(
Time / timeline.timePerBeat * timePointerModule.timePointerInterval + 165f - timePointerModule.delayDistanceOffset
, transform.position.y, 0
);
}
}
// public void Update()
// {
// if (Time - timePointerModule.leftSideSongTime < 0)
// {
// transform.localScale = Vector3.zero;
// return;
// }
// else
// {
// transform.localScale = Vector3.one;
// float devideTime = Time - timePointerModule.leftSideSongTime;
// transform.position = new Vector3(
// devideTime / timeline.timePerBeat * timePointerModule.timePointerInterval + 165f - timePointerModule.delayDistanceOffset
// , transform.position.y, 0
// );
// }
// }
public void GetClick()
{

View File

@@ -118,6 +118,7 @@ namespace Ichni.Editor
Destroy(timelineTabList.ElementAt(i).Value.gameObject);
timelineTabList.Remove(timelineTabList.ElementAt(i).Key);
}
print(1);
if (element is Track) Trackfind(element);

View File

@@ -1,8 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni;
using Ichni.Editor;
using Ichni.RhythmGame;
using TMPro;
using UnityEditor;
using UnityEngine;
public class TimelineTab : MonoBehaviour
@@ -13,7 +16,10 @@ public class TimelineTab : MonoBehaviour
public SubTab ElementPrefab;
public List<GameElement> GelementPointer;
public RectTransform MoveArea;
public Dictionary<float, SubTab> SubTabs = new();
public Timeline timeline;
public void SetTab(GameElement element, Type DisplayType)
{
connectedGameElement = element;
@@ -33,11 +39,22 @@ public class TimelineTab : MonoBehaviour
if (SubTabs.ContainsKey(Judgetime)) SubTabs[Judgetime].Set(gameElement, Judgetime);
else
{
SubTab i = Instantiate(ElementPrefab, transform);
SubTab i = Instantiate(ElementPrefab, MoveArea.transform);
i.Set(gameElement, Judgetime);
SubTabs.Add(Judgetime, i);
}
}
}
private void Start()
{
timeline = EditorManager.instance.uiManager.timeline;
}
public void Update()
{
MoveArea.position = new Vector3(
timeline.timePointerModule.timePointerArea.position.x,
MoveArea.position.y,
MoveArea.position.z);
}
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
using Ichni.Editor;
using Sirenix.OdinInspector;
using UnityEngine;
@@ -12,19 +13,19 @@ namespace Ichni.RhythmGame
[Title("Basic Info")]
public float exactJudgeTime;
[Title("Track Info")]
[Title("Track Info")]
public bool isOnTrack;
public Track track;
public SplinePositioner trackPositioner;
[Title("NoteVisual")]
public NoteVisualBase noteVisual;
[Title("Submodules")]
public TransformSubmodule transformSubmodule { get; set; }
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
public NoteJudgeSubmodule noteJudgeSubmodule { get; set; }
[Title("In-Game Info")]
public Vector2 noteScreenPosition;
public bool isJudged;
@@ -44,10 +45,10 @@ namespace Ichni.RhythmGame
{
float songTime = EditorManager.instance.songInformation.songTime;
TrackTimeSubmoduleStatic trackTimeSubmoduleStatic = track.trackTimeSubmodule as TrackTimeSubmoduleStatic;
float startMove = exactJudgeTime - trackTimeSubmoduleStatic.trackTotalTime;
float percent = AnimationCurveEvaluator.Evaluate(trackTimeSubmoduleStatic.animationCurveType, (songTime - startMove) / trackTimeSubmoduleStatic.trackTotalTime);
percent = Mathf.Max(percent, 0);
percent = Mathf.Min(percent, 1);
@@ -59,7 +60,7 @@ namespace Ichni.RhythmGame
transformSubmodule = new TransformSubmodule(this);
timeDurationSubmodule = new TimeDurationSubmodule(this);
noteJudgeSubmodule = new NoteJudgeSubmodule(this);
submoduleList.Add(transformSubmodule);
submoduleList.Add(timeDurationSubmodule);
submoduleList.Add(noteJudgeSubmodule);
@@ -116,9 +117,9 @@ namespace Ichni.RhythmGame
public void ExecuteStartJudge()
{
}
public void UpdateNoteInTrack()
{
if (isOnTrack && track.trackTimeSubmodule != null)
@@ -133,6 +134,26 @@ namespace Ichni.RhythmGame
}
}
}
public override void SetUpInspector()
{//我想把时间放在第一层菜单所以
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Element Info");
var nameInputField = inspector.GenerateParameterInputField(this, container, GetType().Name + "'s Name", nameof(elementName));
var guidText = inspector.GenerateParameterText(this, container, "Element GUID", nameof(elementGuid));
var tagsListButton = inspector.GenerateButton(this, container, "Tags List", () =>
{
inspector.GenerateCompositeParameterWindow(this, "Tags List", nameof(tags)).SetAsStringList();
});
foreach (var submodule in submoduleList)
{
submodule.SetUpInspector();
}
var judgetimeinput =
inspector.GenerateParameterInputField(this, container, "exactJudgeTime", nameof(exactJudgeTime));
base.SetUpInspector();
}
}
public abstract partial class NoteBase
@@ -144,6 +165,7 @@ namespace Ichni.RhythmGame
Bad,
Miss
}
}
namespace Beatmap
@@ -151,13 +173,13 @@ namespace Ichni.RhythmGame
public abstract class NoteBase_BM : GameElement_BM
{
public float exactJudgeTime;
public NoteBase_BM()
{
}
public NoteBase_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement, float exactJudgeTime)
public NoteBase_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement, float exactJudgeTime)
: base(elementName, elementGuid, tags, attachedElement)
{
this.exactJudgeTime = exactJudgeTime;
@@ -165,7 +187,7 @@ namespace Ichni.RhythmGame
public override void ExecuteBM()
{
throw new NotImplementedException();
throw new NotImplementedException();
}
public override GameElement DuplicateBM(GameElement parent)