Resolution for #80 issue where onPageChanged is fired multiple times for Next/Previous.

--HG--
branch : develop_5.3
pull/413/head
Simon Jackson 2017-01-04 12:32:44 +00:00
parent cd3f79ef7c
commit 38d98a0fad
1 changed files with 3 additions and 1 deletions

View File

@ -83,7 +83,7 @@ namespace UnityEngine.UI.Extensions
_previousPage = _currentPage; _previousPage = _currentPage;
_currentPage = value; _currentPage = value;
if(MaskArea) UpdateVisible(); if(MaskArea) UpdateVisible();
ScreenChange(); if(!_lerp) ScreenChange();
ChangeBulletsInfo(_currentPage); ChangeBulletsInfo(_currentPage);
} }
} }
@ -240,6 +240,7 @@ namespace UnityEngine.UI.Extensions
_lerp = true; _lerp = true;
CurrentPage = _currentPage + 1; CurrentPage = _currentPage + 1;
GetPositionforPage(_currentPage, ref _lerp_target); GetPositionforPage(_currentPage, ref _lerp_target);
ScreenChange();
} }
} }
@ -253,6 +254,7 @@ namespace UnityEngine.UI.Extensions
_lerp = true; _lerp = true;
CurrentPage = _currentPage - 1; CurrentPage = _currentPage - 1;
GetPositionforPage(_currentPage, ref _lerp_target); GetPositionforPage(_currentPage, ref _lerp_target);
ScreenChange();
} }
} }