private void Update()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences())
                {
                    menuManager = AdvGame.GetReferences().menuManager;

                    if (menuManager)
                    {
                        if (menuManager.GetSelectedMenu() != null)
                        {
                            AC.Menu menu = menuManager.GetSelectedMenu();

                            foreach (MenuElement element in menu.visibleElements)
                            {
                                for (int i = 0; i < element.GetNumSlots(); i++)
                                {
                                    if (menuManager.GetSelectedElement() == element && element.isClickable && i == 0)
                                    {
                                        element.PreDisplay(i, 0, false);
                                    }

                                    else
                                    {
                                        element.PreDisplay(i, 0, false);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void OnGUI()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences())
                {
                    menuManager = AdvGame.GetReferences().menuManager;

                    if (menuManager && menuManager.drawInEditor)
                    {
                                                #if CAN_USE_TIMELINE
                        if (previewSpeechMenu != null)
                        {
                            DrawPreviewMenu(previewSpeechMenu);
                        }
                                                #endif
                        if (menuManager.GetSelectedMenu() != null && AdvGame.GetReferences().viewingMenuManager)
                        {
                            Menu menu = menuManager.GetSelectedMenu();
                            DrawPreviewMenu(menu);
                        }
                    }
                }
            }
        }
Beispiel #3
0
        private void Update()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences())
                {
                    menuManager = AdvGame.GetReferences().menuManager;

                    if (menuManager)
                    {
                                                #if CAN_USE_TIMELINE
                        if (previewSpeechMenu != null)
                        {
                            UpdatePreviewMenu(previewSpeechMenu, true);
                        }
                                                #endif
                        if (menuManager.GetSelectedMenu() != null)
                        {
                            Menu menu = menuManager.GetSelectedMenu();
                            UpdatePreviewMenu(menu);
                        }
                    }
                }
            }
        }
Beispiel #4
0
        private void OnGUI()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences())
                {
                    menuManager = AdvGame.GetReferences().menuManager;

                    if (menuManager && menuManager.drawInEditor && KickStarter.mainCamera != null)
                    {
                        if (previewSpeechMenu != null)
                        {
                            DrawPreviewMenu(previewSpeechMenu);
                        }

                        if (menuManager.GetSelectedMenu() != null && AdvGame.GetReferences().viewingMenuManager)
                        {
                            Menu menu = menuManager.GetSelectedMenu();
                            DrawPreviewMenu(menu);
                        }
                    }
                }
            }
        }
        private void OnGUI()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences())
                {
                    menuManager = AdvGame.GetReferences().menuManager;

                    if (menuManager && menuManager.drawInEditor && AdvGame.GetReferences().viewingMenuManager)
                    {
                        if (menuManager.GetSelectedMenu() != null)
                        {
                            AC.Menu menu = menuManager.GetSelectedMenu();

                            if (menu.IsUnityUI())
                            {
                                return;
                            }

                            CheckScreenSize(menu);

                            if ((menu.appearType == AppearType.Manual || menu.appearType == AppearType.OnInputKey) && menu.pauseWhenEnabled && menuManager.pauseTexture)
                            {
                                GUI.DrawTexture(AdvGame.GUIRect(0.5f, 0.5f, 1f, 1f), menuManager.pauseTexture, ScaleMode.ScaleToFit, true, 0f);
                            }

                            if ((menu.positionType == AC_PositionType.FollowCursor || menu.positionType == AC_PositionType.AppearAtCursorAndFreeze || menu.positionType == AC_PositionType.OnHotspot || menu.positionType == AC_PositionType.AboveSpeakingCharacter || menu.positionType == AC_PositionType.AbovePlayer) && AdvGame.GetReferences().cursorManager&& AdvGame.GetReferences().cursorManager.pointerIcon.texture)
                            {
                                CursorIconBase icon = AdvGame.GetReferences().cursorManager.pointerIcon;
                                GUI.DrawTexture(AdvGame.GUIBox(new Vector2(AdvGame.GetMainGameViewSize().x / 2f, AdvGame.GetMainGameViewSize().y / 2f), icon.size), icon.texture, ScaleMode.ScaleToFit, true, 0f);
                            }

                            menu.StartDisplay();

                            foreach (MenuElement element in menu.visibleElements)
                            {
                                SetStyles(element);

                                for (int i = 0; i < element.GetNumSlots(); i++)
                                {
                                    if (menuManager.GetSelectedElement() == element && element.isClickable && i == 0)
                                    {
                                        //	element.PreDisplay (i, true, 0);
                                        element.Display(highlightedStyle, i, 1f, true);
                                    }

                                    else
                                    {
                                        //	element.PreDisplay (i, true, 0);
                                        element.Display(normalStyle, i, 1f, false);
                                    }
                                }

                                if (UnityEditor.EditorWindow.mouseOverWindow != null && UnityEditor.EditorWindow.mouseOverWindow.ToString().Contains("(UnityEditor.GameView)"))
                                {
                                    if (menu.IsPointerOverSlot(element, 0, Event.current.mousePosition + new Vector2(menu.GetRect().x, menu.GetRect().y)))
                                    {
                                        menuManager.SelectElementFromPreview(menu, element);
                                    }
                                }
                            }

                            menu.EndDisplay();

                            if (menuManager.drawOutlines)
                            {
                                menu.DrawOutline(menuManager.GetSelectedElement());
                            }
                        }
                    }
                }
            }
        }
Beispiel #6
0
        private void OnGUI()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences ())
                {
                    menuManager = AdvGame.GetReferences ().menuManager;

                    if (menuManager && menuManager.drawInEditor && AdvGame.GetReferences ().viewingMenuManager)
                    {
                        if (menuManager.GetSelectedMenu () != null)
                        {
                            AC.Menu menu = menuManager.GetSelectedMenu ();

                            if (menu.IsUnityUI ())
                            {
                                return;
                            }

                            CheckScreenSize (menu);

                            if ((menu.appearType == AppearType.Manual || menu.appearType == AppearType.OnInputKey) && menu.pauseWhenEnabled && menuManager.pauseTexture)
                            {
                                GUI.DrawTexture (AdvGame.GUIRect (0.5f, 0.5f, 1f, 1f), menuManager.pauseTexture, ScaleMode.ScaleToFit, true, 0f);
                            }

                            if ((menu.positionType == AC_PositionType.FollowCursor || menu.positionType == AC_PositionType.AppearAtCursorAndFreeze || menu.positionType == AC_PositionType.OnHotspot || menu.positionType == AC_PositionType.AboveSpeakingCharacter || menu.positionType == AC_PositionType.AbovePlayer) && AdvGame.GetReferences ().cursorManager && AdvGame.GetReferences ().cursorManager.pointerIcon.texture)
                            {
                                CursorIconBase icon = AdvGame.GetReferences ().cursorManager.pointerIcon;
                                GUI.DrawTexture (AdvGame.GUIBox (new Vector2 (AdvGame.GetMainGameViewSize ().x / 2f, AdvGame.GetMainGameViewSize ().y / 2f), icon.size), icon.texture, ScaleMode.ScaleToFit, true, 0f);
                            }

                            menu.StartDisplay ();

                            foreach (MenuElement element in menu.visibleElements)
                            {
                                SetStyles (element);

                                for (int i=0; i<element.GetNumSlots (); i++)
                                {
                                    if (menuManager.GetSelectedElement () == element && element.isClickable && i == 0)
                                    {
                                    //	element.PreDisplay (i, true, 0);
                                        element.Display (highlightedStyle, i, 1f, true);
                                    }

                                    else
                                    {
                                    //	element.PreDisplay (i, true, 0);
                                        element.Display (normalStyle, i, 1f, false);
                                    }
                                }

                                if (menu.IsPointerOverSlot (element, 0, Event.current.mousePosition + new Vector2 (menu.GetRect ().x, menu.GetRect ().y)))
                                {
                                    menuManager.SelectElementFromPreview (menu, element);
                                }
                            }

                            menu.EndDisplay ();

                            if (menuManager.drawOutlines)
                            {
                                menu.DrawOutline (menuManager.GetSelectedElement ());
                            }
                        }
                    }
                }
            }
        }
Beispiel #7
0
        private void Update()
        {
            if (!Application.isPlaying)
            {
                if (AdvGame.GetReferences ())
                {
                    menuManager = AdvGame.GetReferences ().menuManager;

                    if (menuManager)
                    {
                        if (menuManager.GetSelectedMenu () != null)
                        {
                            AC.Menu menu = menuManager.GetSelectedMenu ();

                            foreach (MenuElement element in menu.visibleElements)
                            {
                                for (int i=0; i<element.GetNumSlots (); i++)
                                {
                                    if (menuManager.GetSelectedElement () == element && element.isClickable && i == 0)
                                    {
                                        element.PreDisplay (i, 0, false);
                                    }

                                    else
                                    {
                                        element.PreDisplay (i, 0, false);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }