Exemplo n.º 1
0
 private void Start()
 {
     if (menuNavigator)
     {
         menueNavigationScript = menuNavigator.GetComponent <MenuNavigation>();
     }
 }
Exemplo n.º 2
0
 private void Uninitialize()
 {
     if (m_GameplayActionsCallbackInterface != null)
     {
         gameplay.SetCallbacks(null);
     }
     m_gameplay          = null;
     m_gameplay_Movement = null;
     m_gameplay_Weapon1  = null;
     m_gameplay_Weapon2  = null;
     m_gameplay_Jump     = null;
     m_gameplay_Dodge    = null;
     m_gameplay_Pause    = null;
     if (m_MenuNavigationActionsCallbackInterface != null)
     {
         MenuNavigation.SetCallbacks(null);
     }
     m_MenuNavigation                   = null;
     m_MenuNavigation_PointAction       = null;
     m_MenuNavigation_MoveAction        = null;
     m_MenuNavigation_SubmitAction      = null;
     m_MenuNavigation_CancelAction      = null;
     m_MenuNavigation_LeftClickAction   = null;
     m_MenuNavigation_MiddleClickAction = null;
     m_MenuNavigation_RightClickAction  = null;
     m_MenuNavigation_ScrollWheelAction = null;
     m_Initialized = false;
 }
 public override void Detach()
 {
     if (_navigation)
     {
         _navigation.OnWindowChanged -= WindowChanged;
         _navigation = null;
     }
 }
Exemplo n.º 4
0
        // GET: Admin/MenuNavigations/Delete/5
        public ActionResult Delete(int?id)
        {
            MenuNavigation nav = db.MenuNavigations.Find(id);

            db.MenuNavigations.Remove(nav);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 5
0
 private void LogOn()
 {
     driver.Navigate().GoToUrl(baseUrl);
     driver.FindElement(By.Id("txtUser")).SendKeys("guest");
     driver.FindElement(By.Id("txtPsw")).SendKeys("guest");
     driver.FindElement(By.Id("cmdLogin")).Click();
     Assert.AreEqual(loginUrl, driver.Url, "Не удалось пройти авторизацию");
     MenuNavigation.get(driver).FullExtentButton().GotoCoordsButton().IdentificationButton().MagnifyButton().MoveButton().RuleButton().SelectionButton().ZoomArea();
 }
Exemplo n.º 6
0
    /// <summary>
    /// 外部调用显示
    /// </summary>
    public static void ShowUnOpenError(int menuId)
    {
        MenuNavigation navdata = ConfigDataBase.MenuNavigationConfig.Get(menuId);

        if (AssertHelper.Check(navdata != null, "没有找到跳转数据,没有找到跳转数据 Id=" + menuId))
        {
            ShowUnlockCondition(navdata.MenuUnlockType, navdata.MenuUnlockPara);
        }
    }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            // Default difficulty is Easy, if the user wants, they can change it to Hard later
            string difficulty = "Easy";
            int    turns      = 10;
            int    option     = 0;

            History.Initialize();
            History.LogEvent("Player entered the game");

            while (option != 5)
            {
                option = MenuNavigation.DisplayMenu(difficulty);

                switch (option)
                {
                case 1:
                    History.LogEvent("Player started a new game.");
                    Game.PlayGame(difficulty, ref turns);
                    break;

                case 2:
                    MenuNavigation.ShowInstructions();
                    break;

                case 3:
                    difficulty = MenuNavigation.SetDifficulty();
                    if (difficulty == "Hard")
                    {
                        turns = 5;
                    }
                    else if (difficulty == "Easy")
                    {
                        turns = 10;
                    }

                    // player runs out of attempts to select difficulty
                    else
                    {
                        option = 5;
                    }
                    break;

                case 4:
                    History.ReadLog();
                    break;

                case 5:
                    Console.WriteLine("Exit");
                    History.LogEvent("Player exited the game.");
                    break;
                }
            }
        }
Exemplo n.º 8
0
    /// <summary>
    /// Init class method.
    /// </summary>
    private void Init()
    {
        // get audio component reference.
        _audio = GetComponent <AudioComponent>();

        // get button component reference.
        _button = GetComponent <Button>();

        // get menu navigation component reference.
        _menuNavigation = GetComponentInParent <MenuNavigation>();
    }
Exemplo n.º 9
0
        public void Update(GameTime gameTime, MenuNavigation navigation)
        {
            if (navigation == MenuNavigation.Next)
            {
                GotoNextMenuItem();
            }

            if (navigation == MenuNavigation.Previous)
            {
                GotoPreviousMenuItem();
            }
        }
Exemplo n.º 10
0
        public void StartNavigation(string destinationName)
        {
            List <PathDataDijkstra> bestPath = GetBestPathData(destinationName);
            //List<PathDataDijkstra> bestPath = graph.Dijkstra("Aulas 3", destinationName);

            //Mostrar el menu de direciones
            MenuNavigation menuNavigation = new MenuNavigation("MenuNavigation", bestPath);

            MenuManager.GetInstance().AddMenu(menuNavigation);

            State.ChangeState(eState.MenuNavigation);
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            _movies = new List <IMovie>();
            _movies = GetMoviesFromTextFile.GetMovies();

            _inputValidation = new InputValidation();
            _searchForMovies = new SearchForMovies();
            _menuFormatting  = new MenuFormatting();
            _relevantMenus   = new RelevantMenus();

            var menuNavigation = new MenuNavigation(_inputValidation, _menuFormatting, _movies, _relevantMenus);
        }
Exemplo n.º 12
0
    public static bool IsUnlockPanel(int navId, bool showTip = false)
    {
        MenuNavigation nav = ConfigDataBase.MenuNavigationConfig.Get(navId);

        if (AssertHelper.Check(nav != null, "没有找到跳转数据, 没有找到跳转数据 Id=" + navId))
        {
            return(IsUnlockPanel(nav, showTip));
        }
        else
        {
            return(false);
        }
    }
    void Awake()
    {
        if (singleton == null)
        {
            singleton = this;
        }
        else if (singleton != this)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 14
0
        // GET: Admin/MenuNavigations/Delete/5
        public ActionResult Delete(int?id)
        {
            MenuNavigation nav = db.MenuNavigations.Find(id);

            if (nav.IconMenu != "")
            {
                var filename = Path.GetFileName(nav.IconMenu);
                System.IO.File.Delete(Request.PhysicalApplicationPath + "/Upload/Images/" + filename);
            }

            db.MenuNavigations.Remove(nav);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 15
0
    void Start()
    {
        Physics.gravity = new Vector3(0, -7f, 0);
        gameObject.GetComponent <ControllerManager>().Init();
        roundsToWin         = GameData.GetNumberOfRounds();
        canvas              = GameObject.FindGameObjectWithTag("Canvas").GetComponent <Canvas>();
        fighterOneUiObject  = canvas.transform.GetChild(0).gameObject;
        fighterTwoUiObject  = canvas.transform.GetChild(1).gameObject;
        gameUiObject        = canvas.transform.GetChild(2).gameObject;
        fighterSpeechText   = canvas.transform.GetChild(3).gameObject.GetComponent <Text>();
        rematchMenuUiObject = canvas.transform.GetChild(4).gameObject;
        pauseMenuObject     = canvas.transform.GetChild(5).gameObject;
        playerOnePaused     = false;
        fighterOneName.text = "" + GameData.GetFighterOneCharacter();
        fighterTwoName.text = "" + GameData.GetFighterTwoCharacter();
        GameObject fighterOneToClone = DecideFighter(GameData.GetFighterOneCharacter());
        GameObject fighterTwoToClone = DecideFighter(GameData.GetFighterTwoCharacter());
        GameObject fighterOneClone;
        GameObject fighterTwoClone;

        if (GameData.GetFighterOneCharacter() == characters.Nesua)
        {
            fighterOneClone = Instantiate(fighterOneToClone, fighterOneStartingPosition, fighterOneStartingRotationNew);
        }
        else
        {
            fighterOneClone = Instantiate(fighterOneToClone, fighterOneStartingPosition, fighterOneStartingRotation);
        }
        if (GameData.GetFighterTwoCharacter() == characters.Nesua)
        {
            fighterTwoClone = Instantiate(fighterTwoToClone, fighterTwoStartingPosition, fighterTwoStartingRotationNew);
        }
        else
        {
            fighterTwoClone = Instantiate(fighterTwoToClone, fighterTwoStartingPosition, fighterTwoStartingRotation);
        }
        fighterOneClone.SetActive(true);
        fighterTwoClone.SetActive(true);
        fighterOne = fighterOneClone.GetComponent <FighterController>();
        fighterTwo = fighterTwoClone.GetComponent <FighterController>();
        fighterOne.Init(true, fighterTwoClone);
        fighterTwo.Init(false, fighterOneClone);
        fighterOneUI = fighterOne.GetFighterUI();
        fighterTwoUI = fighterTwo.GetFighterUI();
        mainCamera.Init(fighterOneClone, fighterTwoClone);
        zoomInCamera.Init();
        menuNavigation = GetComponent <MenuNavigation>();
        StartGame();
    }
Exemplo n.º 16
0
        public static FontMenuController Create(IEnumerable <DecalFont> fonts, DecalFont currentFont, UnityAction <DecalFont> fontUpdateCallback)
        {
            var menu = Instantiate(UILoader.FontMenuPrefab, MainCanvasUtil.MainCanvas.transform, true);

            menu.AddComponent <DragPanel>();
            MenuNavigation.SpawnMenuNavigation(menu, Navigation.Mode.Automatic, true);

            var controller = menu.GetComponent <FontMenuController>();

            controller._currentFont = currentFont;
            controller.onFontChanged.AddListener(fontUpdateCallback);

            controller.Populate(fonts);
            return(controller);
        }
Exemplo n.º 17
0
 private void Awake()
 {
     menuNavigation = GameObject.FindWithTag("Game Manager").GetComponent <MenuNavigation>();
     Init();
     for (int y = 0; y < buttonMap.GetLength(0); y++)
     {
         for (int x = 0; x < buttonMap.GetLength(1); x++)
         {
             if (buttonMap[y, x] == defaultButton)
             {
                 defaultButtonX = x;
                 defaultButtonY = y;
             }
         }
     }
 }
Exemplo n.º 18
0
        // GET: Admin/MenuNavigations/Edit/5
        public ActionResult Edit(int?id)
        {
            var listParent = db.MenuNavigations.AsEnumerable();

            ViewBag.item = listParent.ToList();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MenuNavigation menuNavigation = db.MenuNavigations.Find(id);

            if (menuNavigation == null)
            {
                return(HttpNotFound());
            }
            return(View(menuNavigation));
        }
Exemplo n.º 19
0
    public void SetAsset(InputActionAsset newAsset)
    {
        if (newAsset == asset)
        {
            return;
        }
        var gameplayCallbacks       = m_GameplayActionsCallbackInterface;
        var MenuNavigationCallbacks = m_MenuNavigationActionsCallbackInterface;

        if (m_Initialized)
        {
            Uninitialize();
        }
        asset = newAsset;
        gameplay.SetCallbacks(gameplayCallbacks);
        MenuNavigation.SetCallbacks(MenuNavigationCallbacks);
    }
Exemplo n.º 20
0
    /// <summary>
    /// 如果只获取到Id, 比如任务中的跳转, 不需要显示跳转的详细信息的
    /// </summary>
    public static BaseUi Navigation2Ui(int navId)
    {
        if (navId == IdSeg.InvalidId)
        {
            LoggerManager.Instance.Info("无效的跳转!!!");
            return(null);
        }

        MenuNavigation nav = ConfigDataBase.MenuNavigationConfig.Get(navId);

        if (AssertHelper.Check(nav != null, "没有找到跳转数据, 没有找到跳转数据 Id=" + navId))
        {
            return(Navigation2Ui(nav));
        }

        return(null);
    }
Exemplo n.º 21
0
        public ActionResult Edit(MenuNavigation menuNavigation, HttpPostedFileBase image_icon)
        {
            if (ModelState.IsValid)
            {
                if (image_icon != null)
                {
                    var filename = Path.GetFileName(image_icon.FileName);
                    var path     = Path.Combine(Server.MapPath("~/Upload/Images"), filename);

                    image_icon.SaveAs(path);
                    menuNavigation.IconMenu = "/Upload/Images/" + image_icon.FileName;
                }

                db.Entry(menuNavigation).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(menuNavigation));
        }
Exemplo n.º 22
0
 public void Init()
 {
     controllerInput      = ControllerManager.GetControllerInput(1);
     lastButtonPressed    = ButtonTypes.None;
     repeatDelayCount     = 0f;
     menuActive           = false;
     lockedMenu           = false;
     isPlayerOne          = true;
     selectedSpriteActive = false;
     cpuSelectorActive    = false;
     canvas         = GameObject.FindWithTag("Canvas");
     playerSelector = Instantiate(Resources.Load <GameObject>("Prefabs/UI/P1 Selector"), canvas.transform);
     playerSelector.SetActive(false);
     cpuSelector = Instantiate(Resources.Load <GameObject>("Prefabs/UI/CPU Selector"), canvas.transform);
     cpuSelector.SetActive(false);
     unselectedSprite    = Resources.Load <Texture>("2D Images/Player 1");
     selectedSprite      = Resources.Load <Texture>("2D Images/Player 1 Selected");
     playerTwoNavigation = GetComponents <MenuNavigation>()[1];
     playerTwoNavigation.SecondPlayerInit();
 }
Exemplo n.º 23
0
        public ActionResult Create(MenuNavigation menuNavigation, HttpPostedFileBase image_icon, bool status_mi)
        {
            if (ModelState.IsValid)
            {
                bool tus;
                if (status_mi == true)
                {
                    tus = true;
                }
                else
                {
                    tus = false;
                }



                if (image_icon != null)
                {
                    var filename = Path.GetFileName(image_icon.FileName);
                    var path     = Path.Combine(Server.MapPath("~/Upload/Images"), filename);


                    image_icon.SaveAs(path);
                    menuNavigation.IconMenu = "/Upload/Images/" + image_icon.FileName;
                }

                menuNavigation.Status    = tus;
                menuNavigation.CreatedAt = DateTime.Now;
                db.MenuNavigations.Add(menuNavigation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }


            var listParent = db.MenuNavigations.AsEnumerable();

            ViewBag.item = listParent.ToList();


            return(View(menuNavigation));
        }
Exemplo n.º 24
0
    private void InitializeComponents()
    {
        _orchestrator = GameObject.Find("Orchestrator")
                        .GetComponent <ScreenTitleOrchestrator>();

        _menuNavigation = GetComponent <MenuNavigation>();
        _audioSlider    = GameObject.Find("ButtonAudio")
                          .GetComponentInChildren <Slider>();

        _backgroundMusic = GameObject.Find("BackgroundMusic")
                           .GetComponent <AudioSource>();

        if (GameObject.Find("AmbianceSound"))
        {
            _ambianceSound = GameObject.Find("AmbianceSound")
                             .GetComponent <AudioSource>();
        }


        _audioSlider.value = PlayerPrefs.GetFloat("MasterVolume", 1f);
    }
Exemplo n.º 25
0
    void Start()
    {
        menuNavigation = IoC.Resolve <MenuNavigation>();

        Observable.EveryUpdate()
        .Where(x => KeyCode.R.IsPressed())
        .Take(1)
        .Subscribe(x => menuNavigation.StartGame())
        .AddTo(this);

        Observable.EveryUpdate()
        .Where(x => KeyCode.Escape.IsPressed())
        .Take(1)
        .Subscribe(x =>
        {
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.None;
            menuNavigation.NavigateToMainMenu();
        })
        .AddTo(this);
    }
Exemplo n.º 26
0
    /// <summary>
    ///  获取导航数据
    /// </summary>
    /// <param name="nav"></param>
    /// <param name="args">跳转参数</param>
    /// <param name="menuOpendData">需要被打开的面板</param>
    private static void GetNavArgs(MenuNavigation nav, Stack <string> args, out MenuNavigation menuOpenData)
    {
        if (nav.ParentMenuId != -1 && (!MenuParentId.IsMenuIgnore(nav.ParentMenuId)))
        {
            MenuNavigation parentMenu = ConfigDataBase.MenuNavigationConfig.Get(nav.ParentMenuId);
            if (AssertHelper.Check(parentMenu != null, "没有找到跳转数据,没有找到跳转数据 Id=" + parentMenu.Id))
            {
                if (parentMenu.ParentMenuId != -1)
                {
                    if (!string.IsNullOrEmpty(nav.MenuNavParam))
                    {
                        args.Push(nav.MenuNavParam);
                    }
                    GetNavArgs(parentMenu, args, out menuOpenData);

                    return;
                }
            }
        }

        menuOpenData = nav;
    }
Exemplo n.º 27
0
    /// <summary>
    /// 获取某个界面是否解锁
    /// </summary>
    public static bool IsUnlockPanel(MenuNavigation nav, bool showTip = false)
    {
        bool isParentUnlock = true;

        if (nav.ParentMenuId != -1 && (!MenuParentId.IsMenuIgnore(nav.ParentMenuId))) // 有父菜单
        {
            isParentUnlock = IsUnlockPanel(nav.ParentMenuId);
        }
        bool isUnlocked = false;

        switch (nav.MenuUnlockType)
        {
        case MenuUnlockType.DungeonUnlock:
            break;

        case MenuUnlockType.Dungeon:
        case MenuUnlockType.VIPLevel:
        case MenuUnlockType.Level:
            isUnlocked = DataModelManager.Instance.UIMenuNavgation.IsPanelUnlocked(nav.UiRegisterName);
            break;

        default:
            isUnlocked = DataModelManager.Instance.UIMenuNavgation.IsPanelUnlocked(nav.UiRegisterName);
            break;
        }

        if (isParentUnlock && isUnlocked)
        {
            return(true);
        }

        if (showTip)
        {
            ShowUnlockCondition(nav.MenuUnlockType, nav.MenuUnlockPara);
        }

        return(false);
    }
Exemplo n.º 28
0
        public static TextEntryController Create(
            string text, DecalFont font, FontStyles style, bool vertical, float linespacing, float charspacing,
            Vector2 lineSpacingRange, Vector2 charSpacingRange,
            TextUpdateDelegate textUpdateCallback)
        {
            var window = Instantiate(UILoader.TextEntryPrefab, MainCanvasUtil.MainCanvas.transform, true);

            window.AddComponent <DragPanel>();
            MenuNavigation.SpawnMenuNavigation(window, Navigation.Mode.Automatic, true);

            var controller = window.GetComponent <TextEntryController>();

            controller._text             = text;
            controller._font             = font;
            controller._style            = style;
            controller._vertical         = vertical;
            controller._lineSpacing      = linespacing;
            controller._charSpacing      = charspacing;
            controller._lineSpacingRange = lineSpacingRange;
            controller._charSpacingRange = charSpacingRange;
            controller._onValueChanged   = textUpdateCallback;

            return(controller);
        }
Exemplo n.º 29
0
 public void Awake()
 {
     INSTANCE = this;
 }
 public void MainMenu()
 {
     Unpause();
     MenuNavigation.MainMenu();
 }
 public void NextLevel()
 {
     Unpause();
     MenuNavigation.LoadNextLevel();
 }