Mp3读取,Effect Remove

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-07-12 18:27:10 +08:00
parent 2ccac78620
commit 47ec9ddb21
164 changed files with 308674 additions and 50659 deletions

View File

@@ -109,18 +109,19 @@ namespace Ichni.RhythmGame
if ((attachedGameElement as IHaveColorSubmodule).haveBaseColor)
{
// var baseColor = inspector.GenerateBaseColorPicker(this, subcontainer, "Base Color", nameof(originalBaseColor));
// baseColor.AddListenerFunction(Refresh);
var baseColor = inspector.GenerateBaseColorPicker(this, subcontainer, "Base Color", nameof(originalBaseColor));
baseColor.AddListenerFunction(Refresh);
// 新增HSV轮盘
var hsvDrawer = inspector.GenerateHsvDrawer(this, subcontainer, "HSV", nameof(originalBaseColor));
hsvDrawer.AddListenerFunction(Refresh);
baseColor.hsvDrawer = hsvDrawer;
hsvDrawer.baseColorPicker = baseColor;
if (attachedGameElement.childElementList.Exists(x => x is BaseColorChange))
{
// baseColor.title.text += " (Occupied by Animation)";
// baseColor.canvasGroup.interactable = false;
baseColor.title.text += " (Occupied by Animation)";
baseColor.canvasGroup.interactable = false;
hsvDrawer.title.text += " (Occupied by Animation)";
hsvDrawer.canvasGroup.interactable = false;
hsvDrawer.gameObject.SetActive(false); // 隐藏HSV轮盘
}
}

View File

@@ -60,12 +60,17 @@ namespace Ichni.RhythmGame
{
(EditorManager.instance.beatmapContainer).lowPriorityActions.Add(() =>
{
effectList.Add(effectBM.ConvertToGameType(attachedGameElement));
var a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
});
}
else
{
effectList.Add(effectBM.ConvertToGameType(attachedGameElement));
var a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
}
}
@@ -103,6 +108,7 @@ namespace Ichni.RhythmGame
{
newEffect.attachedGameElement = attachedGameElement;
effectCollection[effect.Key].Add(newEffect);
newEffect.AccommodatingList = effectCollection[effect.Key];
inspectorMain.SetInspector(attachedGameElement);
}
else
@@ -173,6 +179,7 @@ namespace Ichni.RhythmGame
foreach (var effectBase in effect.Value)
{
effectList.Add(effectBase.ConvertToBM());
}
effectCollection.Add(effect.Key, effectList);
}
@@ -349,7 +356,21 @@ namespace Ichni.RhythmGame
}
public List<EffectBase> AccommodatingList;
public abstract void SetUpInspector();
public void SetRemove(DynamicUISubcontainer effectSettings)
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var RemoveButtom = inspector.GenerateButton(this, effectSettings, "Remove", () =>
{
nowEffectState = EffectState.Before;
AccommodatingList.Remove(this);
EditorManager.instance.uiManager.inspector.SetInspector(attachedGameElement);
});
}
}
namespace Beatmap

View File

@@ -5,7 +5,7 @@ using System.IO;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
using NLayer;
namespace Ichni.RhythmGame
{
public class SongInformation : IBaseElement
@@ -35,7 +35,7 @@ namespace Ichni.RhythmGame
string extension = Path.GetExtension(songLocation).ToLower();
song = extension switch
{
".mp3" => ES3.LoadAudio(songLocation, AudioType.MPEG),
".mp3" => LoadMP3(songLocation),
".ogg" => ES3.LoadAudio(songLocation, AudioType.OGGVORBIS),
".wav" => ES3.LoadAudio(songLocation, AudioType.WAV),
_ => throw new Exception("Unsupported audio format: " + extension)
@@ -46,6 +46,22 @@ namespace Ichni.RhythmGame
}
songLength = song.length;
}
private AudioClip LoadMP3(string filepath)//猜猜我从哪里偷的
{
string filename = System.IO.Path.GetFileNameWithoutExtension(filepath);
MpegFile mpegFile = new MpegFile(filepath);
// assign samples into AudioClip
AudioClip ac = AudioClip.Create(filename,
(int)(mpegFile.Length / sizeof(float) / mpegFile.Channels),
mpegFile.Channels,
mpegFile.SampleRate,
true,
data => { int actualReadCount = mpegFile.ReadSamples(data, 0, data.Length); },
position => { mpegFile = new MpegFile(filepath); });
return ac;
}
public void SaveBM()
{

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
@@ -49,9 +50,11 @@ namespace Ichni.RhythmGame
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bloom Peak", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}
}
@@ -62,12 +65,12 @@ namespace Ichni.RhythmGame
public float duration;
public float peak;
public AnimationCurve intensityCurve;
public BloomEffect_BM()
{
}
public BloomEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -75,7 +78,7 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new BloomEffect(duration, peak, intensityCurve)

View File

@@ -14,10 +14,10 @@ namespace Ichni.RhythmGame
public float duration;
public Vector3 offsetValue;
public AnimationCurve offsetCurve;
Transform gameCameraTransform => EditorManager.instance.cameraManager.gameCamera.gameCamera.transform;
Tweener offsetTweener;
public CameraOffsetEffect(float duration, Vector3 offsetValue, AnimationCurve offsetCurve)
{
this.effectTime = this.duration;
@@ -25,7 +25,7 @@ namespace Ichni.RhythmGame
this.offsetValue = offsetValue;
this.offsetCurve = offsetCurve;
}
public override void Recover()
{
if (!EditorManager.instance.cameraManager.haveGameCamera)
@@ -44,7 +44,7 @@ namespace Ichni.RhythmGame
LogWindow.Log("No game camera found, cannot apply camera tilt effect.", Color.yellow);
return;
}
//GameCamera的摄像机本体能且只能被TiltEffect和OffsetEffect修改Transform并且必须归位
offsetTweener = gameCameraTransform.DOBlendableLocalMoveBy(offsetValue, duration).SetEase(offsetCurve);
}
@@ -62,11 +62,13 @@ namespace Ichni.RhythmGame
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(duration));
var curveButton = inspector.GenerateButton(this, subcontainer1, "Offset Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Offset Curve", nameof(offsetCurve)).SetAsCustomCurve();
});
var subcontainer2 = container.GenerateSubcontainer(1);
var offsetPeakField = inspector.GenerateVector3InputField(this, subcontainer2, "Offset Value", nameof(offsetValue));
SetRemove(subcontainer2);
}
}

View File

@@ -16,7 +16,7 @@ namespace Ichni.RhythmGame
public float amplitudeX;
public float amplitudeY;
public float amplitudeZ;
public CameraShakeEffect(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
{
this.effectTime = 0;
@@ -26,7 +26,7 @@ namespace Ichni.RhythmGame
this.amplitudeY = amplitudeY;
this.amplitudeZ = amplitudeZ;
}
public override void Adjust()
{
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.cameraShakeEffect).GetComponent<MMF_Player>();
@@ -38,7 +38,7 @@ namespace Ichni.RhythmGame
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, duration);
}
public override EffectBase_BM ConvertToBM()
{
return new CameraShakeEffect_BM(duration, frequency, amplitudeX, amplitudeY, amplitudeZ);
@@ -54,6 +54,7 @@ namespace Ichni.RhythmGame
var amplitudeXInputField = inspector.GenerateInputField(this, effectSettings, "Amplitude X", nameof(amplitudeX));
var amplitudeYInputField = inspector.GenerateInputField(this, effectSettings, "Amplitude Y", nameof(amplitudeY));
var amplitudeZInputField = inspector.GenerateInputField(this, effectSettings, "Amplitude Z", nameof(amplitudeZ));
SetRemove(effectSettings);
}
}
@@ -66,12 +67,12 @@ namespace Ichni.RhythmGame
public float amplitudeX;
public float amplitudeY;
public float amplitudeZ;
public CameraShakeEffect_BM()
{
}
public CameraShakeEffect_BM(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
{
this.effectTime = 0;

View File

@@ -15,10 +15,10 @@ namespace Ichni.RhythmGame
public float duration;
public Vector3 tiltValue;
public AnimationCurve tiltCurve;
Transform gameCameraTransform => EditorManager.instance.cameraManager.gameCamera.gameCamera.transform;
Tweener tiltTweener;
public CameraTiltEffect(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
{
this.effectTime = duration;
@@ -45,16 +45,16 @@ namespace Ichni.RhythmGame
LogWindow.Log("No game camera found, cannot apply camera tilt effect.", Color.yellow);
return;
}
//GameCamera的摄像机本体能且只能被TiltEffect和OffsetEffect修改Transform并且必须归位
tiltTweener = gameCameraTransform.DOBlendableLocalRotateBy(tiltValue, duration, RotateMode.FastBeyond360).SetEase(tiltCurve);
}
public override void Adjust()
{
}
public override EffectBase_BM ConvertToBM()
{
return new CameraTiltEffect_BM(duration, tiltValue, tiltCurve);
@@ -70,17 +70,18 @@ namespace Ichni.RhythmGame
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Camera Tilt");
var subcontainer1 = container.GenerateSubcontainer(3);
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(duration));
var tiltCurveButton = inspector.GenerateButton(this, subcontainer1, "Tilt Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Tilt Curve", nameof(tiltCurve)).SetAsCustomCurve();
});
var subcontainer2 = container.GenerateSubcontainer(1);
var tiltValueField = inspector.GenerateVector3InputField(this, subcontainer2, "Tilt Value", nameof(tiltValue));
SetRemove(subcontainer2);
}
}
@@ -91,14 +92,14 @@ namespace Ichni.RhythmGame
public float duration;
public Vector3 tiltValue;
public AnimationCurve tiltCurve;
public CameraTiltEffect_BM(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
{
this.effectTime = duration;
this.duration = duration;
this.tiltValue = tiltValue;
this.tiltCurve = tiltCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)

View File

@@ -13,9 +13,9 @@ namespace Ichni.RhythmGame
public float duration;
public float relativeZoom;
public AnimationCurve zoomCurve;
Camera gameCamera => EditorManager.instance.cameraManager.gameCamera.gameCamera;
public CameraZoomEffect(float duration, float relativeZoom, AnimationCurve zoomCurve)
{
this.effectTime = 0f;
@@ -23,7 +23,7 @@ namespace Ichni.RhythmGame
this.relativeZoom = relativeZoom;
this.zoomCurve = zoomCurve;
}
public override void Adjust()
{
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.cameraZoomEffect).GetComponent<MMF_Player>();
@@ -48,9 +48,10 @@ namespace Ichni.RhythmGame
var relativeZoomInputField = inspector.GenerateInputField(this, effectSettings, "Relative Zoom", nameof(relativeZoom));
var zoomCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var zoomCurveWindow =
var zoomCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(zoomCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}
}
@@ -64,16 +65,16 @@ namespace Ichni.RhythmGame
public CameraZoomEffect_BM()
{
}
public CameraZoomEffect_BM(float duration, float relativeZoom, AnimationCurve zoomCurve)
{
this.duration = duration;
this.relativeZoom = relativeZoom;
this.zoomCurve = zoomCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new CameraZoomEffect(duration, relativeZoom, zoomCurve);

View File

@@ -14,7 +14,7 @@ namespace Ichni.RhythmGame
public float duration;
public float peak;
public AnimationCurve intensityCurve;
public ChromaticAberrationEffect(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -32,12 +32,12 @@ namespace Ichni.RhythmGame
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, duration);
}
public override EffectBase_BM ConvertToBM()
{
return new ChromaticAberrationEffect_BM(duration, peak, intensityCurve);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
@@ -47,9 +47,10 @@ namespace Ichni.RhythmGame
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Peak Value", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}
}
@@ -63,9 +64,9 @@ namespace Ichni.RhythmGame
public ChromaticAberrationEffect_BM()
{
}
public ChromaticAberrationEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -73,7 +74,7 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new ChromaticAberrationEffect(duration, peak, intensityCurve);

View File

@@ -13,11 +13,11 @@ namespace Ichni.RhythmGame
public GameElement connectedGameElement;
public string connectedVariableName;
public int enableValue;
public bool useExpression;
public string expression;
public EnableControlEffect(GameElement connectedGameElement, string connectedVariableName,
public EnableControlEffect(GameElement connectedGameElement, string connectedVariableName,
int enableValue, bool useExpression, string expression)
{
this.effectTime = 0;
@@ -27,18 +27,18 @@ namespace Ichni.RhythmGame
this.useExpression = useExpression;
this.expression = expression;
}
public override void Recover()
{
if (connectedGameElement == null) return;
connectedGameElement.gameObject.SetActive(false);
}
public override void Adjust()
{
if (connectedGameElement == null) return;
if (!useExpression)
{
int value = EditorManager.instance.variablesContainer.GetVariable(connectedVariableName);
@@ -46,22 +46,22 @@ namespace Ichni.RhythmGame
}
else
{
}
}
public override EffectBase_BM ConvertToBM()
{
connectedGameElement.SaveBM();
return new EnableControlEffect_BM(connectedGameElement.elementGuid,
return new EnableControlEffect_BM(connectedGameElement.elementGuid,
connectedVariableName, enableValue, useExpression, expression);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Enable Control");
var effectSettings = container.GenerateSubcontainer(3);
var connectedGameElementInputField = inspector.GenerateInputField(effectSettings, "Game Element Name");
@@ -69,7 +69,7 @@ namespace Ichni.RhythmGame
{
connectedGameElement = EditorManager.instance.beatmapContainer.gameElementList
.First(e => e.elementName == connectedGameElementInputField.GetValue<string>());
if (connectedGameElement == null)
{
LogWindow.Log("Game Element not found.", Color.red);
@@ -80,15 +80,16 @@ namespace Ichni.RhythmGame
string ShowConnection() => connectedGameElement == null ? "No Game Element Connected" : "Connected With: " + connectedGameElement.elementName;
var connectHintText = inspector.GenerateHintText(this, effectSettings, ShowConnection);
var connectedVariableNameInputField = inspector.GenerateInputField(this, effectSettings, "Connected Variable Name", nameof(connectedVariableName));
var enableValueInputField = inspector.GenerateInputField(this, effectSettings, "Enable Value", nameof(enableValue));
// 自定义表达式暂时不可用
var useExpressionToggle = inspector.GenerateToggle(this, effectSettings, "Use Expression", nameof(useExpression));
useExpressionToggle.toggle.interactable = false;
var expressionInputField = inspector.GenerateInputField(this, effectSettings, "Expression", nameof(expression));
expressionInputField.inputField.interactable = false;
SetRemove(effectSettings);
}
}
@@ -104,10 +105,10 @@ namespace Ichni.RhythmGame
public EnableControlEffect_BM()
{
}
public EnableControlEffect_BM(Guid connectedGameElementGuid, string connectedVariableName,
public EnableControlEffect_BM(Guid connectedGameElementGuid, string connectedVariableName,
int enableValue, bool useExpression, string expression)
{
this.connectedGameElementGuid = connectedGameElementGuid;
@@ -119,7 +120,7 @@ namespace Ichni.RhythmGame
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new EnableControlEffect(GameElement_BM.GetElement(connectedGameElementGuid), connectedVariableName,
return new EnableControlEffect(GameElement_BM.GetElement(connectedGameElementGuid), connectedVariableName,
enableValue, useExpression, expression);
}
}

View File

@@ -14,7 +14,7 @@ namespace Ichni.RhythmGame
public float duration;
public float peak;
public AnimationCurve intensityCurve;
public HighPassFilterEffect(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -22,18 +22,18 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override void Adjust()
{
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.highPassFilterEffect).GetComponent<MMF_Player>();
effect.GetFeedbackOfType<MMF_AudioFilterHighPass>().Duration = duration;
effect.GetFeedbackOfType<MMF_AudioFilterHighPass>().RemapHighPassZero = 10;
effect.GetFeedbackOfType<MMF_AudioFilterHighPass>().RemapHighPassZero = 10;
effect.GetFeedbackOfType<MMF_AudioFilterHighPass>().RemapHighPassOne = peak;
effect.GetFeedbackOfType<MMF_AudioFilterHighPass>().ShakeHighPass = intensityCurve;
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, duration);
}
public override EffectBase_BM ConvertToBM()
{
return new HighPassFilterEffect_BM(duration, peak, intensityCurve);
@@ -48,25 +48,26 @@ namespace Ichni.RhythmGame
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}
}
namespace Beatmap
{
public class HighPassFilterEffect_BM: EffectBase_BM
public class HighPassFilterEffect_BM : EffectBase_BM
{
public float duration;
public float peak;
public AnimationCurve intensityCurve;
public HighPassFilterEffect_BM()
{
}
public HighPassFilterEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -74,7 +75,7 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new HighPassFilterEffect(duration, peak, intensityCurve);

View File

@@ -14,7 +14,7 @@ namespace Ichni.RhythmGame
public float duration;
public float bottom;
public AnimationCurve intensityCurve;
public LowPassFilterEffect(float duration, float bottom, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -22,7 +22,7 @@ namespace Ichni.RhythmGame
this.bottom = bottom;
this.intensityCurve = intensityCurve;
}
public override void Adjust()
{
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.lowPassFilterEffect).GetComponent<MMF_Player>();
@@ -33,7 +33,7 @@ namespace Ichni.RhythmGame
effect.PlayFeedbacks();
LeanPool.Despawn(effect.gameObject, duration);
}
public override EffectBase_BM ConvertToBM()
{
return new LowPassFilterEffect_BM(duration, bottom, intensityCurve);
@@ -48,25 +48,26 @@ namespace Ichni.RhythmGame
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(bottom));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}
}
namespace Beatmap
{
public class LowPassFilterEffect_BM: EffectBase_BM
public class LowPassFilterEffect_BM : EffectBase_BM
{
public float duration;
public float bottom;
public AnimationCurve intensityCurve;
public LowPassFilterEffect_BM()
{
}
public LowPassFilterEffect_BM(float duration, float bottom, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -74,7 +75,7 @@ namespace Ichni.RhythmGame
this.bottom = bottom;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new LowPassFilterEffect(duration, bottom, intensityCurve);

View File

@@ -12,13 +12,13 @@ namespace Ichni.RhythmGame
public float bottomX;
public float bottomY;
public AnimationCurve intensityCurve;
public PixelateEffect(float duration, float bottomX, float bottomY, AnimationCurve intensityCurve)
{
this.effectTime = duration;
this.duration = duration;
this.bottomX = bottomX;
this.bottomY = bottomY;
this.bottomY = bottomY;
this.intensityCurve = intensityCurve;
}
@@ -44,9 +44,9 @@ namespace Ichni.RhythmGame
{
float x = Mathf.Lerp(Screen.width, bottomX, intensityCurve.Evaluate(effectProgressPercent));
float y = Mathf.Lerp(Screen.height, bottomY, intensityCurve.Evaluate(effectProgressPercent));
Debug.Log(x + ", " + y);
EditorManager.instance.postProcessingManager.SetPixelateStrength(x,y);
// Debug.Log(x + ", " + y);
EditorManager.instance.postProcessingManager.SetPixelateStrength(x, y);
}
public override void Adjust()
@@ -54,7 +54,7 @@ namespace Ichni.RhythmGame
EditorManager.instance.postProcessingManager.SetPixelateStrength(Screen.width, Screen.height);
EditorManager.instance.postProcessingManager.SetFeatureActive(false);
}
public override EffectBase_BM ConvertToBM()
{
return new PixelateEffect_BM(duration, bottomX, bottomY, intensityCurve);
@@ -70,7 +70,7 @@ namespace Ichni.RhythmGame
var bottomYField = inspector.GenerateInputField(this, effectSettings, "Bottom Y", nameof(bottomY));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
@@ -78,6 +78,7 @@ namespace Ichni.RhythmGame
{
EditorManager.instance.postProcessingManager.SetFeatureActive(false);
});
SetRemove(effectSettings);
}
}
@@ -95,7 +96,7 @@ namespace Ichni.RhythmGame
this.effectTime = duration;
this.duration = duration;
this.bottomX = bottomX;
this.bottomY = bottomY;
this.bottomY = bottomY;
this.intensityCurve = intensityCurve;
}

View File

@@ -9,9 +9,9 @@ namespace Ichni.RhythmGame
public class SetIntegerEffect : EffectBase
{
public string targetVariableName;
public int targetValue;
public bool isRandom;
public int minValue;
public int maxValue;
@@ -51,6 +51,7 @@ namespace Ichni.RhythmGame
var isRandomToggle = inspector.GenerateToggle(this, effectSettings, "Is Random", nameof(isRandom));
var minValueInputField = inspector.GenerateInputField(this, effectSettings, "Min Value", nameof(minValue));
var maxValueInputField = inspector.GenerateInputField(this, effectSettings, "Max Value", nameof(maxValue));
SetRemove(effectSettings);
}
}
@@ -66,7 +67,7 @@ namespace Ichni.RhythmGame
public SetIntegerEffect_BM()
{
}
public SetIntegerEffect_BM(string targetVariableName, int targetValue, bool isRandom, int minValue, int maxValue)
@@ -78,7 +79,7 @@ namespace Ichni.RhythmGame
this.minValue = minValue;
this.maxValue = maxValue;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new SetIntegerEffect(targetVariableName, targetValue, isRandom, minValue, maxValue);

View File

@@ -16,7 +16,7 @@ namespace Ichni.RhythmGame
public float smoothness;
public Color color;
public AnimationCurve intensityCurve;
public VignetteEffect(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -41,12 +41,12 @@ namespace Ichni.RhythmGame
effect.PlayFeedbacks();
Lean.Pool.LeanPool.Despawn(effect.gameObject, duration);
}
public override EffectBase_BM ConvertToBM()
{
return new VignetteEffect_BM(duration, peak, smoothness, color, intensityCurve);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
@@ -57,12 +57,13 @@ namespace Ichni.RhythmGame
var smoothnessField = inspector.GenerateInputField(this, effectSettings, "Smoothness", nameof(smoothness));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
var colorSettings = container.GenerateSubcontainer(1);
var colorField = inspector.GenerateBaseColorPicker(this, colorSettings, "Color", nameof(color));
SetRemove(effectSettings);
}
}
@@ -75,12 +76,12 @@ namespace Ichni.RhythmGame
public float smoothness;
public Color color;
public AnimationCurve intensityCurve;
public VignetteEffect_BM()
{
}
public VignetteEffect_BM(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve)
{
this.effectTime = 0;
@@ -90,7 +91,7 @@ namespace Ichni.RhythmGame
this.color = color;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new VignetteEffect(duration, peak, smoothness, color, intensityCurve);

View File

@@ -17,8 +17,13 @@ namespace Ichni.RhythmGame
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
public bool MotionAngles = false;
private float SongTime => EditorManager.instance.songInformation.songTime;
public static TrackHeadPoint GenerateElement(string elementName, Guid id, List<string> tags,
bool isFirstGenerated, Track track)
{
TrackHeadPoint head = Instantiate(EditorManager.instance.basePrefabs.emptyObject, track.transform)
.AddComponent<TrackHeadPoint>();
@@ -41,7 +46,7 @@ namespace Ichni.RhythmGame
public void Update()
{
if (track.timeDurationSubmodule.CheckTimeInDuration(EditorManager.instance.songInformation.songTime))
if (SongTime > trackTimeSubmoduleMovable.trackStartTime && SongTime < trackTimeSubmoduleMovable.trackEndTime && track.timeDurationSubmodule.CheckTimeInDuration(SongTime))
{
trackPositioner.SetPercent(trackTimeSubmoduleMovable.headPercent);
}