private void ShowCircle(CircleHighlightID id) {
     if (_circles == null) {
         D.AssertNotNull(_trackedClientTransform, DebugName);
         _circles = new HighlightCircle(CircleTitle, _trackedClientTransform, _circleRadius, _isCircleSizeDynamic, maxCircles: 3);
         _circles.Colors = new List<GameColor>() { TempGameValues.FocusedColor, TempGameValues.SelectedColor, TempGameValues.GeneralHighlightColor };
         _circles.Widths = new List<float>() { 2F, 2F, 1F };
     }
     _circles.Show(true, GetCircleIndex(id));
 }
Example #2
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor * _item.Size;
         _circles = new HighlightCircle("ItemCircle", Target, normalizedRadius, parent: DynamicObjectsFolder.Folder, isRadiusDynamic: true, maxCircles: 1, width: 3F, color: UnityDebugConstants.FocusedColor);
     }
     if (toShow) {
         //D.Log("Item attempting to show circle {0}.", highlight.GetName());
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
Example #3
0
 protected void ShowCircle(bool toShow, Highlights highlight) {
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = calcNormalizedCircleRadius();
         string circlesTitle = "{0} Circle".Inject(gameObject.name);
         _circles = new HighlightCircle(circlesTitle, _transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: _isCirclesRadiusDynamic, maxCircles: 3);
         _circles.Colors = new GameColor[3] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor, UnityDebugConstants.GeneralHighlightColor };
         _circles.Widths = new float[3] { 2F, 2F, 1F };
     }
     //string showHide = toShow ? "showing" : "not showing";
     //D.Log("{0} {1} circle {2}.", gameObject.name, showHide, highlight.GetName());
     _circles.Show(toShow, (int)highlight);
 }
Example #4
0
 private void Cleanup() {
     if (_velocityRay != null) {
         _velocityRay.Dispose();
         _velocityRay = null;
     }
     if (_circles != null) {
         _circles.Dispose();
         _circles = null;
     }
 }
Example #5
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused || highlight == Highlights.Selected || highlight == Highlights.General);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor * _shipCaptain.Size;
         _circles = new HighlightCircle("ShipCircles", _shipCaptain.transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: true, maxCircles: 3);
         _circles.Colors = new GameColor[3] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor, UnityDebugConstants.GeneralHighlightColor };
         _circles.Widths = new float[3] { 2F, 2F, 1F };
     }
     if (toShow) {
         D.Log("Ship {1} attempting to show circle {0}.", highlight.GetValueName(), _shipCaptain.Data.Name);
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
Example #6
0
 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;
     }
 }
Example #7
0
 private void ShowCircle(bool toShow, Highlights highlight) {
     D.Assert(highlight == Highlights.Focused || highlight == Highlights.Selected);
     if (!toShow && _circles == null) {
         return;
     }
     if (_circles == null) {
         float normalizedRadius = Screen.height * circleScaleFactor;
         _circles = new HighlightCircle("FleetCircles", _fleetCmd.transform, normalizedRadius, parent: DynamicObjectsFolder.Folder,
             isRadiusDynamic: false, maxCircles: 2);
         _circles.Colors = new GameColor[2] { UnityDebugConstants.FocusedColor, UnityDebugConstants.SelectedColor };
         _circles.Widths = new float[2] { 2F, 2F };
     }
     if (toShow) {
         //D.Log("Fleet attempting to show circle {0}.", highlight.GetName());
         if (!_circles.IsShowing) {
             StartCoroutine(_circles.ShowCircles((int)highlight));
         }
         else {
             _circles.AddCircle((int)highlight);
         }
     }
     else if (_circles.IsShowing) {
         _circles.RemoveCircle((int)highlight);
     }
 }
 public override void HandleClientDeath() {
     base.HandleClientDeath();
     if (_circles != null) {
         _circles.Dispose();
         _circles = null;
     }
 }