protected void Update() { if (OnUpdateBefore != null) { OnUpdateBefore(); } BeforeUpdate(); _screenRect = GetRect(); if (allowAddMarkerByM && Input.GetKeyUp(KeyCode.M)) { CreateMarker(); } int touchCount = GetTouchCount(); if (allowTouchZoom && touchCount != lastTouchCount) { if (touchCount == 1) { OnMapBasePress(); } else if (touchCount == 0) { OnMapBaseRelease(); } } lastTouchCount = touchCount; if (isMapDrag) { UpdatePosition(); } if (allowZoom) { UpdateZoom(); UpdateGestureZoom(); } if (dragMarker != null) { DragMarker(); } else if (HitTest()) { map.ShowMarkersTooltip(GetInputPosition()); } else { map.tooltip = string.Empty; map.tooltipMarker = null; } AfterUpdate(); if (OnUpdateAfter != null) { OnUpdateAfter(); } }
// ReSharper disable once UnusedMember.Local protected void Update() { BeforeUpdate(); _screenRect = GetRect(); if (allowAddMarkerByM && Input.GetKeyUp(KeyCode.M)) { CreateMarker(); } #if UNITY_ANDROID #if !UNITY_EDITOR if (allowTouchZoom && Input.touchCount != lastTouchCount) { if (Input.touchCount == 1) { OnMapBasePress(); } else if (Input.touchCount == 0) { OnMapBaseRelease(); } } lastTouchCount = Input.touchCount; #else int touchCount = Input.GetMouseButton(0) ? 1 : 0; if (allowTouchZoom && touchCount != lastTouchCount) { if (touchCount == 1) { OnMapBasePress(); } else if (touchCount == 0) { OnMapBaseRelease(); } } lastTouchCount = touchCount; #endif #endif if (isMapDrag) { UpdatePosition(); } if (allowZoom) { UpdateZoom(); UpdateGestureZoom(); } if (dragMarker != null) { DragMarker(); } else if (HitTest()) { api.ShowMarkersTooltip(Input.mousePosition); } else { api.tooltip = string.Empty; api.tooltipMarker = null; } AfterUpdate(); }