Example #1
0
        public virtual void OnPointerDown(PointerEventData eventData)
        {
            if (KeyInputManager.Instance.isAltPressed && graphLine)
            {
                WorkspaceManager.Instance.RemoveLine(graphLine);
                return;
            }

            if (hasLine)
            {
                return;
            }

            // create and set graph line.
            if (HasDragItem)
            {
                dragItem.SetEnableDrag(false);
            }

            GameObject newObj = CreateLineGO();

            graphLine = newObj.GetComponent <GraphLine>();
        }
Example #2
0
        public virtual void OnPointerDown(PointerEventData eventData)
        {
            if (isAltPressed && graphLine)
            {
                Destroy(graphLine.gameObject);
                return;
            }

            if (hasLine)
            {
                return;
            }

            // create and set graph line.
            if (HasDragItem)
            {
                dragItem.SetEnableDrag(false);
            }
            GameObject newObj = Instantiate(lineBasePrefab);

            newObj.transform.SetParent(transform);
            newObj.transform.localPosition = Vector3.zero;
            graphLine = newObj.GetComponent <GraphLine>();
        }