Trick on the Class: flying objects

This commit is contained in:
minenice55
2022-04-10 18:29:31 -04:00
parent 51c529a16f
commit beeb309e26
3 changed files with 136 additions and 41 deletions

View File

@ -23,12 +23,30 @@ namespace HeavenStudio.Games.Scripts_TrickClass
private void Awake()
{
game = TrickClass.instance;
flyBeats = flyType ? 4f : 2f;
var cond = Conductor.instance;
float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats);
transform.position = curve.GetPoint(flyPos);
}
// Update is called once per frame
void Update()
{
if (flying)
{
var cond = Conductor.instance;
float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats);
transform.position = curve.GetPoint(flyPos);
if (flyPos > 1f)
{
GameObject.Destroy(gameObject);
return;
}
}
}
}
}