epic reveal
This commit is contained in:
parent
8e35e4280e
commit
b1590db7b0
File diff suppressed because it is too large
Load diff
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Util;
|
||||
using Starpelly;
|
||||
|
||||
namespace HeavenStudio
|
||||
{
|
||||
|
|
@ -21,6 +22,8 @@ namespace HeavenStudio
|
|||
private double time;
|
||||
private double targetBopBeat;
|
||||
|
||||
private int loops;
|
||||
|
||||
private double lastAbsTime;
|
||||
private void Start()
|
||||
{
|
||||
|
|
@ -35,6 +38,7 @@ namespace HeavenStudio
|
|||
{
|
||||
time = 0;
|
||||
targetBopBeat = 0;
|
||||
loops++;
|
||||
}
|
||||
double absTime = Time.realtimeSinceStartup;
|
||||
double dt = absTime - lastAbsTime;
|
||||
|
|
@ -45,10 +49,21 @@ namespace HeavenStudio
|
|||
songPos = time;
|
||||
|
||||
songPosBeat = SecsToBeats(songPos);
|
||||
|
||||
if (loops == 0)
|
||||
{
|
||||
float normalizedBeat = GetPositionFromBeat(4, 1);
|
||||
if (normalizedBeat > 0 && normalizedBeat <= 1f)
|
||||
{
|
||||
logoAnim.DoNormalizedAnimation("Reveal", normalizedBeat);
|
||||
}
|
||||
else if (normalizedBeat < 0)
|
||||
{
|
||||
logoAnim.DoNormalizedAnimation("Reveal", 0);
|
||||
}
|
||||
}
|
||||
if (songPosBeat >= targetBopBeat)
|
||||
{
|
||||
logoAnim.Play("LogoBop", 0, 0);
|
||||
if (targetBopBeat > 4) logoAnim.Play("LogoBop", 0, 0);
|
||||
targetBopBeat += 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -57,6 +72,12 @@ namespace HeavenStudio
|
|||
{
|
||||
return s / 60f * bpm;
|
||||
}
|
||||
|
||||
public float GetPositionFromBeat(float startBeat, float length)
|
||||
{
|
||||
float a = Mathp.Normalize((float)songPosBeat, startBeat, startBeat + length);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue