// // Silly me for wanting to make the code neat, forgot this was Udon :) // using System.Collections; // using System.Collections.Generic; // using UdonSharp; // using UnityEngine; // public abstract class TimeSequence : UdonSharpBehaviour // { // [UdonSynced] float secondsPassed; // int sequenceProgress; // float[] sequenceTimeSeconds; // protected TimeSequence(float[] sequenceTimeSeconds) // { // sequenceProgress = 0; // secondsPassed = 0; // this.sequenceTimeSeconds = sequenceTimeSeconds; // ProgressSequenceToTime(secondsPassed); // } // public void ProgressInTime(float deltaSeconds) // { // ProgressSequenceToTime(secondsPassed + deltaSeconds); // } // public void ProgressSequenceToTime(float seconds) // { // secondsPassed = seconds; // while (secondsPassed >= sequenceTimeSeconds[sequenceProgress]) // { // sequenceProgress += 1; // SequenceStep(sequenceProgress); // } // } // protected abstract void SequenceStep(int sequneceProgress); // public static float[] DeltaToAbsolute(float[] delta) // { // if (delta.Length < 1) // { // return new float[0]; // } // float[] absolute = new float[delta.Length]; // absolute[0] = delta[0]; // for (int i = 1; i < delta.Length; i++) // { // absolute[i] = delta[i] + absolute[i-1]; // } // return absolute; // } // public int SequenceProgress // { // get => sequenceProgress; // } // public float SecondsPassed // { // get => secondsPassed; // set => ProgressSequenceToTime(value); // } // }