public override void Bind(Entity entity, Main main, bool creating = false) { entity.CannotSuspendByDistance = true; Transform transform = entity.GetOrCreate <Transform>("Transform"); Ticker ticker = entity.GetOrCreate <Ticker>("Ticker"); Sequence sequence = entity.GetOrCreate <Sequence>("Sequence"); ticker.Add(new CommandBinding(ticker.OnFire, sequence.Advance)); ticker.Add(new CommandBinding(sequence.Done, ticker.Disable)); this.SetMain(entity, main); entity.Add("Commands", sequence.Commands); entity.Add("Advance", sequence.Advance); entity.Add("Done", sequence.Done); entity.Add("Index", sequence.Index); entity.Add("Disable", ticker.Disable); entity.Add("Enable", ticker.Enable); entity.Add("Enabled", ticker.Enabled); entity.Add("Interval", ticker.Interval); }
public void Add(float value) { ticker.Add(value); }
void Awake() { _ticker = new Ticker(TimeUtils.CurrentTimeInMs()); _ticker.Add(this); }