public override void Update(Golem entity, bool dirty, ref bool running) { if (dirty) { running = entity.Get <bool>(Enabled); } entity.Set(Output, Mathf.Sin(Frequency * Time.time) * Amplitude); }
public override void Update(Golem entity, bool dirty, ref bool running) { if (dirty) { current = entity.Get <float>(Input); deltaPerSecond = current / Duration; } else { current = Mathf.MoveTowards(current, 0f, deltaPerSecond * Time.smoothDeltaTime); } running = current != 0f; }
public override void Update(Golem entity, bool dirty, ref bool running) { Renderer.enabled = entity.Get <bool>(Input); }
public override void Update(Golem entity, bool dirty, ref bool running) { entity.Set(Output, !entity.Get <bool>(Input)); }