Exemplo n.º 1
0
        public void MakeThisScreenActive(ScreenMonoBehaviour screen)
        {
            _activeScreen = screen;

            //call on start show screen
            OnStartShowScreen(_activeScreen);

            //move the active screen to camera
            LeanTween.moveLocalX(_activeScreen.gameObject, 0f, TIME_OF_TRANSITION);

            //call on active screen shown complete
            LeanTween.delayedCall(1f, (s) => OnScreenShown(_activeScreen));
        }
Exemplo n.º 2
0
        private void OnScreenShown(ScreenMonoBehaviour screen)
        {
            (screen as IScreenMonoBehaviour).OnScreenShown();

            float x = 0;

            foreach (var item in screens)
            {
                if (item != _activeScreen)
                {
                    //call on hide starts
                    OnStartHideScreen(item);

                    x += item.GetComponent <RectTransform>().rect.width + SPACE_BETWEEN_SCREENS;

                    RectTransform itemTransform = item.GetComponent <RectTransform>();
                    itemTransform.localPosition = new Vector3(x, itemTransform.localPosition.y, itemTransform.localPosition.z);

                    //call on hide ends
                    OnScreenHide(item);
                }
            }
        }
Exemplo n.º 3
0
 private void OnStartHideScreen(ScreenMonoBehaviour screen)
 {
     (screen as IScreenMonoBehaviour).OnStartHideScreen();
 }
Exemplo n.º 4
0
 private void OnScreenHide(ScreenMonoBehaviour screen)
 {
     (screen as IScreenMonoBehaviour).OnScreenHide();
 }