sth&文档

This commit is contained in:
2025-04-19 23:21:27 +08:00
parent a0f7ec7e15
commit f16ecbfbcf
12 changed files with 1889 additions and 62 deletions

View File

@@ -32,7 +32,7 @@ namespace Ichni.Editor
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, value);
connectedBaseElement.Refresh();
}
public override DynamicUIElement AddListenerFunction(UnityAction action)
{
dropdown.onValueChanged.AddListener(_ => action());

View File

@@ -80,7 +80,7 @@ namespace Ichni.Editor
/// <param name="bpm"></param>
public void Initialize(float delay, float bpm)
{
timePointerInterval = 30;
timePointerInterval = 80;
ClearPointers();
int beatDivider = 1;

View File

@@ -33,8 +33,8 @@ namespace Ichni.RhythmGame
{
public override void SaveBM()
{
matchedBM = parentElement != null ?
new ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM) :
matchedBM = parentElement != null ?
new ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM) :
new ElementFolder_BM(elementName, elementGuid, tags, null);
}
@@ -43,7 +43,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
base.SetUpInspector();
var container = inspector.GenerateContainer("Generate");
var generateBase = container.GenerateSubcontainer(3);
var folderButton = inspector.GenerateButton(this, generateBase, "Folder",
() => ElementFolder.GenerateElement("New Folder", Guid.NewGuid(), new List<string>(), true, this));
@@ -55,7 +55,7 @@ namespace Ichni.RhythmGame
var crossTrackPoint = inspector.GenerateButton(this, generateBase, "Cross Track Point",
() => CrossTrackPoint.GenerateElement("New Cross Track Point", Guid.NewGuid(), new List<string>(), true,
this, new FlexibleInt(), new FlexibleFloat()));
var generateNote = container.GenerateSubcontainer(3);
var tapButton = inspector.GenerateButton(this, generateNote, "Tap",
() => Tap.GenerateElement("New Tap", Guid.NewGuid(), new List<string>(), true, this, 0f));
@@ -66,7 +66,7 @@ namespace Ichni.RhythmGame
var flickButton = inspector.GenerateButton(this, generateNote, "Flick",
() => Flick.GenerateElement("New Flick", Guid.NewGuid(), new List<string>(), true, this, 0f,
new List<Vector2>()));
var generateEnvironment = container.GenerateSubcontainer(3);
var environmentObjectButton = inspector.GenerateButton(this, generateEnvironment, "Environment Object",
() => TemporaryObject.GenerateElement("New Environment Object", Guid.NewGuid(), new List<string>(),
@@ -74,7 +74,7 @@ namespace Ichni.RhythmGame
var timeEffectsCollectionButton = inspector.GenerateButton(this, generateEnvironment, "Time Effects Collection",
() => TimeEffectsCollection.GenerateElement("New Time Effects Collection", Guid.NewGuid(),
new List<string>(), true, this, 0));
var generateAnimation = container.GenerateSubcontainer(3);
var displacementButton = inspector.GenerateButton(this, generateAnimation, "Displacement",
() => Displacement.GenerateElement("New Displacement", Guid.NewGuid(), new List<string>(), true, this,
@@ -82,6 +82,11 @@ namespace Ichni.RhythmGame
var swirlButton = inspector.GenerateButton(this, generateAnimation, "Swirl",
() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
var scaleButton = inspector.GenerateButton(this, generateAnimation, "Scale", () =>
{
Swirl.GenerateElement("New Scale", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat());
}); //缩放
}
}
@@ -94,15 +99,15 @@ namespace Ichni.RhythmGame
}
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement)
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement)
: base(elementName, elementGuid, tags, attachedElement)
{
}
public override void ExecuteBM()
{
matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags,false, GetElement(attachedElementGuid));
matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid));
}
public override GameElement DuplicateBM(GameElement parent)

View File

@@ -48,7 +48,7 @@ namespace Ichni.RhythmGame
public override void AfterInitialize()
{
base.AfterInitialize();
if (trackPathSubmodule != null && trackPathSubmodule.pathNodeList.Count > 3)
{
trackPathSubmodule.ClosePath();
@@ -173,7 +173,11 @@ namespace Ichni.RhythmGame
Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat());
}); //旋转
var scaleButton = inspector.GenerateButton(this, animationSubcontainer, "Scale", () =>
{
Swirl.GenerateElement("New Scale", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat());
}); //缩放
if (trackPathSubmodule != null)
{
trackPathButton.button.interactable = false;

View File

@@ -50,7 +50,7 @@ namespace Ichni.RhythmGame
{
private void SetUpSplineComputer(Track.TrackSpaceType trackSpaceType, Track.TrackSamplingType trackSamplingType)
{
path.type = (Spline.Type)(int)trackSpaceType;
path.type = (Spline.Type)trackSpaceType;
path.sampleMode = (SplineComputer.SampleMode)(int)trackSamplingType;
path.space = SplineComputer.Space.Local;
}
@@ -69,8 +69,10 @@ namespace Ichni.RhythmGame
public void SetTrackSpaceType(int spaceType)
{
trackSpaceType = (Track.TrackSpaceType)spaceType;
path.type = (Spline.Type)spaceType;
int SpaceType = spaceType;
if (spaceType == 2) SpaceType++;
trackSpaceType = (Track.TrackSpaceType)SpaceType;
path.type = (Spline.Type)SpaceType;
}
public void SetPathNode(PathNode point)
@@ -86,17 +88,13 @@ namespace Ichni.RhythmGame
public override void Refresh()
{
if (trackSpaceType == Track.TrackSpaceType.Linear)
{
SetTrackSpaceType((int)Spline.Type.Linear);
path.type = Spline.Type.Linear;
}
else
{
SetTrackSpaceType((int)trackSpaceType);
SetUpSplineComputer(trackSpaceType, trackSamplingType);
}
SetTrackSpaceType((int)trackSpaceType);
SetUpSplineComputer(trackSpaceType, trackSamplingType);
foreach (var pathNode in pathNodeList)
{
@@ -117,7 +115,7 @@ namespace Ichni.RhythmGame
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Track Path");
var trackPathSubmoduleSettings = container.GenerateSubcontainer(3);
var trackSpaceDropdown =

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
namespace Ichni.RhythmGame

View File

@@ -36,6 +36,7 @@ namespace Ichni.Editor
UIOperation();
SwitchCameraOperation();
ClickSelectElement();
}
}
@@ -54,7 +55,7 @@ namespace Ichni.Editor
if (EditorManager.instance.cameraManager.isSceneCameraActive && !isPointerOverUI) // 场景相机的移动和旋转
{
float cameraMoveSpeed = EditorManager.instance.cameraManager.sceneCameraMoveSpeed * Time.deltaTime;
if (Keyboard.current.wKey.isPressed)
{
sceneCameraTransform.position += sceneCameraTransform.forward * cameraMoveSpeed;
@@ -121,7 +122,7 @@ namespace Ichni.Editor
}
}
}
private void TracksOperation()
{
if (Keyboard.current.altKey.isPressed)
@@ -140,7 +141,7 @@ namespace Ichni.Editor
}
}
}
private void SaveAndExportOperation()
{
if (Keyboard.current.leftCtrlKey.isPressed)
@@ -155,11 +156,17 @@ namespace Ichni.Editor
}
}
}
private void CopyPasteDeleteOperation()
{
if (!RectTransformUtility.RectangleContainsScreenPoint(EditorManager.instance.uiManager.hierarchy.GetComponent<RectTransform>(), Mouse.current.position.ReadValue()))
{
return;
}
if (Keyboard.current.leftCtrlKey.isPressed) // TODO: 后续适应多选
{
if (Keyboard.current.cKey.wasPressedThisFrame) // Ctrl + C 复制
{
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1) // TODO: 后续适应多选
@@ -167,7 +174,7 @@ namespace Ichni.Editor
LogWindow.Log("Please select only one Game Element to copy.", Color.red);
return;
}
EditorManager.instance.operationManager.CopyPasteDeleteModule.CopyElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
}
else if (Keyboard.current.vKey.wasPressedThisFrame) // Ctrl + V 粘贴
@@ -177,7 +184,7 @@ namespace Ichni.Editor
LogWindow.Log("Please select only one Game Element to paste.", Color.red);
return;
}
EditorManager.instance.operationManager.CopyPasteDeleteModule.PasteElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
}
else if (Keyboard.current.dKey.wasPressedThisFrame) // Ctrl + D 删除
@@ -187,12 +194,12 @@ namespace Ichni.Editor
LogWindow.Log("Please select only one Game Element to copy.", Color.red);
return;
}
EditorManager.instance.operationManager.CopyPasteDeleteModule.DeleteElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
}
}
}
private void ResolutionHintsOperation()
{
if (Keyboard.current.leftCtrlKey.isPressed)
@@ -211,7 +218,7 @@ namespace Ichni.Editor
}
}
}
private void UIOperation()
{
if (Keyboard.current.leftCtrlKey.isPressed)
@@ -222,7 +229,7 @@ namespace Ichni.Editor
}
}
}
private void SwitchCameraOperation()
{
if (Keyboard.current.leftCtrlKey.isPressed)