示例#1
0
        private void UpdateScreen(ReturnSetupStep step, bool shouldAnimate = true)
        {
            // validating that is not the current step number
            if (step == currentStep || step < ReturnSetupStep.Reminders || step > ReturnSetupStep.AlignPhone)
            {
                return;
            }

            // setting the current step of setup
            currentStep = step;

            // updating the farthest step flag
            if (currentStep > farthestStep)
            {
                farthestStep = currentStep;

                // enabling interactable
                MenuToggleGroup.SetToggleInteractable((int)farthestStep, true);

                // if there's a step after the current step, make its toggle interactable
                if ((currentStep + 1) <= ReturnSetupStep.AlignPhone)
                {
                    MenuToggleGroup.SetToggleInteractable((int)(currentStep + 1), true);
                }
            }

            // Show and hide UI elements
            ShowAndHideScreenElement(LeftButtons, "CornerButtons_Outro");
            ShowAndHideScreenElement(RightButtons, "CornerButtons_Outro");

            // setting toggle by passing the current step
            MenuToggleGroup.SetToggleByIndex((int)currentStep);

            // animating to the screen
            AnimateToScreen(shouldAnimate);
        }
示例#2
0
        protected void OnToggleChangeHandler(object sender, ToggleEventArgs eventArgs)
        {
            ReturnSetupStep step = (ReturnSetupStep)eventArgs.SelectedToggle.transform.GetSiblingIndex();

            UpdateScreen(step);
        }