Exemplo n.º 1
0
 private void Update()
 {
     this.m_currentVisibleZone = null;
     if (this.m_currentMapMission > 0)
     {
         this.m_secondsMissionHasBeenSelected += Time.get_deltaTime();
     }
 }
 private void Update()
 {
     this.m_currentVisibleZone = null;
     if (this.m_currentMapMission > 0)
     {
         this.m_secondsMissionHasBeenSelected += Time.get_deltaTime();
     }
     if (this.m_mapAndRewardParentViewRT.get_sizeDelta().x != this.m_parentViewRT.get_rect().get_width())
     {
         this.m_multiPanelViewSizeDelta   = this.m_mapAndRewardParentViewRT.get_sizeDelta();
         this.m_multiPanelViewSizeDelta.x = this.m_parentViewRT.get_rect().get_width();
         this.m_mapAndRewardParentViewRT.set_sizeDelta(this.m_multiPanelViewSizeDelta);
     }
 }
Exemplo n.º 3
0
    public void CenterAndZoom(Vector2 tapPos, ZoneButton zoneButton, bool zoomIn)
    {
        iTween.Stop(this.m_mapViewContentsRT.get_gameObject());
        iTween.Stop(base.get_gameObject());
        this.m_lastTappedZoneButton = zoneButton;
        Vector3[] array = new Vector3[4];
        this.m_mapViewRT.GetWorldCorners(array);
        float   num  = array[2].x - array[0].x;
        float   num2 = array[2].y - array[0].y;
        Vector2 vector;

        vector.x = array[0].x + num * 0.5f;
        vector.y = array[0].y + num2 * 0.5f;
        Vector3[] array2 = new Vector3[4];
        this.m_mapViewContentsRT.GetWorldCorners(array2);
        float   num3 = array2[2].x - array2[0].x;
        float   num4 = array2[2].y - array2[0].y;
        Vector2 vector2;

        vector2.x = array2[0].x + num3 * 0.5f;
        vector2.y = array2[0].y + num4 * 0.5f;
        MapInfo componentInChildren = base.GetComponentInChildren <MapInfo>();

        if (componentInChildren == null)
        {
            return;
        }
        if (zoomIn)
        {
            if (this.m_pinchZoomContentManager.m_zoomFactor < 1.001f)
            {
                Main.instance.m_UISound.Play_MapZoomIn();
            }
            Vector2 vector3 = tapPos - vector2;
            vector3 *= componentInChildren.m_maxZoomFactor / this.m_pinchZoomContentManager.m_zoomFactor;
            Vector2 vector4 = vector2 + vector3;
            iTween.ValueTo(base.get_gameObject(), iTween.Hash(new object[]
            {
                "name",
                "Zoom View In",
                "from",
                this.m_pinchZoomContentManager.m_zoomFactor,
                "to",
                componentInChildren.m_maxZoomFactor,
                "easeType",
                "easeOutCubic",
                "time",
                0.8f,
                "onupdate",
                "ZoomInTweenCallback"
            }));
            iTween.MoveBy(this.m_mapViewContentsRT.get_gameObject(), iTween.Hash(new object[]
            {
                "name",
                "Pan View To Point (in)",
                "x",
                vector.x - vector4.x,
                "y",
                vector.y - vector4.y,
                "easeType",
                "easeOutQuad",
                "time",
                0.8f
            }));
        }
        else
        {
            if (this.OnZoomOutMap != null)
            {
                this.OnZoomOutMap.Invoke();
            }
            iTween.ValueTo(base.get_gameObject(), iTween.Hash(new object[]
            {
                "name",
                "Zoom View Out",
                "from",
                this.m_pinchZoomContentManager.m_zoomFactor,
                "to",
                componentInChildren.m_minZoomFactor,
                "easeType",
                "easeOutCubic",
                "time",
                0.8f,
                "onupdate",
                "ZoomOutTweenCallback"
            }));
            iTween.MoveTo(this.m_mapViewContentsRT.get_gameObject(), iTween.Hash(new object[]
            {
                "name",
                "Pan View To Point (out)",
                "x",
                vector.x,
                "y",
                vector.y,
                "easeType",
                "easeOutQuad",
                "time",
                0.8f
            }));
        }
    }