public void FixedUpdate() { if (!HighLogic.LoadedSceneIsFlight) { ExplosionEvents.Clear(); return; } //floating origin and velocity offloading corrections if (!FloatingOrigin.Offset.IsZero() || !Krakensbane.GetFrameVelocity().IsZero()) { transform.position -= FloatingOrigin.OffsetNonKrakensbane; } while (ExplosionEvents.Count > 0 && ExplosionEvents.Peek().TimeToImpact <= TimeIndex) { BlastHitEvent eventToExecute = ExplosionEvents.Dequeue(); var partBlastHitEvent = eventToExecute as PartBlastHitEvent; if (partBlastHitEvent != null) { ExecutePartBlastEvent(partBlastHitEvent); } else { ExecuteBuildingBlastEvent((BuildingBlastHitEvent)eventToExecute); } } }
public void FixedUpdate() { while (ExplosionEvents.Count > 0 && ExplosionEvents.Peek().TimeToImpact <= TimeIndex) { BlastHitEvent eventToExecute = ExplosionEvents.Dequeue(); var partBlastHitEvent = eventToExecute as PartBlastHitEvent; if (partBlastHitEvent != null) { ExecutePartBlastEvent(partBlastHitEvent); } else { ExecuteBuildingBlastEvent((BuildingBlastHitEvent)eventToExecute); } } }
public void FixedUpdate() { if (!gameObject.activeInHierarchy) { return; } //floating origin and velocity offloading corrections if (!FloatingOrigin.Offset.IsZero() || !Krakensbane.GetFrameVelocity().IsZero()) { transform.position -= FloatingOrigin.OffsetNonKrakensbane; } if (!isFX) { while (ExplosionEvents.Count > 0 && ExplosionEvents.Peek().TimeToImpact <= TimeIndex) { BlastHitEvent eventToExecute = ExplosionEvents.Dequeue(); var partBlastHitEvent = eventToExecute as PartBlastHitEvent; if (partBlastHitEvent != null) { ExecutePartBlastEvent(partBlastHitEvent); } else { ExecuteBuildingBlastEvent((BuildingBlastHitEvent)eventToExecute); } } } if (disabled && ExplosionEvents.Count == 0 && TimeIndex > MaxTime) { if (BDArmorySettings.DRAW_DEBUG_LABELS) { Debug.Log("[BDArmory]:Explosion Finished"); } gameObject.SetActive(false); return; } }