コード例 #1
0
ファイル: ShipGraphics.cs プロジェクト: Maxii/CodeEnv.Master
 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);
     }
 }