fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
This commit is contained in:
parent
1d28956872
commit
dd44a4d09c
|
|
@ -647,9 +647,8 @@ namespace HeavenStudio.Games
|
||||||
List<RiqEntity> prevEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split(0) == "karateman");
|
List<RiqEntity> prevEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split(0) == "karateman");
|
||||||
|
|
||||||
RiqEntity voice = prevEntities.FindLast(c => c.beat < beat && c.datamodel == "karateman/warnings");
|
RiqEntity voice = prevEntities.FindLast(c => c.beat < beat && c.datamodel == "karateman/warnings");
|
||||||
if (wordClearTime > beat && voice != null) {
|
if (wordClearTime > beat && wordStartTime < beat && voice != null) {
|
||||||
var type = voice["whichWarning"];
|
DoWord(voice.beat, voice.length, voice["whichWarning"], false, 1, voice["customLength"], false);
|
||||||
Word.Play($"Word0{(type < (int)HitThree.HitThreeAlt ? type : type - 1)}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// init colors
|
// init colors
|
||||||
|
|
@ -688,34 +687,36 @@ namespace HeavenStudio.Games
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
var cond = Conductor.instance;
|
var cond = Conductor.instance;
|
||||||
|
var songPos = cond.songPositionInBeatsAsDouble;
|
||||||
|
Debug.Log("songPos : " + songPos);
|
||||||
|
|
||||||
if (!cond.isPlaying) {
|
if (!cond.isPlaying) {
|
||||||
EntityPreCheck(cond.songPositionInBeatsAsDouble);
|
EntityPreCheck(songPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (currentBgEffect)
|
switch (currentBgEffect)
|
||||||
{
|
{
|
||||||
case (int) BackgroundFXType.Sunburst:
|
case (int) BackgroundFXType.Sunburst:
|
||||||
bgEffectAnimator.DoNormalizedAnimation("Sunburst", (cond.songPositionInBeats * 0.5f) % 1f);
|
bgEffectAnimator.DoNormalizedAnimation("Sunburst", (float)(songPos * 0.5) % 1f);
|
||||||
break;
|
break;
|
||||||
case (int) BackgroundFXType.Rings:
|
case (int) BackgroundFXType.Rings:
|
||||||
bgEffectAnimator.DoNormalizedAnimation("Rings", (cond.songPositionInBeats * 0.5f) % 1f);
|
bgEffectAnimator.DoNormalizedAnimation("Rings", (float)(songPos * 0.5) % 1f);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bgEffectAnimator.Play("NoPose", -1, 0);
|
bgEffectAnimator.Play("NoPose", -1, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cond.songPositionInBeatsAsDouble >= wordClearTime) {
|
if (songPos >= wordClearTime && songPos < wordStartTime) {
|
||||||
Word.Play("NoPose");
|
Word.Play("NoPose");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cond.songPositionInBeatsAsDouble >= startCamSpecial && cond.songPositionInBeatsAsDouble <= wantsReturn)
|
if (songPos >= startCamSpecial && songPos <= wantsReturn)
|
||||||
{
|
{
|
||||||
float camX = 0f;
|
float camX = 0f;
|
||||||
float camY = 0f;
|
float camY = 0f;
|
||||||
float camZ = 0f;
|
float camZ = 0f;
|
||||||
if (cond.songPositionInBeatsAsDouble <= startCamSpecial + cameraReturnLength)
|
if (songPos <= startCamSpecial + cameraReturnLength)
|
||||||
{
|
{
|
||||||
float prog = cond.GetPositionFromBeat(startCamSpecial, cameraReturnLength);
|
float prog = cond.GetPositionFromBeat(startCamSpecial, cameraReturnLength);
|
||||||
camX = Util.EasingFunction.EaseOutCubic(CameraPosition[0].position.x, CameraPosition[1].position.x, prog);
|
camX = Util.EasingFunction.EaseOutCubic(CameraPosition[0].position.x, CameraPosition[1].position.x, prog);
|
||||||
|
|
@ -723,7 +724,7 @@ namespace HeavenStudio.Games
|
||||||
camZ = Util.EasingFunction.EaseOutCubic(CameraPosition[0].position.z, CameraPosition[1].position.z, prog);
|
camZ = Util.EasingFunction.EaseOutCubic(CameraPosition[0].position.z, CameraPosition[1].position.z, prog);
|
||||||
cameraPosition = new Vector3(camX, camY, camZ);
|
cameraPosition = new Vector3(camX, camY, camZ);
|
||||||
}
|
}
|
||||||
else if (cond.songPositionInBeatsAsDouble >= wantsReturn - cameraReturnLength)
|
else if (songPos >= wantsReturn - cameraReturnLength)
|
||||||
{
|
{
|
||||||
float prog = cond.GetPositionFromBeat(wantsReturn - cameraReturnLength, cameraReturnLength);
|
float prog = cond.GetPositionFromBeat(wantsReturn - cameraReturnLength, cameraReturnLength);
|
||||||
camX = Util.EasingFunction.EaseOutQuad(CameraPosition[1].position.x, CameraPosition[0].position.x, prog);
|
camX = Util.EasingFunction.EaseOutQuad(CameraPosition[1].position.x, CameraPosition[0].position.x, prog);
|
||||||
|
|
@ -808,6 +809,7 @@ namespace HeavenStudio.Games
|
||||||
var songPos = Conductor.instance.songPositionInBeatsAsDouble;
|
var songPos = Conductor.instance.songPositionInBeatsAsDouble;
|
||||||
if (songPos <= clear && songPos >= beat) {
|
if (songPos <= clear && songPos >= beat) {
|
||||||
wordClearTime = customLength ? (beat + length) : clear;
|
wordClearTime = customLength ? (beat + length) : clear;
|
||||||
|
wordStartTime = beat;
|
||||||
}
|
}
|
||||||
return $"Word0{(type < (int)HitThree.HitThreeAlt ? type : type - 1)}";
|
return $"Word0{(type < (int)HitThree.HitThreeAlt ? type : type - 1)}";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue