private IEnumerator TransitionRoutine(NavigationLocations location)
        {
            mIsTransitioning = true;

            // Change current NavigationButton's image and text from Selected color to Unselected color
            mButtonDictionary[mCurrentLocation].SetState(false, 10f);

            // Move background and "frame" from current location to target location
            mCurrentLocation = location;
            Vector3 from = mSelectionFrame.anchoredPosition;
            Vector3 to   = mButtonDictionary[mCurrentLocation].MyTransform.anchoredPosition;

            float timer = 0;
            float speed = 1f / mTransitionTime;

            while (timer < 1f)
            {
                timer += Time.deltaTime * speed;
                mSelectionFrame.anchoredPosition = Vector3.Lerp(from, to, Mathfx.Hermite(0, 1f, timer));
                yield return(null);
            }

            mSelectionFrame.anchoredPosition = to;

            // Change new NavigationButton's image and text from Unselected to Selected
            yield return(mButtonDictionary[mCurrentLocation].SetState(true, 10f));

            mIsTransitioning = false;
        }
        public void ButtonNavigate(NavigationLocations location)
        {
            if (mIsTransitioning || location == mCurrentLocation)
            {
                return;
            }

            switch (location)
            {
            case NavigationLocations.Plant:         UIManager.Open(UILocation.Progress); break;

            case NavigationLocations.Assignment:    UIManager.Open(UILocation.Assignment); break;

            case NavigationLocations.Chat:          UIManager.Open(UILocation.Chat); break;

            case NavigationLocations.Check:         UIManager.Open(UILocation.MonthlyCheck); break;

            case NavigationLocations.Info:          UIManager.Open(UILocation.Info); break;

            case NavigationLocations.Options:       UIManager.Open(UILocation.Settings); break;

            default: Debug.LogWarning("Missing handling for NavigationLocation: " + location); break;
            }

            StartCoroutine(TransitionRoutine(location));
        }
        private void ResetNavigationState()
        {
            mCurrentLocation                 = NavigationLocations.Plant;
            mSelectionFrame.sizeDelta        = mButtons[0].MyTransform.sizeDelta;
            mSelectionFrame.anchoredPosition = mButtonDictionary[mCurrentLocation].MyTransform.anchoredPosition;

            for (int i = 0; i < mButtons.Length; i++)
            {
                mButtons[i].SetState(false, -1);
            }

            mButtonDictionary[mCurrentLocation].SetState(true, -1);
        }