// Update is called once per frame void Update() { if (activated) { ActionFsm.Execute(); if (timer > 0) { timer -= Time.deltaTime; if ((int)(timer / (hitFlashLength * 0.125f)) % 2 == 1) { this.spriteRenderer.color = hitColor; } if ((int)(timer / (hitFlashLength * 0.125f)) % 2 == 0) { this.spriteRenderer.color = previousColor; } if (timer <= 0) { this.spriteRenderer.color = previousColor; } } //Moving back and forth } }
// Update is called once per frame void FixedUpdate() { if (activated) { ActionFsm.FixedExecute(); } }