// Token: 0x0600016B RID: 363 RVA: 0x000306C4 File Offset: 0x0002E8C4 public void UpdateOutOfWaterState() { Vector3 headPosition = this.m_sein.PlatformBehaviour.PlatformMovement.HeadPosition; this.RemoveUnderwaterSounds(); for (int i = 0; i < Zones.WaterZones.Count; i++) { WaterZone waterZone = Zones.WaterZones[i]; if (waterZone.Bounds.Contains(headPosition)) { this.m_currentWater = waterZone; this.m_sein.PlatformBehaviour.PlatformMovement.LocalSpeedX *= 0.5f; if (Mathf.Abs(this.PlatformMovement.LocalSpeedY) <= this.SkipSurfaceSpeedIn && this.WaterSurfaceBound.Contains(this.PlatformMovement.Position)) { this.SwimOnSurface(); } else if (this.PlatformMovement.LocalSpeedY < 0f) { this.SwimUnderwater(); this.PlatformMovement.LocalSpeedY *= 0.8f; } else { this.m_currentWater = null; } return; } } }
// Token: 0x060031D9 RID: 12761 RVA: 0x000D03CC File Offset: 0x000CE5CC public virtual void FixedUpdate() { if (this.IsSuspended) { this.Rigidbody.velocity = Vector3.zero; return; } if (this.EnableCollisionGracePeriod && this.CurrentTime > this.CollisionGracePeriod) { this.m_collider.enabled = true; } if (this.m_lastLoop == null && this.ProjectileLoop != null) { this.m_lastLoop = Sound.Play(this.ProjectileLoop.GetSound(null), base.transform.position, this.m_nullify); if (this.m_lastLoop) { this.m_lastLoop.AttachTo = base.transform; } } this.CurrentTime += Time.deltaTime; if (this.CurrentTime > this.MaximumLiveTime) { this.m_explode = true; } if (WaterZone.PositionInWater(this.Position)) { this.m_explode = true; } if (this.Gravity > 0f) { this.SpeedVector += RandomizerBonusSkill.TimeScale(Vector3.down * this.Gravity * Time.fixedDeltaTime); } this.UpdateVelocity(); if (this.RotateSpriteToDirection) { float num = base.transform.eulerAngles.z; num = Mathf.MoveTowardsAngle(num, MoonMath.Angle.AngleFromDirection(this.Direction), this.SpriteTurnSpeed * Time.deltaTime); base.transform.eulerAngles = new Vector3(0f, 0f, num); } if (this.m_explode) { this.ExplodeProjectile(); } if (this.m_explodeLater) { this.m_explode = true; this.m_explodeLater = false; } }
// Token: 0x06000176 RID: 374 RVA: 0x000313D0 File Offset: 0x0002F5D0 public void HandleLeavingWater() { Vector3 position = this.m_sein.PlatformBehaviour.PlatformMovement.Position; for (int i = 0; i < Zones.WaterZones.Count; i++) { WaterZone waterZone = Zones.WaterZones[i]; if (waterZone.Bounds.Contains(position)) { this.m_currentWater = waterZone; return; } } if (this.RemainingBreath / this.Breath > 0.5f) { if (this.EmergeHighBreathSoundProvider) { Sound.Play(this.EmergeHighBreathSoundProvider.GetSound(null), base.transform.position, null); } } else if (this.RemainingBreath / this.Breath > 0.15f) { if (this.EmergeMedBreathSoundProvider) { Sound.Play(this.EmergeMedBreathSoundProvider.GetSound(null), base.transform.position, null); } } else if (this.EmergeLowBreathSoundProvider) { Sound.Play(this.EmergeLowBreathSoundProvider.GetSound(null), base.transform.position, null); } this.RestoreBreath(); this.HideBreathingUI(); if (this.m_currentWater.HasTopSurface && this.WaterSurfaceBound.Contains(this.PlatformMovement.Position)) { this.SwimOnSurface(); } else { this.GetOutOfWater(); } }