public void RemoveFlashing(SmartEntity entity) { for (int i = this.flashingEntities.Count - 1; i >= 0; i--) { FlashingEntity flashingEntity = this.flashingEntities[i]; if (flashingEntity.Entity == entity) { this.StopFlashing(i); } } }
public void OnViewFrameTime(float dt) { for (int i = this.flashingEntities.Count - 1; i >= 0; i--) { FlashingEntity flashingEntity = this.flashingEntities[i]; if (flashingEntity.Flash(dt)) { this.StopFlashing(i); } } }
public void RemoveFlashingFromAllEntities() { if (this.flashingEntities.Count == 0) { return; } int count = this.flashingEntities.Count; for (int i = 0; i < count; i++) { FlashingEntity flashingEntity = this.flashingEntities[i]; flashingEntity.Complete(); } this.flashingEntities.Clear(); this.UnregisterObservers(); }
private void StopFlashing(int i) { FlashingEntity flashingEntity = this.flashingEntities[i]; flashingEntity.Complete(); this.flashingEntities.RemoveAt(i); if (this.flashingEntities.Count == 0) { this.UnregisterObservers(); } GameObjectViewComponent gameObjectViewComp = flashingEntity.Entity.GameObjectViewComp; if (gameObjectViewComp != null) { gameObjectViewComp.IsFlashing = false; } }
public void RemoveFlashing(SmartEntity entity) { bool flag = false; for (int i = this.flashingEntities.Count - 1; i >= 0; i--) { FlashingEntity flashingEntity = this.flashingEntities[i]; if (flashingEntity.Entity == entity) { flag = true; this.StopFlashing(i); } } if (flag) { this.TrySendShaderResetOnEntityEvent(); } }
public void OnViewFrameTime(float dt) { bool flag = false; for (int i = this.flashingEntities.Count - 1; i >= 0; i--) { FlashingEntity flashingEntity = this.flashingEntities[i]; if (flashingEntity.Flash(dt)) { flag = true; this.StopFlashing(i); } } if (flag) { this.TrySendShaderResetOnEntityEvent(); } }
public void AddFlashing(SmartEntity entity, float flashDuration, float flashDelay) { GameObjectViewComponent gameObjectViewComp = entity.GameObjectViewComp; if (gameObjectViewComp == null) { return; } if (gameObjectViewComp.IsFlashing) { return; } gameObjectViewComp.IsFlashing = true; if (this.flashingEntities.Count == 0) { this.RegisterObservers(); } FlashingEntity item = new FlashingEntity(entity, gameObjectViewComp.MainGameObject, flashDuration, flashDelay); this.flashingEntities.Add(item); }