DTM Trail
This commit is contained in:
@@ -65,6 +65,11 @@ namespace Ichni.RhythmGame
|
||||
// }
|
||||
//
|
||||
|
||||
public interface IHaveInteraction
|
||||
{
|
||||
public void TriggerInteraction();
|
||||
}
|
||||
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
|
||||
@@ -61,11 +61,21 @@ namespace Ichni.RhythmGame
|
||||
/// <returns>返回距离当前时间最近的前一个AnimatedBool</returns>
|
||||
AnimatedBool GetAnimatedBool(float nowTime)
|
||||
{
|
||||
if (nowTime < animations[0].time)
|
||||
{
|
||||
return animations[0];
|
||||
}
|
||||
|
||||
if (nowTime > animations[animations.Count - 1].time)
|
||||
{
|
||||
return animations[animations.Count - 1];
|
||||
}
|
||||
|
||||
for (int i = 0; i < animations.Count; i++)
|
||||
{
|
||||
if (nowTime >= animations[i].time)
|
||||
if (nowTime < animations[i].time)
|
||||
{
|
||||
return animations[i];
|
||||
return animations[i - 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,14 @@ namespace Ichni.RhythmGame
|
||||
public bool baseColorDirtyMark;
|
||||
public bool emissionColorDirtyMark;
|
||||
|
||||
public Color GetCurrentEmissionColor()
|
||||
{
|
||||
float intensity = Mathf.Pow(2, currentEmissionIntensity);
|
||||
Color emissionColor = currentEmissionColor * intensity;
|
||||
emissionColor.a = 1;
|
||||
return emissionColor;
|
||||
}
|
||||
|
||||
public ColorSubmodule(GameElement attachedGameElement) : base(attachedGameElement)
|
||||
{
|
||||
this.originalBaseColor = Color.white;
|
||||
@@ -117,6 +125,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
currentBaseColor = originalBaseColor;
|
||||
currentEmissionColor = originalEmissionColor;
|
||||
currentEmissionIntensity = originalEmissionIntensity;
|
||||
baseColorDirtyMark = true;
|
||||
emissionColorDirtyMark = true;
|
||||
}
|
||||
@@ -125,7 +134,7 @@ namespace Ichni.RhythmGame
|
||||
public interface IHaveColorSubmodule
|
||||
{
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public bool haveEmission { get; }
|
||||
public bool haveEmission => false;
|
||||
|
||||
public void SetColorObserver()
|
||||
{
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Ichni.RhythmGame
|
||||
public TimeDurationSubmodule(GameElement attachedGameElement) : base(attachedGameElement)
|
||||
{
|
||||
isOverridingDuration = false;
|
||||
startTime = -EditorManager.instance.songInformation.delay;//TODO: 换为-delay
|
||||
endTime = EditorManager.instance.songInformation.songTime;//TODO: 换为songLength
|
||||
startTime = -32767;//TODO: 换为-delay
|
||||
endTime = 32767;//TODO: 换为songLength
|
||||
|
||||
(attachedGameElement as IHaveTimeDurationSubmodule).timeDurationSubmodule = this;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace Ichni.RhythmGame
|
||||
() => EmissionColorChange.GenerateElement("New Emission Color Change", Guid.NewGuid(), new List<string>(), true,
|
||||
this, new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Ichni.RhythmGame
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
public ColorSubmodule colorSubmodule { get; set; }
|
||||
public bool haveEmission => false;
|
||||
public virtual bool haveEmission => false;
|
||||
|
||||
public static SubstantialObject GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
string themeBundleName, string objectName, GameElement parentElement)
|
||||
|
||||
@@ -7,9 +7,9 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class Trail : GameElement, IHaveTransformSubmodule
|
||||
public partial class Trail : GameElement, IHaveTransformSubmodule, IHaveTrail
|
||||
{
|
||||
public TrailRenderer trailRenderer;
|
||||
public TrailRenderer trailRenderer { get; set; }
|
||||
public Material renderMaterial;
|
||||
|
||||
public float visibleTimeLength;
|
||||
@@ -88,7 +88,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
foreach (GameElement x in EditorManager.instance.beatmapContainer.gameElementList)
|
||||
{
|
||||
if (x is Trail t)
|
||||
if (x is IHaveTrail t)
|
||||
{
|
||||
t.trailRenderer.emitting = emitting;
|
||||
if(willClear) t.trailRenderer.Clear();
|
||||
@@ -96,6 +96,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaveTrail
|
||||
{
|
||||
TrailRenderer trailRenderer { get; set; }
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user