private void Cleanup() { if (_velocityRay != null) { _velocityRay.Dispose(); _velocityRay = null; } if (_circles != null) { _circles.Dispose(); _circles = null; } }
//private void ShowMesh(bool toShow) { // if (toShow) { // _renderer.material.SetColor(UnityConstants.MaterialColor_Main, _originalMeshColor_Main); // _renderer.material.SetColor(UnityConstants.MaterialColor_Specular, _originalMeshColor_Specular); // // TODO audio on goes here // } // else { // _renderer.material.SetColor(UnityConstants.MaterialColor_Main, _hiddenMeshColor); // _renderer.material.SetColor(UnityConstants.MaterialColor_Specular, _hiddenMeshColor); // // TODO audio off goes here // } // //ShowVelocityRay(toShow); //} /// <summary> /// Shows a Ray indicating the course and speed of the ship. /// </summary> private void ShowVelocityRay(bool toShow) { if (DebugSettings.Instance.EnableShipVelocityRays) { if (!toShow && _velocityRay == null) { return; } if (_velocityRay == null) { Reference<float> shipSpeed = Presenter.GetShipSpeed(); _velocityRay = new VelocityRay("ShipVelocity", _transform, shipSpeed, parent: DynamicObjects.Folder, width: 1F, color: GameColor.Gray); } _velocityRay.Show(toShow); } }
private void EnableDebugShowVelocityRay(bool toEnable) { if (toEnable) { D.AssertNull(__velocityRay); Reference<float> shipSpeed = new Reference<float>(() => ActualSpeedValue); string name = __velocityRayNameFormat.Inject(DebugName); __velocityRay = new VelocityRay(name, transform, shipSpeed); AssessDebugShowVelocityRay(); } else { D.AssertNotNull(__velocityRay); __velocityRay.Dispose(); __velocityRay = null; } }
/// <summary> /// Shows a Vectrosity Ray indicating the course and speed of the ship. /// </summary> private void ShowVelocityRay(bool toShow) { if (DebugSettings.Instance.EnableShipVelocityRays) { if (!toShow && _velocityRay == null) { return; } if (_velocityRay == null) { var speedReference = new Reference<float>(() => _shipCaptain.Data.CurrentSpeed); _velocityRay = new VelocityRay("ShipVelocityRay", _shipCaptain.transform, speedReference, parent: DynamicObjectsFolder.Folder, width: 1F, color: GameColor.Gray); } if (toShow) { if (!_velocityRay.IsShowing) { StartCoroutine(_velocityRay.Show()); } } else if (_velocityRay.IsShowing) { _velocityRay.Hide(); } } }
protected override void Cleanup() { base.Cleanup(); if (_velocityRay != null) { _velocityRay.Dispose(); _velocityRay = null; } if (_trackingLabel != null) { Destroy(_trackingLabel.gameObject); _trackingLabel = null; } }
private void ShowVelocityRay(bool toShow) { if (DebugSettings.Instance.EnableFleetVelocityRays) { if (!toShow && _velocityRay == null) { return; } if (_velocityRay == null) { Reference<float> fleetSpeed = Presenter.GetFleetSpeedReference(); _velocityRay = new VelocityRay("FleetVelocityRay", _transform, fleetSpeed, parent: _dynamicObjects.Folder, width: 2F, color: GameColor.Green); } _velocityRay.Show(toShow); } }
private void Cleanup() { if (_velocityRay != null) { _velocityRay.Dispose(); _velocityRay = null; } if (_circles != null) { _circles.Dispose(); _circles = null; } if (_trackingLabel != null) { Destroy(_trackingLabel.gameObject); _trackingLabel = null; } }
protected override void Cleanup() { base.Cleanup(); if (_velocityRay != null) { _velocityRay.Dispose(); _velocityRay = null; } UnityUtility.DestroyIfNotNullOrAlreadyDestroyed(_trackingLabel, Destroy); }
private void EnableDebugShowVelocityRay(bool toEnable) { if (toEnable) { if (__velocityRay == null) { Reference<float> fleetSpeed = new Reference<float>(() => Data.ActualSpeedValue); string name = __velocityRayNameFormat.Inject(DebugName); Transform lineParent = DynamicObjectsFolder.Instance.Folder; __velocityRay = new VelocityRay(name, transform, fleetSpeed, lineParent, width: 2F, color: GameColor.Green); } AssessDebugShowVelocityRay(); } else { D.AssertNotNull(__velocityRay); __velocityRay.Dispose(); __velocityRay = null; } }