private void ToggleZoomedState(CarouselSlotBehavior carouselSlotBehavior)
        {
            if (isInContentTransition)
            {
                return;
            }

            if (eventAudioManager != null)
            {
                eventAudioManager.PlayAudio();
            }

            var isZoomed = carouselSlotBehavior.IsZoomed;

            if (Souvenir.IsInActiveState)
            {
                UpdateGrid();
            }
            else
            {
                Souvenir.ToggleActiveState();
            }

            if (!isZoomed)
            {
                var yOffset            = GetGameObjectHeight(Souvenir.gameObject);
                var zoomedCoordsObject = TagsHelper.FindChildWithTag(photoArrangement, TagsHelper.ZoomedPictureCoords);
                var position           = transform.InverseTransformPoint(zoomedCoordsObject.transform.position)
                                         - transform.InverseTransformVector(new Vector3(0, yOffset, 0));

                carouselSlotBehavior.EnableZoomedMode(position);
            }
        }
示例#2
0
        /// <summary>
        /// Performs initialization related to the HoloBar.
        /// </summary>
        private void InitHoloBar()
        {
            holoBar = gameObject.GetComponentInChildren <SouvenirHoloBar>(true);
            if (holoBar != null)
            {
                holoBar.RemoveClicked        += StartRemoving;
                holoBar.RemoveCancelClicked  += CancelRemoving;
                holoBar.RemoveConfirmClicked += CommitRemoving;

                // Bind the adjustment view to the HoloBar events.
                BindAdjustmentBoxView();

                // Bind the adjustment functionality component to the HoloBar events.
                // The audio manager global listener is turned on or off when we need to
                // stop playing the default air tap (i.e. when we are adjusting).
                if (adjustableComponent != null)
                {
                    holoBar.AdjustClicked += () =>
                    {
                        adjustableComponent.StartAdjusting();
                        eventAudioManager.TurnOffGlobalListener();
                    };
                    holoBar.AdjustCancelClicked += () =>
                    {
                        adjustableComponent.CancelChanges();
                        eventAudioManager.TurnOnGlobalListener();
                        eventAudioManager.PlayAudio();
                    };
                    holoBar.AdjustConfirmClicked += () =>
                    {
                        adjustableComponent.ConfirmChanges();
                        eventAudioManager.TurnOnGlobalListener();
                        eventAudioManager.PlayAudio();
                    };

                    adjustableComponent.AdjustingStarted += DisableActiveState;
                }
            }
            else
            {
                Debug.LogError("Souvenir.cs expects an HSHoloBar component in its children.");
            }
        }
        public void OnInputClicked(InputClickedEventData eventData)
        {
            if (!isEnabled)
            {
                return;
            }

            if (eventAudioManager != null)
            {
                eventAudioManager.PlayAudio();
            }

            Clicked.RaiseEvent();
        }
示例#4
0
        /// <summary>
        /// Invoked when the placing of the magnet object has stopped.
        /// </summary>
        private void OnStoppedPlacingMagnet()
        {
            Invoke("EnableHoloBar", Constants.ConfirmationHoloBarEnableDelay);

            SetAirTapTextActive(false);
            SetPlaceMenuPinTooltipActive(true);

            if (eventAudioManager != null)
            {
                eventAudioManager.PlayAudio(EventAudioManager.TriggerType.SouvenirPlacement);
            }

            /// When the user taps to place the menu pin down and display
            /// the onboarding plane, it is shown too fast and the onboarding
            /// plane also captures the click event. The OnInputClick event is
            /// triggered which instantly opens the flat app so the user
            /// cannot read the onboarding instructions. We delay opening
            /// the onboarding plane to avoid it capturing the first tap event.
            Invoke("OnPlacingStoppedShowOnboarding", Constants.PlacingStoppedShowOnboardingDelay);
        }