Example #1
0
 public static void Detach()
 {
     PointerClickHandler.Close();
     BackgroundBlur.SetActive(false);
     PlayerAttributes.ZoomableGO.GetComponent <Muscle>().IsZoom = false;
     Camera.main.orthographicSize   = startOthographicSize;
     Camera.main.transform.position = startCameraPosition;
 }
            private void Start()
            {
                _button = GetComponent <Button>();
                _originalClickHandler = GetComponent <PointerClickHandler>();
                _icon = GetComponent <EditorPartIcon>();


                if (_button == null || _originalClickHandler == null || _icon == null)
                {
                    Log.Error("Couldn't find an expected component");
                    Destroy(this);
                    return;
                }

                _originalClickHandler.enabled = false; // we'll be managing these events instead

                // unhook EditorPartIcon's listener from the button
                // this will allow us to veto any clicks
                _button.onClick.RemoveListener(_icon.MouseInput_SpawnPart);
            }
Example #3
0
        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");
        }
Example #4
0
 protected virtual void Initialize()
 {
     ZoomSystem.Zoom(PlayerAttributes.ZoomableGO);
     PointerClickHandler.Intialize(this);
     IsZoom = true;
 }