Ejemplo n.º 1
0
        private Vector2 CalculatePosition(QT_MapMarker marker)
        {
            float   compassDegree     = CompassSize.x / 360;
            Vector2 referencePosition = ReferenceObject.Position(QT_MapType.Map3D);
            Vector2 referenceForward  = new Vector2(ReferenceObject.transform.forward.x, ReferenceObject.transform.forward.z);
            float   angle             = Vector2.SignedAngle(marker.Object.Position(QT_MapType.Map3D) - referencePosition, referenceForward);

            return(new Vector2(compassDegree * angle, 0));
        }
Ejemplo n.º 2
0
        protected virtual Vector2 CalculatePosition(QT_MapMarker marker)
        {
            Vector2 mapSize    = rectTransform.rect.size;
            Vector2 worldToMap = new Vector2(mapSize.x / WorldSize.x, mapSize.y / WorldSize.y);
            Vector2 difference = marker.Object.Position(Type) - ReferenceObject.Position(Type);

            Zoom = Mathf.Clamp(Zoom, MinZoom, MaxZoom);

            return(new Vector2(difference.x * worldToMap.x * Zoom, difference.y * worldToMap.y * Zoom));
        }