/// <summary> /// Called When the grid entity is selected /// </summary> public void OnSelect() { if(CurrentlySelected != null && CurrentlySelected != this) { CurrentlySelected.OnUnselect(); } }
public void SetScale(Vector3 scale) { if (CurrentlySelected != null) { CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetScale(scale); } }
private void select(int value) { if (value == -1) // Unselect { _selectedIndex = value; } else if (value < _panel.Children.Count) { _selectedIndex = value; } else // Selecting index beyond the scope { _selectedIndex = -1; } if (CurrentlySelected != null) { CurrentlySelected.__unselect(); } if (_selectedIndex == -1) { CurrentlySelected = null; return; } UIElement sel = _panel.Children[value]; MySelectableListItem newlySelectedItem = backMapping[sel]; CurrentlySelected = newlySelectedItem; CurrentlySelected.__select(); }
// Start is called before the first frame update void Start() { colourIndex = Random.Range(0, 6); spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); spriteRenderer.sprite = colours[colourIndex]; infoPanel = GameObject.Find("VehicleInfoPanel"); currentlySelected = infoPanel.GetComponent <CurrentlySelected>(); }
public void OnSelect() { Debug.Log("On first select called"); prefUIManager.LoadPrefs(CurrentlySelected.GetComponent <ScoreZoneSelectible>().SettingsContainer); ObjectSelected = true; }
public void SetAxeHead() { ItemOne.sprite = File; ItemTwo.sprite = PlateBroken; ItemOne.enabled = true; ItemTwo.enabled = true; HasFirstItem = false; HasSecondItem = false; ItemOneObj = null; ItemTwoObj = null; CurrentlySelectedCombineItem = CurrentlySelected.cS_AxeHead; }
public void SetAxe() { ItemOne.sprite = AxeHead; ItemTwo.sprite = BroomStick; ItemOne.enabled = true; ItemTwo.enabled = true; HasFirstItem = false; HasSecondItem = false; ItemOneObj = null; ItemTwoObj = null; CurrentlySelectedCombineItem = CurrentlySelected.cS_Axe; }
public void SetFlashlight() { ItemOne.sprite = Flashlight; ItemTwo.sprite = Battery; ItemOne.enabled = true; ItemTwo.enabled = true; HasFirstItem = false; HasSecondItem = false; ItemOneObj = null; ItemTwoObj = null; CurrentlySelectedCombineItem = CurrentlySelected.cS_Flashlight; }
public void SetClock() { ItemOne.sprite = Clock; ItemTwo.sprite = Battery; ItemOne.enabled = true; ItemTwo.enabled = true; HasFirstItem = false; HasSecondItem = false; ItemOneObj = null; ItemTwoObj = null; CurrentlySelectedCombineItem = CurrentlySelected.cS_Clock; }
public void SetBrokenPlate() { ItemOne.sprite = Hammer; ItemTwo.sprite = Plate; ItemOne.enabled = true; ItemTwo.enabled = true; HasFirstItem = false; HasSecondItem = false; ItemOneObj = null; ItemTwoObj = null; CurrentlySelectedCombineItem = CurrentlySelected.cS_BrokenPlate; }
public void OnEndDrag(PointerEventData eventData) { Destroy(_dragDupe.gameObject); _dragDupe = null; _dragRect = null; if (OnShipInfoEndDrag != null) { if (CurrentlySelected.Any()) { OnShipInfoEndDrag(eventData, CurrentlySelected.Select(si => si.GetComponent <ShipInfo>())); } else { OnShipInfoEndDrag(eventData, Enumerable.Repeat(this, 1)); } } }
// Update is called once per frame void Update() { for (var i = 0; i < scoreZones.Count; i++) { if (!scoreZones[i].Equals(CurrentlySelected)) { scoreZones[i].BroadcastMessage("DeSelect"); } } if (CurrentlySelected != null) { CurrentlySelected.BroadcastMessage("Select"); } if (Input.GetMouseButtonDown(0)) { CheckSelectedObject(); } // Debug.Log((CurrentlySelected == null) ? "Nothing selected" : "Something selected"); } // Debug.Log("object is not a scorezone: " + hit.collider.gameObject.transform.parent.name);
public void Guess(Type type) { Console.WriteLine($"The type is {type.TypeName}"); List <Type> isContained = CurrentlySelected.Where(x => x.TypeName.CompareTo(type.TypeName) == 0).ToList(); if (isContained.Count() > 0) { CurrentlySelected.Remove(isContained[0]); } else { CurrentlySelected.Add(type); } Console.WriteLine("Currently Selected types:"); foreach (var selection in CurrentlySelected) { Console.WriteLine($" {selection.TypeName}"); } }
public GlyphEditor(int postionX, int postionY, IWindow parentWindow, BasicOne basicOne) : base(postionX, postionY, 31, 24, parentWindow) { BasicOne = basicOne; BackColor = Terminal.YELLOW; ForeColor = Terminal.BLACK; Inputs.Add(new Button(22, 1, "COPY ", this) { Action = () => { CurrentlySelected?.Unselect(); CurrentlySelected = null; var data = new DataPackage(); data.SetText($"{GetGlyph()}"); Clipboard.SetContent(data); } }); Inputs.Add(new Button(22, 3, "PASTE", this) { Action = () => { CurrentlySelected?.Unselect(); CurrentlySelected = null; Paste(); } }); Inputs.Add(new Button(22, 5, "NEG ", this) { Action = () => { CurrentlySelected?.Unselect(); CurrentlySelected = null; Negative(); } }); }
public void CancelMenu() { switch (buttonState) { case (ButtonState.First): if (InTargetMenu) { CurrentlySelected.GetComponent <SkillButton>().OnDeselect(null); InTargetMenu = false; CloseTargets(); StartOptions(); //close target menu and open first menu } // InTargetMenu = false; break; case (ButtonState.Skills): if (InTargetMenu) { //close target menu and open skill menu CurrentlySelected.GetComponent <SkillButton>().OnDeselect(null); InTargetMenu = false; CloseTargets(); SkillMenu(); } else { //close skill menu and reopen main buttons CloseSkills(); StartOptions(); } // InTargetMenu = false; break; } }
public void SetTeam(ScoreZoneSettingsContainer.Team team) { Debug.Log("Got updated team of " + team.ToString()); CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetTeam(team); }
public void SetReinstantationPref(bool val) { Debug.Log("Got updated reinstantiation pref of " + val); CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetReinstantiationPref(val); }
public void SetDestroyPref(bool val) { Debug.Log("Got updated destroy pref of " + val); CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetDestroyPref(val); }
public void SetScore(float score) { Debug.Log("Got updated score of " + score); CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetScore(score); }
// Start is called before the first frame update void Start() { currentlySelected = infoPanel.GetComponent <CurrentlySelected>(); }
// Start is called before the first frame update void Start() { currentlySelected = GameObject.Find("VehicleInfoPanel").GetComponent <CurrentlySelected>(); }
public override bool Update(Keys key, Func <char?> getKey, bool click, int mouseX, int mouseY) { if (!Visible) { return(false); } char?c; if (key == Keys.Tab) { if (CurrentlySelected == null && Inputs.Any()) { SelectFirstItem(); } else { CurrentlySelected?.Tab(); } } else if (key == Keys.Escape) { Clear(); } else if (key == Keys.Enter) { CurrentlySelected?.Enter(); } else if (key == Keys.Multiply) { Operator('*'); CurrentlySelected = EqualsBtn; SetSelected(); } else if (key == Keys.Divide) { Operator('/'); CurrentlySelected = EqualsBtn; SetSelected(); } else if (key == Keys.Add) { Operator('+'); CurrentlySelected = EqualsBtn; SetSelected(); } else if (key == Keys.Subtract) { Operator('-'); CurrentlySelected = EqualsBtn; SetSelected(); } else if (key == Keys.Left) { CurrentlySelected?.CursorMoveLeft(); } else if (key == Keys.Right) { CurrentlySelected?.CursorMoveRight(); } else if (key == Keys.Up) { CurrentlySelected?.CursorMoveUp(); } else if (key == Keys.Down) { CurrentlySelected?.CursorMoveDown(); } else if (key == Keys.Back) { CurrentlySelected?.BackSpace(); } else if (key == Keys.Home) { CurrentlySelected?.CursorToStart(); } else if (key == Keys.End) { CurrentlySelected?.CursorToEnd(); } else if ((c = getKey?.Invoke()) != null) { AddLetter((char)c); // Letter(input.KeyChar); } else if (click) { var handled = false; foreach (var i in Inputs) { var rect = new Rectangle(i.PositionX, i.PositionY, i.Width, i.Height); if (rect.Contains(new Point(mouseX, mouseY))) { var mx = mouseX - i.PositionX; var my = mouseY - i.PositionY; if (i.Selectable) { CurrentlySelected = i; SetSelected(); } i.Click(mx, my); handled = true; } } Click(mouseX, mouseY, handled); } return(true); }
public void SetScoreType(ScoreZoneSettingsContainer.ScoreTypes type) { Debug.Log("Got updated scoring type of " + type.ToString()); CurrentlySelected.GetComponent <ScoreZoneSelectible>().SetScoreType(type); }