改了什么呢,我不知道啊

This commit is contained in:
2025-04-13 14:04:17 +08:00
parent 1a83ba52d4
commit 422ef82187
14 changed files with 122 additions and 123353 deletions

View File

@@ -167,8 +167,8 @@ namespace Ichni.Editor
functionInterpreter.SetFunction("lgp", (Action<int, float, float, float, float, float, float>)LGenPathNodes);
functionInterpreter.SetFunction("print", (Action<object>)print);
functionInterpreter.SetFunction("log", (Action<object>)Debug.Log);
functionInterpreter.SetFunction("tp", (Action<float, float, float>)Tp);
functionInterpreter.SetFunction("tp", (Action)Tp);
}
@@ -193,7 +193,22 @@ namespace Ichni.Editor
var f0 = ElementFolder.GenerateElement("Folder", Guid.NewGuid(), new List<string>(), true, null);
}
private void Tp(float x, float y, float z)
{
if (EditorManager.instance.cameraManager.isSceneCameraActive)
{
EditorManager.instance.cameraManager.sceneCamera.sceneCamera.transform.position =
new Vector3(x, y, z);
}
}
private void Tp()
{
if (EditorManager.instance.cameraManager.isSceneCameraActive)
{
EditorManager.instance.cameraManager.sceneCamera.sceneCamera.transform.position =
inspector.connectedGameElement.transform.position;
}
}

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using Michsky.MUIP;
using Sirenix.Utilities;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -68,6 +69,7 @@ namespace Ichni.Editor
d.GetComponent<RectTransform>().anchoredPosition = new Vector2(lineX, 0);
StartCoroutine(WindowAnim.ShowPanelOnScale(d.gameObject));
}
parentTab.SetStatus();
}
@@ -76,6 +78,12 @@ namespace Ichni.Editor
tabButton.onClick.AddListener(SelectGameElement);
expandButton.onClick.AddListener(ExpandOrFold);
deleteButton.onConfirm = () => EditorManager.instance.operationManager.CopyPasteDeleteModule.DeleteElement(connectedGameElement);
SetStatus();
}
public void SetStatus()
{
expandButton.interactable = !connectedGameElement.childElementList.IsNullOrEmpty();
}
}
@@ -111,7 +119,7 @@ namespace Ichni.Editor
EditorManager.instance.operationManager.ClearSelectedElements();
EditorManager.instance.operationManager.AddSelectElement(connectedGameElement);
}
EditorManager.instance.uiManager.inspector.SetInspector(connectedGameElement);
EditorManager.instance.timeline.SetTimeLine(connectedGameElement); // TODO: Error
}
@@ -124,7 +132,7 @@ namespace Ichni.Editor
if (isExpanded)
{
connectedGameElement.childElementList.Sort();//TODO: 后续可以让玩家手动快速排序
for (var index = 0; index < connectedGameElement.childElementList.Count; index++)
{
var childElement = connectedGameElement.childElementList[index];

View File

@@ -62,6 +62,7 @@ namespace Ichni.RhythmGame
trackPathSubmodule?.Refresh();
trackTimeSubmodule?.Refresh();
trackRendererSubmodule?.Refresh();
}
public override void OnDelete()
@@ -118,7 +119,7 @@ namespace Ichni.RhythmGame
trackRendererSubmodule = new TrackRendererSubmodulePathGenerator(this, false, 0);
inspectorMain.SetInspector(this);
});
var trackRenderTubeGeneratorButton = inspector.GenerateButton(this, trackSubmodulesContainer,
"Track Renderer Tube Generator",
() =>
@@ -218,7 +219,7 @@ namespace Ichni.RhythmGame
trackRenderTubeGeneratorButton.button.interactable = false;
trackRendererSurfaceButton.button.interactable = false;
}
var toolsContainerTrack = inspector.GenerateContainer("Track Tools"); //轨道(整体)快捷工具
var quickCopyButton = inspector.GenerateButton(this, toolsContainerTrack, "QuickCopy", () =>
{

View File

@@ -103,6 +103,7 @@ namespace Ichni.RhythmGame
SetPathNode(pathNode);
}
ClosePath();
path.Rebuild(true);
}
}

View File

@@ -20,14 +20,14 @@ namespace Ichni.RhythmGame
public TransformSubmodule transformSubmodule { get; set; }
public static Trail GenerateElement(string name, Guid id, List<string> tags, bool isFirstGenerated,
GameElement parentElement, float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
GameElement parentElement, float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
AnimationCurve widthCurve, Material material = null)
{
Trail trail = Instantiate(EditorManager.instance.basePrefabs.trail, parentElement.transform).GetComponent<Trail>();
trail.trailRenderer = trail.GetComponent<TrailRenderer>();
trail.Initialize(name, id, tags, isFirstGenerated, parentElement);
trail.renderMaterial = material == null ? EditorManager.instance.basePrefabs.defaultTrailMaterial : material;
trail.trailRenderer.material = trail.renderMaterial;
trail.visibleTimeLength = visibleTimeLength;
@@ -60,19 +60,19 @@ namespace Ichni.RhythmGame
public override void SetUpInspector()
{
base.SetUpInspector();
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Trail");
var visibleTimeLengthInputField = inspector.GenerateInputField(this, container, "Visible Time Length", nameof(visibleTimeLength));
visibleTimeLengthInputField.AddListenerFunction(() => trailRenderer.time = visibleTimeLength);
var isAutoOrientToggle = inspector.GenerateToggle(this, container, "Is Auto Orient", nameof(isAutoOrient));
isAutoOrientToggle.AddListenerFunction(() => trailRenderer.alignment = isAutoOrient ? LineAlignment.View : LineAlignment.TransformZ);
var widthMultiplierInputField = inspector.GenerateInputField(this, container, "Width Multiplier", nameof(widthMultiplier));
widthMultiplierInputField.AddListenerFunction(() => trailRenderer.widthMultiplier = widthMultiplier);
var widthCurveButton = inspector.GenerateButton(this, container, "Width Curve", () =>
{
var widthCurveWindow = inspector.GenerateCompositeParameterWindow(this, "Width Curve", nameof(widthCurve));
@@ -91,12 +91,13 @@ namespace Ichni.RhythmGame
if (x is IHaveTrail t)
{
t.trailRenderer.emitting = emitting;
if(willClear) t.trailRenderer.Clear();
t.trailRenderer.enabled = emitting;
if (willClear) t.trailRenderer.Clear();
}
}
}
}
public interface IHaveTrail
{
TrailRenderer trailRenderer { get; set; }
@@ -118,7 +119,7 @@ namespace Ichni.RhythmGame
}
public Trail_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement,
float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
float visibleTimeLength, bool isAutoOrient, float widthMultiplier,
AnimationCurve widthCurve, Material renderMaterial) : base(elementName, elementGuid, tags,
attachedElement)
{
@@ -139,7 +140,7 @@ namespace Ichni.RhythmGame
public override GameElement DuplicateBM(GameElement parent)
{
return Trail.GenerateElement(elementName, Guid.NewGuid(), tags,
false, parent, visibleTimeLength,
false, parent, visibleTimeLength,
isAutoOrient, widthMultiplier, widthCurve);
}
}

View File

@@ -11,7 +11,7 @@ namespace Ichni.Editor
public List<GameElement> currentSelectedElements { get; private set; }
public CopyPasteDeleteModule CopyPasteDeleteModule;
public FindingModule FindingModule;
public OperationManager()
@@ -24,25 +24,25 @@ namespace Ichni.Editor
public void AddSelectElement(GameElement gameElement)
{
currentSelectedElements.Add(gameElement);
gameElement.connectedTab.isSelected = true;
if (gameElement.connectedTab.BgImage != null)
{
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0.2f);
}
}
public void RemoveSelectElement(GameElement gameElement)
{
currentSelectedElements.Remove(gameElement);
gameElement.connectedTab.isSelected = false;
if (gameElement.connectedTab.BgImage != null)
{
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
}
}
public void ClearSelectedElements()
{
currentSelectedElements.ForEach(gameElement =>
@@ -53,7 +53,7 @@ namespace Ichni.Editor
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
}
});
currentSelectedElements.Clear();
}
}
@@ -69,7 +69,7 @@ namespace Ichni.Editor
return element;
}
}
LogWindow.Log("Element not found: " + elementName, Color.red);
return null;
}
@@ -107,6 +107,7 @@ namespace Ichni.Editor
{
gameElement.parentElement.childElementList.Remove(gameElement); //从父物体的子物体列表中移除避免报null
gameElement.parentElement.connectedTab.childTabList.Remove(gameElement.connectedTab);
gameElement.parentElement.connectedTab.SetStatus();
}
gameElement.Delete();