void Update()
        {
            if (ship == null)
            {
                return;
            }

            float d = Vector3.Distance(ship.currentMap2DLocation, lastPosition);

            if (d > 0.002f)
            {
                if (ship.isMoving)
                {
                    if (trailParent == null)
                    {
                        trailParent = new GameObject("Trail");
                        trailParent.WMSK_MakeChild();                          // makes this placeholder part of the map so it scrolls with it properly. All path points will be parented to this placeholder so they can be deleted just by removing this placeholder.
                    }
                    GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                    sphere.transform.SetParent(trailParent.transform, false);
                    sphere.WMSK_MoveTo(lastPosition, false);
                }
                lastPosition = ship.currentMap2DLocation;
            }

            if (Input.GetKeyDown(KeyCode.S))
            {
                ship.Stop();
            }
        }
        void OnGUI()
        {
            // Do autoresizing of GUI layer
            GUIResizer.AutoResize();

            GUI.Box(new Rect(10, 10, 365, 75), "Fly to operations with viewport switching during movement.");

            // buttons background color
            GUI.backgroundColor = new Color(0.1f, 0.1f, 0.3f, 0.95f);

            if (map.renderViewportIsEnabled)
            {
                if (GUI.Button(new Rect(85, 40, 100, 30), "2D Mode", buttonStyle))
                {
                    FlyZoomOut();
                }
            }
            else
            {
                if (GUI.Button(new Rect(85, 40, 100, 30), "Viewport Mode", buttonStyle))
                {
                    FollowTankZoomIn();
                }
            }


            if (tank.isMoving)
            {
                if (GUI.Button(new Rect(205, 40, 100, 30), "Stop Tank", buttonStyle))
                {
                    tank.Stop();
                }
            }
            else
            {
                if (GUI.Button(new Rect(205, 40, 100, 30), "Resume", buttonStyle))
                {
                    tank.MoveTo(tank.endingMap2DLocation, 0.1f);
                }
            }
        }