update
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -84,6 +85,15 @@ namespace Ichni.RhythmGame
|
||||
AnimatedFloat nowAnimatedFloat = GetAnimatedFloat(nowTime); //获取当前时间点对应的AnimatedFloat
|
||||
if (nowAnimatedFloat != null) //如果能获取到,表明当前时间点存在动画
|
||||
{
|
||||
if (nowTime + Time.deltaTime >= nowAnimatedFloat.endTime)
|
||||
{
|
||||
value = nowAnimatedFloat.endValue;
|
||||
returnType = FlexibleReturnType.After;
|
||||
if (lastReturnType != returnType) isSwitchingReturnType = true;
|
||||
lastReturnType = returnType;
|
||||
return;
|
||||
}
|
||||
|
||||
//获取songTime时间点时,基于动画曲线的AnimatedFloat比例点->(0,1)。
|
||||
float nowPercent = AnimationCurveEvaluator.Evaluate(nowAnimatedFloat.animationCurveType,
|
||||
(nowTime - nowAnimatedFloat.startTime) / nowAnimatedFloat.totalTime);
|
||||
|
||||
@@ -46,8 +46,8 @@ namespace Ichni.RhythmGame
|
||||
this.currentEmissionColor = Color.black;
|
||||
this.currentEmissionIntensity = 0;
|
||||
|
||||
this.baseColorDirtyMark = false;
|
||||
this.emissionColorDirtyMark = false;
|
||||
this.baseColorDirtyMark = true;
|
||||
this.emissionColorDirtyMark = true;
|
||||
|
||||
if (!HaveSameSubmodule)
|
||||
{
|
||||
@@ -68,8 +68,8 @@ namespace Ichni.RhythmGame
|
||||
this.currentEmissionColor = originalEmissionColor;
|
||||
this.currentEmissionIntensity = originalEmissionIntensity;
|
||||
|
||||
this.baseColorDirtyMark = false;
|
||||
this.emissionColorDirtyMark = false;
|
||||
this.baseColorDirtyMark = true;
|
||||
this.emissionColorDirtyMark = true;
|
||||
|
||||
if (!HaveSameSubmodule)
|
||||
{
|
||||
@@ -116,13 +116,8 @@ namespace Ichni.RhythmGame
|
||||
.AddTo(colorSubmodule.attachedGameElement);
|
||||
}
|
||||
|
||||
public void UpdateColor()
|
||||
public void UpdateColor(bool refreshAll = true)
|
||||
{
|
||||
if (!GameManager.instance.audioManager.isUpdating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool willRefresh = false;
|
||||
|
||||
if (colorSubmodule.baseColorDirtyMark)
|
||||
@@ -139,7 +134,7 @@ namespace Ichni.RhythmGame
|
||||
willRefresh = true;
|
||||
}
|
||||
|
||||
if (willRefresh)
|
||||
if (willRefresh && refreshAll)
|
||||
{
|
||||
colorSubmodule.attachedGameElement.Refresh();
|
||||
}
|
||||
|
||||
@@ -89,19 +89,6 @@ namespace Ichni.RhythmGame
|
||||
Default,
|
||||
Note,
|
||||
}
|
||||
|
||||
private static Dictionary<string, EffectBase> EffectCollection { get; } =
|
||||
new Dictionary<string, EffectBase>()
|
||||
{
|
||||
{ "Bloom", new BloomEffect(1, 2, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "CameraShake", new CameraShakeEffect(1, 50, 1, 1, 1) },
|
||||
{ "ChromaticAberration", new ChromaticAberrationEffect(1, 1, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "Vignette", new VignetteEffect(1, 1, 0.4f, Color.black, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "SetInteger", new SetIntegerEffect("New Variable", 0, false, 0, 1) },
|
||||
{ "EnableControl", new EnableControlEffect(null, "New Variable", 0, false, "") },
|
||||
{ "LowPassFilter", new LowPassFilterEffect(1, 10, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "HighPassFilter", new HighPassFilterEffect(1, 22000, CustomCurvePresets.Parabolic(1, 0, 1)) }
|
||||
};
|
||||
}
|
||||
|
||||
public interface IHaveEffectSubmodule
|
||||
@@ -157,6 +144,8 @@ namespace Ichni.RhythmGame
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
|
||||
public GameElement attachedGameElement;
|
||||
|
||||
public virtual bool IsPost => false;
|
||||
|
||||
/// <summary>
|
||||
/// 效果的持续时间,如果为0则表示瞬间效果
|
||||
|
||||
@@ -124,8 +124,8 @@ namespace Ichni.RhythmGame
|
||||
remainingElementAmount.Value--;
|
||||
|
||||
float loadPercent = (float)(elementList.Count - remainingElementAmount.Value) / elementList.Count;
|
||||
GameManager.instance.projectLoader.loadPercent = loadPercent;
|
||||
GameManager.instance.gameLoadingCanvas.SetProgress(loadPercent * 100f);
|
||||
GameManager.instance.projectLoader.realLoadPercent = loadPercent;
|
||||
//GameManager.instance.gameLoadingCanvas.SetProgress(GameManager.instance.projectLoader.displayLoadPercent * 100f);
|
||||
|
||||
loadAmount++;
|
||||
if (loadAmount >= loadMaximumAmountPerFrame)
|
||||
@@ -147,8 +147,8 @@ namespace Ichni.RhythmGame
|
||||
remainingElementAmount.Value--;
|
||||
|
||||
float loadPercent = (float)(elementList.Count - remainingElementAmount.Value) / elementList.Count;
|
||||
GameManager.instance.projectLoader.loadPercent = loadPercent;
|
||||
GameManager.instance.gameLoadingCanvas.SetProgress(loadPercent * 100f);
|
||||
GameManager.instance.projectLoader.realLoadPercent = loadPercent;
|
||||
//GameManager.instance.gameLoadingCanvas.SetProgress(GameManager.instance.projectLoader.displayLoadPercent * 100f);
|
||||
|
||||
loadAmount++;
|
||||
if (loadAmount >= loadMaximumAmountPerFrame)
|
||||
@@ -169,8 +169,6 @@ namespace Ichni.RhythmGame
|
||||
GameManager.instance.noteManager.AllNotesRegistered();
|
||||
|
||||
Debug.Log("All elements loaded.");
|
||||
GameManager.instance.gameLoadingCanvas.FadeOut();
|
||||
GameManager.instance.audioManager.isLoading = false;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Ichni.RhythmGame
|
||||
this.bpm = bpm;
|
||||
this.delay = delay;
|
||||
this.offset = offset;
|
||||
|
||||
|
||||
GameManager.instance.audioManager.songPlayer.songTimeSegment = -delay; // 初始化时,歌曲时间为负
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user