Пример #1
0
 void Update()
 {
     // Update the menu state if it needs to suddenly open or close
     if (!dummyParent && IsButtonClicked())
     {
         SetMenuLocation();
         if (IsMenuInFOV())
         {
             dummyParent          = (ClickMenuIcon)Instantiate(menuIconPrefab, transform);
             dummyParent.menuRoot = this;
             ClickMenuIcon.ShowMenu(this, menuTree.tree.Root, dummyParent,
                                    menuCenter, menuOrientation, iconScale);
             dummyParent.SetDummy();
             if (OnMenuOpened != null)
             {
                 OnMenuOpened.Invoke();
             }
         }
     }
     else if ((GvrControllerInput.ClickButtonDown && !selected) ||
              IsPointingAway())
     {
         CloseAll();
     }
     else if (dummyParent && GvrControllerInput.AppButtonUp)
     {
         MakeSelection(null);
         dummyParent.DeepestMenu().ShowParentMenu();
     }
 }
 public void Close()
 {
     // ISSUE: reference to a compiler-generated method
     _plusLayer.AddAnimation(PlusKeyFrame(false), "plusRot");
     _plusRotation = 0;
     _baseView.Close(CellArray());
     // ISSUE: reference to a compiler-generated method
     SetNeedsDisplay();
     //raise event close menu
     OnMenuOpened?.Invoke(this, new FloatingMenuOpenEventArgs(isOpen: false));
 }
Пример #3
0
        public void ShowMenu()
        {
            if (_isLoading && ProjectData.GameMode != GameMode.View)
            {
                Loader.StartLoaderAnimation();
                _openAfterLoad = true;

                return;
            }

            if (VRMessageManager.VRMessageManager.Instance.Showing)
            {
                return;
            }

            if (ProjectData.GameMode != GameMode.View && ProjectData.GameMode != GameMode.Preview && !OnboardingBlock)
            {
                if (_pointerOrigin == null)
                {
                    UpdatePointerOrigns();

                    if (_pointerOrigin == null)
                    {
                        return;
                    }
                }

#if UNITY_STANDALONE_WIN && !VRMAKER
                PointerUIBase.RightHand = _pointerOrigin;
#endif

                SpawnSphere.SetActive(true);
                ModeButton.SetActive(false);
                BrowserWindow.SetActive(true);
                Helper.ResetSpawnObject();
                OnMenuOpened?.Invoke();
            }
            else
            {
                SpawnSphere.SetActive(false);

                if (!OnboardingBlock)
                {
                    ModeButton.SetActive(ProjectData.GameMode != GameMode.View);
                }

                BrowserWindow.SetActive(false);
            }
        }
        public void Open()
        {
            // ISSUE: reference to a compiler-generated method
            _plusLayer.AddAnimation(PlusKeyFrame(true), "plusRot");
            _plusRotation = CoreGraphicsExtensions.Pi * 0.25f;
            var cells = CellArray();

            foreach (var cell in cells)
            {
                InsertCell(cell);
            }
            _baseView.Open(cells);
            // ISSUE: reference to a compiler-generated method
            SetNeedsDisplay();
            //raise event open menu
            OnMenuOpened?.Invoke(this, new FloatingMenuOpenEventArgs(isOpen: true));
        }
        void Update()
        {
            // Shorten laser when menus are open
            if (dummyParent)
            {
                float newDist = laserPointer.maxReticleDistance - reticleDelta;
                laserPointer.maxReticleDistance = Mathf.Max(newDist, menuDistance * POINTER_DISTANCE_SCALE);
            }

            // Update the menu state if it needs to suddenly open or close
            if (!dummyParent && IsButtonClicked())
            {
                SetMenuLocation();
                if (IsMenuInFOV())
                {
                    reticleDistance      = laserPointer.maxReticleDistance;
                    dummyParent          = (ClickMenuIcon)Instantiate(menuIconPrefab, transform);
                    dummyParent.menuRoot = this;
                    ClickMenuIcon.OpenMenu(this, menuTree.tree.Root, dummyParent,
                                           menuCenter, menuOrientation, 0.1f);
                    dummyParent.SetDummy();
                    if (OnMenuOpened != null)
                    {
                        OnMenuOpened.Invoke();
                    }
                }
            }
            else if ((GvrController.ClickButtonDown && !selected) ||
                     IsPointingAway())
            {
                CloseAll();
            }
            else if (dummyParent && GvrController.AppButtonUp)
            {
                MakeSelection(-1);
                dummyParent.DeepestMenu().CloseSubMenu();
            }
        }
Пример #6
0
 internal static void InvokeMenuOpened(ExpandedMenu menu) => OnMenuOpened?.Invoke(menu);
Пример #7
0
 private async Task OnMenuOpenedAsync()
 {
     await OnMenuOpened.InvokeAsync(this);
 }
Пример #8
0
 /// <summary>
 /// Triggers the OnMenuOpened event. Should only be used by overrides of <see cref="OpenMenuRoutine"/>
 /// </summary>
 protected void InvokeOnMenuOpened()
 {
     OnMenuOpened?.Invoke();
 }
Пример #9
0
 private void StartMenuMusic(OnMenuOpened data)
 {
     musicSpeaker.clip = menuMusic;
     musicSpeaker.Play();
 }