コード例 #1
0
        public void Set(int index)
        {
            screens[index].transform.SetAsLastSibling();

            screens[index].Show(currentScreen);
            lastScreen = currentScreen;
            currentScreen = screens[index];
        }
コード例 #2
0
ファイル: ScreenManager.cs プロジェクト: BJBP/Jgames
        public void Set(int index)
        {
            screens[index].transform.SetAsLastSibling();

            screens[index].Show(currentScreen);
            lastScreen    = currentScreen;
            currentScreen = screens[index];
        }
コード例 #3
0
 public void Back()
 {
     lastScreen.ShowWithoutTransition();
     currentScreen.Hide();
     ScreenConfig temp = currentScreen;
     currentScreen = lastScreen;
     lastScreen = temp;
 }
コード例 #4
0
        public void Back()
        {
            lastScreen.ShowWithoutTransition();
            currentScreen.Hide();
            ScreenConfig temp = currentScreen;

            currentScreen = lastScreen;
            lastScreen    = temp;
        }
コード例 #5
0
 /// <summary>
 /// Set active screen
 /// </summary>
 /// <param name="screen"></param>
 private void SetScreen(ScreenConfig screen)
 {
     if (screen == null)
     {
         return;
     }
     screen.transform.SetAsLastSibling();
     screen.Show(currentScreen);
     SetCurrentScreen(screen);
 }
コード例 #6
0
 public void Set(ScreenConfig screen)
 {
     for (int i = 0; i < screens.Length; i++)
     {
         if (screens[i] == screen)
         {
             Set(i);
             return;
         }
     }
 }
コード例 #7
0
        public void Set(int index)
        {
            // Prevent transitions on screens that are already in the process of transitioning in or out.
            if (currentScreen && currentScreen.CurrentState != ScreenConfig.AnimationState.Stationary)
            {
                return;
            }

            screens[index].transform.SetAsLastSibling();

            screens[index].Show(currentScreen);
            lastScreen    = currentScreen;
            currentScreen = screens[index];
        }
コード例 #8
0
		public void Set(int index)
		{
			// Prevent transitions on screens that are already in the process of transitioning in or out.
			if (currentScreen && currentScreen.CurrentState != ScreenConfig.AnimationState.Stationary)
			{
				return;
			}

			screens[index].transform.SetAsLastSibling();

			screens[index].Show(currentScreen);
			lastScreen = currentScreen;
			currentScreen = screens[index];
		}
コード例 #9
0
        public void Set(int index)
        {
            if (index == 7)
            {
                graphrenderer.SetActive(true);
            }
            else if (index == 17)
            {
                graphrenderer.SetActive(true);
            }
            else
            {
                graphrenderer.SetActive(false);
                audioSource.Stop();
                //avatar.transform.position = Vector3.one * 1000;
            }
            if (index == 2 || index == 3)
            {
                avatrCam.SetActive(true);
            }
            else
            {
                avatrCam.SetActive(false);
            }
            //if(index==3&&!Choice)
            //{
            //    patientJournalScreen._TrackerType = TrackerManager.TrackerType.CSU;
            //    Choice = true;
            //}
            //else if(index==2 && !Choice)
            //{
            //    patientJournalScreen._TrackerType = TrackerManager.TrackerType.Symptom;
            //    Choice = true;
            //}
            //else if(index==6)
            //{
            //    patientJournalScreen._TrackerType = TrackerManager.TrackerType.Symptom;
            //}
            //else if(index==5)
            //{
            //    patientJournalScreen._TrackerType = TrackerManager.TrackerType.Asthma;
            //}
            screens[index].transform.SetAsLastSibling();
            screens[index].Show(currentScreen);

            lastScreen    = currentScreen;
            currentScreen = screens[index];
        }
コード例 #10
0
        public void Back()
        {
            int index = Array.IndexOf(screens, lastScreen);

            Set(index);

            // TODO - this doesn't work
            return;

            lastScreen.ShowWithoutTransition();
            currentScreen.Hide();
            ScreenConfig temp = currentScreen;

            currentScreen = lastScreen;
            lastScreen    = temp;
        }
コード例 #11
0
 /// <summary>
 /// Set current screen variable
 /// </summary>
 /// <param name="screen"></param>
 private void SetCurrentScreen(ScreenConfig screen)
 {
     if (currentScreen != null && currentScreen.associatedMenu != null)
     {
         currentScreen.associatedMenu.UnsetActive();
     }
     currentScreen = screen;
     if (currentScreen == homeScreen)
     {
         ClearLastScreens();
     }
     if (currentScreen.associatedMenu != null)
     {
         currentScreen.associatedMenu.SetActive();
     }
 }
コード例 #12
0
 private void SetLastScreen(ScreenConfig screen)
 {
     lastScreens.Push(screen);
 }
コード例 #13
0
        public void Update()
        {
            animDeltaTime = Time.realtimeSinceStartup - animStartTime;

            if (state == AnimationState.TransitioningIn)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2             = currentRipple.sizeDelta;
                        tempVector2.x           = Anim.Quint.In(0f, rippleSize, animDeltaTime, animationDuration);
                        tempVector2.y           = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            tempVector2   = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(slideInDirectionPosition.x, 0f, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(slideInDirectionPosition.y, 0f, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleIn)
                        {
                            tempVector3   = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(fadeInStartValue, 1f, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        theRectTransform.SetParent(transform);
                        theRectTransform.position = screenSpacePosition;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            theRectTransform.anchoredPosition = new Vector2(0f, 0f);
                        }

                        if (scaleIn)
                        {
                            theRectTransform.localScale = new Vector3(1f, 1f, 1f);
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = 1f;
                        }
                    }

                    if (hideScreen && hideScreen != this)
                    {
                        hideScreen.HideWithoutTransition();
                        hideScreen = null;
                    }

                    state = AnimationState.Stationary;
                    if (TransitionInComplete != null)
                    {
                        TransitionInComplete(this, new EventArgs());
                    }
                }
            }
            else if (state == AnimationState.TransitioningOut)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2             = currentRipple.sizeDelta;
                        tempVector2.x           = Anim.Quint.In(rippleSize, 0f, animDeltaTime, animationDuration);
                        tempVector2.y           = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideOut != SlideDirection.None)
                        {
                            tempVector2   = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(0f, slideOutDirectionPosition.x, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(0f, slideOutDirectionPosition.y, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleOut)
                        {
                            tempVector3   = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeOut)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(1f, fadeOutEndValue, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    currentRipple.gameObject.SetActive(false);
                    theRectTransform.SetParent(transform);
                    theRectTransform.position = screenSpacePosition;
                    screenSpace.SetActive(false);
                    state = AnimationState.Stationary;
                }
            }
        }
コード例 #14
0
        void Update()
        {
            animDeltaTime = Time.realtimeSinceStartup - animStartTime;

            if (state == 1)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2 = currentRipple.sizeDelta;
                        tempVector2.x = Anim.Quint.In(0f, rippleSize, animDeltaTime, animationDuration);
                        tempVector2.y = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            tempVector2 = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(slideInDirectionPosition.x, 0f, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(slideInDirectionPosition.y, 0f, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleIn)
                        {
                            tempVector3 = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(fadeInStartValue, 1f, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        theRectTransform.SetParent(transform);
                        theRectTransform.position = screenSpacePosition;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            theRectTransform.anchoredPosition = new Vector2(0f, 0f);
                        }

                        if (scaleIn)
                        {
                            theRectTransform.localScale = new Vector3(1f, 1f, 1f);
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = 1f;
                        }
                    }

                    if (hideScreen && hideScreen != this)
                    {
                        hideScreen.HideWithoutTransition();
                        hideScreen = null;
                    }

                    state = 0;
                }
            }
            else if (state == 2)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2 = currentRipple.sizeDelta;
                        tempVector2.x = Anim.Quint.In(rippleSize, 0f, animDeltaTime, animationDuration);
                        tempVector2.y = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;

                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, thisScreenSize.x);
                        theRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thisScreenSize.y);
                    }
                    else
                    {
                        if (slideOut != SlideDirection.None)
                        {
                            tempVector2 = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(0f, slideOutDirectionPosition.x, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(0f, slideOutDirectionPosition.y, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleOut)
                        {
                            tempVector3 = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeOut)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(1f, fadeOutEndValue, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    theRectTransform.SetParent(transform);
                    theRectTransform.position = screenSpacePosition;
                    screenSpace.SetActive(false);
                    state = 0;
                }
            }
        }
コード例 #15
0
 public void Show(ScreenConfig screenToHide)
 {
     hideScreen = screenToHide;
     Show();
 }
コード例 #16
0
 void OnEnable()
 {
     screenConfig = (ScreenConfig)target;
 }
コード例 #17
0
ファイル: ScreenConfig.cs プロジェクト: hafewa/MaterialUI
 public void Show(ScreenConfig screenToHide)
 {
     hideScreen = screenToHide;
     Show();
 }
コード例 #18
0
ファイル: ScreenConfig.cs プロジェクト: hafewa/MaterialUI
        void Update()
        {
            animDeltaTime = Time.realtimeSinceStartup - animStartTime;

            if (state == 1)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2             = currentRipple.sizeDelta;
                        tempVector2.x           = Anim.Quint.In(0f, rippleSize, animDeltaTime, animationDuration);
                        tempVector2.y           = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            tempVector2   = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(slideInDirectionPosition.x, 0f, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(slideInDirectionPosition.y, 0f, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleIn)
                        {
                            tempVector3   = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(scaleInStartValue, 1f, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(fadeInStartValue, 1f, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        theRectTransform.SetParent(transform);
                        theRectTransform.position = screenSpacePosition;
                    }
                    else
                    {
                        if (slideIn != SlideDirection.None)
                        {
                            theRectTransform.anchoredPosition = new Vector2(0f, 0f);
                        }

                        if (scaleIn)
                        {
                            theRectTransform.localScale = new Vector3(1f, 1f, 1f);
                        }

                        if (fadeIn)
                        {
                            theCanvasGroup.alpha = 1f;
                        }
                    }

                    if (hideScreen && hideScreen != this)
                    {
                        hideScreen.HideWithoutTransition();
                        hideScreen = null;
                    }

                    state = 0;
                }
            }
            else if (state == 2)
            {
                if (animDeltaTime <= animationDuration)
                {
                    if (transitionInType == TransitionType.RippleMask)
                    {
                        tempVector2             = currentRipple.sizeDelta;
                        tempVector2.x           = Anim.Quint.In(rippleSize, 0f, animDeltaTime, animationDuration);
                        tempVector2.y           = tempVector2.x;
                        currentRipple.sizeDelta = tempVector2;
                    }
                    else
                    {
                        if (slideOut != SlideDirection.None)
                        {
                            tempVector2   = theRectTransform.anchoredPosition;
                            tempVector2.x = Anim.Quint.Out(0f, slideOutDirectionPosition.x, animDeltaTime, animationDuration);
                            tempVector2.y = Anim.Quint.Out(0f, slideOutDirectionPosition.y, animDeltaTime, animationDuration);
                            theRectTransform.anchoredPosition = tempVector2;
                        }

                        if (scaleOut)
                        {
                            tempVector3   = theRectTransform.localScale;
                            tempVector3.x = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            tempVector3.y = Anim.Quint.Out(1f, scaleOutEndValue, animDeltaTime, animationDuration);
                            theRectTransform.localScale = tempVector3;
                        }

                        if (fadeOut)
                        {
                            theCanvasGroup.alpha = Anim.Quint.Out(1f, fadeOutEndValue, animDeltaTime, animationDuration);
                        }
                    }
                }
                else
                {
                    theRectTransform.SetParent(transform);
                    theRectTransform.position = screenSpacePosition;
                    screenSpace.SetActive(false);
                    state = 0;
                }
            }
        }
コード例 #19
0
 void Start()
 {
     lastScreen = screens [0];
     currentScreen = screens [0];
 }
コード例 #20
0
 public void Show(ScreenConfig screenToHide)
 {
     previousScreen = screenToHide;
     Show();
 }