void UpdateSpinner(Scrollbar Scroll) { if (MenuCon == null) { MenuCon = FindObjectOfType <MenuNavigator>(); } if (MenuCon != null) { int Value = (int)(Scroll.value * (Scroll.numberOfSteps - 1)); string Text; Debug.Log(Value + " | " + Scroll.value + " | " + Scroll.numberOfSteps + " | " + Screen.resolutions.Length); switch (SettingsTarget) { case SettingsNames.GFX_RES: //UpdateSpinner(Scroll, Screen.resolutions[Value]); Resolution Res = Screen.resolutions[Value]; Text = (Res.width + "x" + Res.height); UpdateText(Text); MenuCon.SaveToVar(SettingsTarget, Value); break; case SettingsNames.GFX_FULLSCREEN: FullScreenMode FSMode = (FullScreenMode)Value; //UpdateSpinner(Scroll, FSMode); Text = FSMode.ToString(); UpdateText(Text); MenuCon.SaveToVar(SettingsTarget, Value); break; default: break; } } }
public InputColSevenViewModel() { Slider = new MenuSlider(); Navigator = new MenuNavigator(); RelayCommand_inputValid = new RelayCommand <object>(CheckLegalDataType); _txtbxInputValid = ""; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// /// </summary> private void Start() { LoadSettings(); SwitchGamepadSchemes(_SchemeIndex); gamepad = GamepadManager.Instance.GetGamepad(1); _MenuNavigator = GetComponent <MenuNavigator>(); UpdateTextAndApplySettings(); }
public override void OnApplyTemplate() { MenuNavigator.SetBody(typeof(AmbDiagnostic)); EntrySearchNavigator.SetBody(typeof(AmbEntrySearchPanel)); EntryTabNavigator.SetBody(typeof(AmbEntryInfo)); base.OnApplyTemplate(); }
// Use this for initialization void Start() { if (_instance == null) { _instance = this; } EventSystem.current.firstSelectedGameObject = scrollRectContent.GetChild(0).gameObject; lastValidSelection = EventSystem.current.firstSelectedGameObject; }
public override void Awake() { base.Awake(); delay = 5; tick = 0; frame = Frame.Instance; timer = ZombieTimer.Instance; stats = GameStatistics.Instance; level = LevelManager.Instance; navigate = MenuNavigator.Instance; //[Player status injection site: load player stats here for which weapons they had saved] }
public void Awake() { _menuNavigator = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<MenuNavigator>(); _audioMenu = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<AudioMenu>(); GameObject[] gameController = GameObject.FindGameObjectsWithTag(Tags.GameController); if (gameController.Length == 0) return; GameControllerInput input = gameController[0].GetComponent<GameControllerInput>(); if (input == null) return; _hasInputController = input.isActiveAndEnabled; returned = false; }
public StatViewModel() { Slider = new MenuSlider(); Navigator = new MenuNavigator(); StatBuilderMoment = new MomentStatBuilder(); StatBuilderWeight = new WeightStatBuilder(); RegenerateMomentGraph(); RegenerateWeightGraph(); ChooseFinishedItemCommand = new RelayCommand <object>(ChooseFinishedItemCommandMethod); ChooseProcessingItemCommand = new RelayCommand <object>(ChooseProcessingItemCommandMethod); CalendarCommand = new RelayCommand <object>(CalendarCommandMethod); CalendarToDateCommand = new RelayCommand <object>(CalendarToDateCommandMethod); CheckBoxCommand = new RelayCommand <string>(CheckBoxCommandMethod); }
// Start is called before the first frame update void Start() { instance = this; ResetStatics(); menuNavigator = GetComponent <MenuNavigator>(); zoomer = Camera.main.GetComponent <Zoomer>(); currentZoom = 0; if (zoomer) { ZoomOut(); } RefreshRunning(); }
// Use this for initialization void Start() { Navigator = GetComponent <MenuNavigator>(); _Gamepad = GamepadManager.Instance.GetGamepad(1); if (_Gamepad.IsConnected) { CurrentController = "Controller"; _MousePosition = Input.mousePosition; } else { CurrentController = "Keyboard"; } }
public override void Awake() { base.Awake(); toucher = GameObjectToucher.Instance; navigator = MenuNavigator.Instance; Transform Buttons = this.gameObject.transform.FindChild("Buttons"); if (Buttons != null) { foreach (Transform b in Buttons) { JDMenuButton script = b.gameObject.AddComponent<JDMenuButton>(); this.menuButtons.Add(b.gameObject.name, script); } } }
bool ResetPosition(GameObject player) //Reset Axis Input for Xbox controller { MenuNavigator navigator = player.GetComponent <MenuNavigator>(); string hAxis = navigator.horizontalAxis; string vAxis = navigator.verticalAxis; string hAxisDpad = navigator.dpadHorizontal; string vAxisDpad = navigator.dpadVertical; if ((Input.GetAxisRaw(hAxis) < .2f) && (Input.GetAxisRaw(hAxis) > -0.2f) && (Input.GetAxisRaw(vAxis) < 0.2f) && (Input.GetAxisRaw(vAxis) > -.2f) && (Input.GetAxisRaw(hAxisDpad) < .2f) && (Input.GetAxisRaw(hAxisDpad) > -0.2f) && (Input.GetAxisRaw(vAxisDpad) < 0.2f) && (Input.GetAxisRaw(vAxisDpad) > -.2f)) { return(true); } else { return(false); } }
void UpdateSlider(Slider ValTarget) { if (MenuCon == null) { MenuCon = FindObjectOfType <MenuNavigator>(); } if (MenuCon != null) { MenuCon.SetSliderValue(ValTarget); MenuCon.SaveToVar(SettingsTarget, ValTarget.normalizedValue); if (SettingsTarget == SettingsNames.GP_TIMESCALE) { UpdateText(ValTarget.normalizedValue.ToString("N", Digit)); } else { UpdateText((ValTarget.normalizedValue * 100).ToString()); } } }
// Update is called once per frame void Update() { confirm = false; cancel = false; foreach (InputScheme s in schemes) { s.ProcessInputs(); if (s.up && current.Up) { current.Leave(); current = current.Up; current.Enter(); } if (s.down && current.Down) { current.Leave(); current = current.Down; current.Enter(); } if (s.left && current.Left) { current.Leave(); current = current.Left; current.Enter(); } if (s.right && current.Right) { current.Leave(); current = current.Right; current.Enter(); } if (s.confirm) { confirm = s.confirm; } if (s.cancel) { cancel = s.cancel; } } }
private void Awake() { _menuNavigator = GameObject.Find("PauseMenu").GetComponent <MenuNavigator>(); _fadePlane = GameObject.Find("FadePlane").GetComponent <SpriteRenderer>(); }
void Start() { menuNav = EventSystem.current.gameObject.GetComponent <MenuNavigator>(); }
void Start() { // Retrives the independent control component _switcher = GetComponent<GameControllerIndependentControl>(); //_mainCameraController = GetComponentInChildren<MainCameraController>(); _helpController = GetComponent<GameControllerHelp>(); _ui = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<MenuNavigator>(); _enabled = true; }
/// <summary> /// Get all levels and prepare the map /// </summary> public void Awake() { _menuNavigator = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<MenuNavigator>(); _data = GameObject.FindGameObjectWithTag(Tags.GameData).GetComponent<GameControllerData>(); _levels = new List<GameObject[]>(); _levelsindicator = new List<Indicator[]>(); _titleWorld = cameraCanvas.GetComponentInChildren<TextInternationalizationMesh>(); MeshRenderer titleRender = cameraCanvas.GetComponentInChildren<MeshRenderer>(); titleRender.sortingOrder = 100; _transformCamera = cameraCanvas.GetComponent<Transform>(); //show the world but not focus _actualLevelInfo.world = -1; _actualLevelInfo.level = -1; }
/// <summary> /// this is called from the game controller when we should enter the main menu /// </summary> public void enterMainMenu() { state = State.MainMenu; mainMenuNavigator = new MenuNavigator(); mainMenuNavigator.root = generateMainMenu(); mainMenuNavigator.start(); mainMenuNavigator.activate(); }
/// <summary> /// Unity's method called when the entity is created. /// Recovers the desired componentes of the entity. /// </summary> public void Awake() { // Retrieves the components of the entity. _collider = gameObject.GetComponent<BoxCollider>(); // Retrieves the UI Reference _menuNavigator = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<MenuNavigator>(); //Get data game and store the next level if(Application.isPlaying) _data = GameObject.FindGameObjectWithTag(Tags.GameData).GetComponent<GameControllerData>(); }
void ChangePosition(GameObject player)// { MenuNavigator navigator = player.GetComponent <MenuNavigator>(); string hAxis = navigator.horizontalAxis; string vAxis = navigator.verticalAxis; string hAxisDpad = navigator.dpadHorizontal; string vAxisDpad = navigator.dpadVertical; string input = navigator.enterButton; string back = navigator.backButton; if ((navigator.onAxis == true) && ResetPosition(player) == true) { navigator.onAxis = false; } if (navigator.canMove == true && navigator.isActive == true) { if (((Input.GetAxis(vAxis) == 1) || (Input.GetAxis(vAxisDpad) == 1)) && (navigator.onAxis == false)) //Move up. If user is on top row move them to the bottom { if (FindRow(player) == 1) { navigator.selector += (columns * (rows - 1)); } else { navigator.selector -= columns; } SetPostion(player); navigator.onAxis = true; } if (((Input.GetAxis(vAxis) == -1) || (Input.GetAxis(vAxisDpad) == -1)) && (navigator.onAxis == false)) //Move down. If user is on botton row move them to top { if (FindRow(player) == (rows)) { navigator.selector -= (columns * (rows - 1)); } else { navigator.selector += columns; } SetPostion(player); navigator.onAxis = true; } if (((Input.GetAxis(hAxis) == -1) || (Input.GetAxis(hAxisDpad) == -1)) && (navigator.onAxis == false)) //Move left. If user is in left most column move them to right most column { Debug.Log("Moving"); if (FindColumn(player) == 1) { navigator.selector += (columns - 1); } else { navigator.selector -= 1; } SetPostion(player); navigator.onAxis = true; } if (((Input.GetAxis(hAxis) == 1) || (Input.GetAxis(hAxisDpad) == 1)) && (navigator.onAxis == false)) //Move right. If user is in left most column move them to right most column { Debug.Log("Moving"); if (FindColumn(player) == columns) { navigator.selector -= (columns - 1); } else { navigator.selector += 1; } SetPostion(player); navigator.onAxis = true; } } if (Input.GetButtonDown(input)) //Get input / select button { if (navigator.isActive == true) { if (playersConfirmed == playersPlaying) { //Move to next screen when all players are ready if needed } if (navigator.canMove == true) { //Call button function } } if (navigator.isActive == false) //Used to add players that start as unactive. Ex. Multiplayer character select { player.GetComponent <MenuNavigator>().isActive = true; playersPlaying += 1; navigator.gameObject.SetActive(true); //Turn on the new players navigator player.GetComponent <MenuNavigator>().selector = 1; //Set player at start of the menu SetPostion(player); } } if (Input.GetButtonDown(back) && navigator.isActive == true) { if (playersConfirmed == 0) { //Go back to previous menu } if (navigator.canMove == false) { //Deselect object if necessary } } }
static void Main(string[] args) { MenuNavigator navigator = new MenuNavigator(); navigator.ShowMenu(new TestMenu1()); }
public void Awake() { _menuNavigator = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<MenuNavigator>(); _audioMenu = GameObject.FindGameObjectWithTag(Tags.Menus).GetComponent<AudioMenu>(); }