Vector3 inputfield 改进

This commit is contained in:
SoulliesOfficial
2025-02-12 18:46:46 -05:00
parent 3a1ee5f9ef
commit 8d03acc3cb
30 changed files with 1781 additions and 239 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Sirenix.OdinInspector;
using UniRx;
@@ -18,6 +19,11 @@ namespace Ichni.RhythmGame
/// </summary>
public void SaveBM();
/// <summary>
/// 刷新物体的状态
/// </summary>
public void Refresh();
/// <summary>
/// 当物体被删除时执行的方法
/// </summary>
@@ -33,6 +39,8 @@ namespace Ichni.RhythmGame
{
throw new NotImplementedException();
}
public void SetUpInspector();
}
// public virtual void SetTimeDuration()

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
@@ -33,6 +34,18 @@ namespace Ichni.RhythmGame
{
attachedGameElement.submoduleList.Remove(this);
}
public Inspector inspector => EditorManager.instance.uiManager.inspector;
public virtual void SetUpInspector()
{
}
public virtual void Refresh()
{
}
}
namespace Beatmap

View File

@@ -82,6 +82,30 @@ namespace Ichni.RhythmGame
{
matchedBM = new TransformSubmodule_BM(attachedGameElement);
}
public override void SetUpInspector()
{
var container = inspector.GenerateContainer("Transform");
var originalPosInputField =
inspector.GenerateVec3InputField(this, container, "Start Position", nameof(originalPosition));
var originalRotInputField =
inspector.GenerateVec3InputField(this, container, "Start Rotation", nameof(originalEulerAngles));
var originalScaleInputField =
inspector.GenerateVec3InputField(this, container, "Start Scale", nameof(originalScale));
var currentPosText =
inspector.GenerateText(this, container, "Current Position", nameof(currentPosition), true);
var currentRotText =
inspector.GenerateText(this, container, "Current Rotation", nameof(currentEulerAngles), true);
var currentScaleText =
inspector.GenerateText(this, container, "Current Scale", nameof(currentScale), true);
}
public override void Refresh()
{
positionDirtyMark = true;
eulerAnglesDirtyMark = true;
scaleDirtyMark = true;
}
}
public interface IHaveTransformSubmodule

View File

@@ -6,22 +6,18 @@ using UnityEngine;
[CreateAssetMenu(fileName = "BasePrefabsCollection", menuName = "Ichni/BasePrefabsCollection", order = 0)]
public class BasePrefabsCollection : SerializedScriptableObject
{
[Title("基础预制体")]
public GameObject emptyObject;
[Title("基础预制体")] public GameObject emptyObject;
public GameObject elementFolder;
public GameObject gameCamera;
[Title("Track相关")]
public GameObject track;
[Title("Track相关")] public GameObject track;
public GameObject pathNode;
public Material defaultTrackMaterial;
[Title("Trail相关")]
public GameObject trail;
[Title("Trail相关")] public GameObject trail;
public Material defaultTrailMaterial;
[Title("Note 相关")]
public GameObject tapNote;
[Title("Note 相关")] public GameObject tapNote;
public GameObject stayNote;
public GameObject holdNote;
public GameObject flickNote;
@@ -32,12 +28,15 @@ public class BasePrefabsCollection : SerializedScriptableObject
public AudioClip holdNoteEndSound;
public AudioClip flickNoteSound;
[Title("Effect相关")]
public GameObject bloomShake;
[Title("DynamicUI相关")]
public GameObject dynamicUIContainer;
[Title("Effect相关")] public GameObject bloomShake;
[Title("DynamicUI相关")] public GameObject dynamicUIContainer;
public GameObject inputField;
public GameObject Vec3inputField;
public GameObject text;
public GameObject button;
public GameObject toggle;
public GameObject dropdown;
}

View File

@@ -50,6 +50,9 @@ namespace Ichni
gameElement.AfterInitialize();
gameElement.Refresh();
});
// projectManager.saveManager.Save();
// projectManager.exportManager.Export();
}
private void Update()
@@ -66,6 +69,17 @@ namespace Ichni
new FlexibleFloat(),
new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,10, AnimationCurveType.Linear)}),
new FlexibleFloat());
var dis1 = Displacement.GenerateElement("Displacement-1", Guid.NewGuid(), new List<string>(), true, f0,
new FlexibleFloat(new List<AnimatedFloat>()
{
new(0, 0.5f, 0, -4, AnimationCurveType.OutQuad),
new(0.5f, 1, -4, 0, AnimationCurveType.InQuad),
new(1, 1.5f, 0, 4, AnimationCurveType.OutQuad),
new(1.5f, 2, 4, 0, AnimationCurveType.InQuad),
}),
new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,-10, AnimationCurveType.Linear)}),
new FlexibleFloat());
var t0 = Track.GenerateElement("Track", Guid.NewGuid(), new List<string>(), true, f0);
t0.trackPathSubmodule = new TrackPathSubmodule(t0, Track.TrackSpaceType.Linear, Track.TrackSamplingType.TimeDistributed, false);
t0.submoduleList.Add(t0.trackPathSubmodule);
@@ -84,15 +98,6 @@ namespace Ichni
var n0 = Tap.GenerateElement("Note-0", Guid.NewGuid(), new List<string>(), true, t0, 1f);
var n0v = BasicNoteVisual.GenerateElement("Note-0-V", Guid.NewGuid(), new List<string>(), true, n0,
"basic", "BasicNoteTap3D");
beatmapContainer.gameElementList.ForEach(e =>
{
e.AfterInitialize();
e.Refresh();
});
projectManager.saveManager.Save();
projectManager.exportManager.Export();
}
}

View File

@@ -19,6 +19,16 @@ namespace Ichni.RhythmGame
{
matchedBM = new BeatmapContainer_BM(gameElementList);
}
public void SetUpInspector()
{
throw new System.NotImplementedException();
}
public void Refresh()
{
throw new System.NotImplementedException();
}
}
namespace Beatmap

View File

@@ -20,6 +20,16 @@ namespace Ichni.RhythmGame
{
matchedBM = new CommandScripts_BM(commandList);
}
public void SetUpInspector()
{
throw new System.NotImplementedException();
}
public void Refresh()
{
throw new System.NotImplementedException();
}
}
namespace Beatmap

View File

@@ -41,6 +41,16 @@ namespace Ichni.RhythmGame
matchedBM = new ProjectInformation_BM(projectName, creatorName, editorVersion,
createTime, lastSaveTime, selectedThemeBundleList);
}
public void SetUpInspector()
{
throw new System.NotImplementedException();
}
public void Refresh()
{
throw new System.NotImplementedException();
}
}
namespace Beatmap

View File

@@ -29,6 +29,16 @@ namespace Ichni.RhythmGame
{
matchedBM = new SongInformation_BM(songName, bpm, delay);
}
public void SetUpInspector()
{
throw new System.NotImplementedException();
}
public void Refresh()
{
throw new System.NotImplementedException();
}
}
namespace Beatmap