protected override void Start() { base.Start(); Func <AvailablePart, bool> _criteria = (_aPart) => QSearch.FindPart(_aPart); searchFilterParts = new EditorPartListFilter <AvailablePart>(RegisterToolbar.MOD, _criteria); PartCategorizer.Instance.searchField.onValueChanged.RemoveAllListeners(); PointerClickHandler _pointerClickSearch = null; PartCategorizer.Instance.searchField.GetComponentCached <PointerClickHandler>(ref _pointerClickSearch); if (_pointerClickSearch != null) { _pointerClickSearch.onPointerClick.RemoveAllListeners(); _pointerClickSearch.onPointerClick.AddListener(new UnityAction <PointerEventData>(SearchField_OnClick)); } PartCategorizer.Instance.searchField.onEndEdit.AddListener(new UnityAction <string>(SearchField_OnEndEdit)); PartCategorizer.Instance.searchField.onValueChanged.AddListener(new UnityAction <string>(SearchField_OnValueChange)); PartCategorizer.Instance.searchField.GetComponentCached <Image>(ref searchImage); setSearchFilter(); QDebug.Log("Start", "QEditor"); }
internal static void Find(bool clean = false) { List <RDNode> _nodes = RDController.Instance.nodes; for (int _i = _nodes.Count - 1; _i >= 0; --_i) { RDNode _node = _nodes[_i]; RDTech _rdTech = _node.tech; if (_node.graphics != null) { UIStateButton _button = _node.graphics.button; if (!clean && _rdTech.partsAssigned.Find(aPart => QSearch.FindPart(aPart)) != null) { _button.Image.color = new Color(1f, 0f, 0f); continue; } _button.Image.color = new Color(1f, 1f, 1f); } } //QDebug.Log ("Find: " + QSearch.Text, "QRnD"); }