修复
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.Beatmap
|
||||
{
|
||||
@@ -23,6 +24,9 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
if(GetElement(attachedElementGuid) == null)
|
||||
Debug.Log($"Swirl_BM ExecuteBM failed: attached element with guid {attachedElementGuid} not found");
|
||||
|
||||
matchedElement = Swirl.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid),
|
||||
eulerAngleX.ConvertToGameType(), eulerAngleY.ConvertToGameType(), eulerAngleZ.ConvertToGameType());
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
|
||||
//if(attachedElement == null) Debug.Log(attachedElementGuid);
|
||||
(attachedElement as IHaveTimeDurationSubmodule).timeDurationSubmodule =
|
||||
new TimeDurationSubmodule(attachedElement, isOverridingDuration, startTime, endTime);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
|
||||
(attachedElement as IHaveTransformSubmodule).transformSubmodule =
|
||||
new TransformSubmodule(attachedElement, originalPosition, originalEulerAngles, originalScale);
|
||||
|
||||
}
|
||||
|
||||
public override void DuplicateBM(GameElement attached)
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Ichni.RhythmGame
|
||||
var container = inspector.GenerateContainer("Property Animation Color");
|
||||
var settings = container.GenerateSubcontainer(3);
|
||||
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName));
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName));
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName)).AddListenerFunction(() => AfterInitialize());
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName)).AddListenerFunction(() => AfterInitialize());
|
||||
|
||||
var graphicEditor = inspector.GenerateButton(this, settings, "GraphicEditor", () =>
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace Ichni.RhythmGame
|
||||
var container = inspector.GenerateContainer("Property Animation Float");
|
||||
var settings = container.GenerateSubcontainer(3);
|
||||
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName));
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName));
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName)).AddListenerFunction(() => AfterInitialize());
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName)).AddListenerFunction(() => AfterInitialize());
|
||||
|
||||
var graphicEditor = inspector.GenerateButton(this, settings, "GraphicEditor", () =>
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace Ichni.RhythmGame
|
||||
var container = inspector.GenerateContainer("Property Animation Vector3");
|
||||
var settings = container.GenerateSubcontainer(3);
|
||||
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName));
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName));
|
||||
inspector.GenerateInputField(this, settings, "Component Name", nameof(componentName)).AddListenerFunction(() => AfterInitialize());
|
||||
inspector.GenerateInputField(this, settings, "Property Name", nameof(propertyName)).AddListenerFunction(() => AfterInitialize());
|
||||
|
||||
var graphicEditor = inspector.GenerateButton(this, settings, "GraphicEditor", () =>
|
||||
{
|
||||
|
||||
@@ -12,13 +12,12 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Color");
|
||||
var subcontainer = container.GenerateSubcontainer(1, 300f);
|
||||
|
||||
if ((attachedGameElement as IHaveColorSubmodule).haveBaseColor)
|
||||
{
|
||||
var baseColor = inspector.GenerateBaseColorPicker(this, subcontainer, "Base Color", nameof(originalBaseColor));
|
||||
var subBase = container.GenerateSubcontainer(1, 280f);
|
||||
var baseColor = inspector.GenerateBaseColorPicker(this, subBase, "Base Color", nameof(originalBaseColor));
|
||||
baseColor.AddListenerFunction(Refresh);
|
||||
var hsvDrawer = inspector.GenerateHsvDrawer(this, subcontainer, "HSV", nameof(originalBaseColor));
|
||||
var hsvDrawer = inspector.GenerateHsvDrawer(this, subBase, "HSV", nameof(originalBaseColor));
|
||||
hsvDrawer.AddListenerFunction(Refresh);
|
||||
baseColor.hsvDrawer = hsvDrawer;
|
||||
hsvDrawer.baseColorPicker = baseColor;
|
||||
@@ -33,7 +32,8 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if ((attachedGameElement as IHaveColorSubmodule).haveEmissionColor)
|
||||
{
|
||||
var emissionColor = inspector.GenerateEmissionColorPicker(this, subcontainer, "Emission Color",
|
||||
var subEmission = container.GenerateSubcontainer(1, 320f);
|
||||
var emissionColor = inspector.GenerateEmissionColorPicker(this, subEmission, "Emission Color",
|
||||
nameof(emissionEnabled), nameof(originalEmissionColor), nameof(originalEmissionIntensity));
|
||||
emissionColor.AddListenerFunction(Refresh);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Ichni.RhythmGame
|
||||
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
|
||||
});
|
||||
|
||||
var colorSettings = container.GenerateSubcontainer(1);
|
||||
var colorSettings = container.GenerateSubcontainer(1, 280f);
|
||||
var colorField = inspector.GenerateBaseColorPicker(this, colorSettings, "Color", nameof(color));
|
||||
SetRemove(effectSettings);
|
||||
}
|
||||
|
||||
@@ -45,10 +45,22 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [运行时刷新] Update & Tracking
|
||||
public void Update()
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
if (track.timeDurationSubmodule.CheckTimeInDuration(SongTime))
|
||||
base.AfterInitialize();
|
||||
TrackManager.instance.RegisterHeadPoint(this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
TrackManager.instance.UnregisterHeadPoint(this);
|
||||
}
|
||||
|
||||
#region [运行时刷新] Update & Tracking
|
||||
public void ManualTick(float songTime)
|
||||
{
|
||||
if (track.timeDurationSubmodule.CheckTimeInDuration(songTime))
|
||||
{
|
||||
trackPositioner.SetPercent(trackTimeSubmoduleMovable.headPercent);
|
||||
}
|
||||
|
||||
@@ -47,12 +47,24 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
TrackManager.instance.RegisterPercentPoint(this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
TrackManager.instance.UnregisterPercentPoint(this);
|
||||
}
|
||||
|
||||
#region [刷新计算] Update & Refresh
|
||||
public void Update()
|
||||
public void ManualTick(float songTime)
|
||||
{
|
||||
if (trackPercent.animations.Count > 0)
|
||||
{
|
||||
trackPercent.UpdateFlexibleFloat(EditorManager.instance.songInformation.songTime);
|
||||
trackPercent.UpdateFlexibleFloat(songTime);
|
||||
if (trackPercent.returnType == FlexibleReturnType.MiddleExecuting)
|
||||
{
|
||||
float finalValue = trackPercent.value;
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace Ichni
|
||||
private readonly List<CrossTrackPoint> _activeCrossPoints = new List<CrossTrackPoint>(50);
|
||||
private readonly List<ObjectTracker> _activeObjectTrackers = new List<ObjectTracker>(50);
|
||||
private readonly List<ParticleTracker> _activeParticleTrackers = new List<ParticleTracker>(50);
|
||||
// 注意:TrackHeadPoint / TrackPercentPoint 在编辑器中无对应的逐帧更新逻辑,暂不加入
|
||||
private readonly List<TrackHeadPoint> _activeHeadPoints = new List<TrackHeadPoint>(50);
|
||||
private readonly List<TrackPercentPoint> _activePercentPoints = new List<TrackPercentPoint>(50);
|
||||
#endregion
|
||||
|
||||
#region [注册与注销] Registration
|
||||
@@ -48,6 +49,18 @@ namespace Ichni
|
||||
if (!_activeParticleTrackers.Contains(tracker)) _activeParticleTrackers.Add(tracker);
|
||||
}
|
||||
public void UnregisterParticleTracker(ParticleTracker tracker) => _activeParticleTrackers.Remove(tracker);
|
||||
|
||||
public void RegisterHeadPoint(TrackHeadPoint point)
|
||||
{
|
||||
if (!_activeHeadPoints.Contains(point)) _activeHeadPoints.Add(point);
|
||||
}
|
||||
public void UnregisterHeadPoint(TrackHeadPoint point) => _activeHeadPoints.Remove(point);
|
||||
|
||||
public void RegisterPercentPoint(TrackPercentPoint point)
|
||||
{
|
||||
if (!_activePercentPoints.Contains(point)) _activePercentPoints.Add(point);
|
||||
}
|
||||
public void UnregisterPercentPoint(TrackPercentPoint point) => _activePercentPoints.Remove(point);
|
||||
#endregion
|
||||
|
||||
#region [中央集权主循环] Manager-Driven Tick
|
||||
@@ -90,6 +103,22 @@ namespace Ichni
|
||||
if (!tracker.isActiveAndEnabled) continue;
|
||||
tracker.ManualTick(songTime);
|
||||
}
|
||||
|
||||
// 5. TrackHeadPoint:更新轨道头节点
|
||||
for (int i = 0; i < _activeHeadPoints.Count; i++)
|
||||
{
|
||||
var point = _activeHeadPoints[i];
|
||||
if (!point.isActiveAndEnabled) continue;
|
||||
point.ManualTick(songTime);
|
||||
}
|
||||
|
||||
// 6. TrackPercentPoint:更新轨道百分比节点
|
||||
for (int i = 0; i < _activePercentPoints.Count; i++)
|
||||
{
|
||||
var point = _activePercentPoints[i];
|
||||
if (!point.isActiveAndEnabled) continue;
|
||||
point.ManualTick(songTime);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user