Beispiel #1
0
 private void HandleConnectPointConnected(ConnectPoint connectPt, Connectable connectable)
 {
     connectable.transform.SetParent(transform, true);
     connectable.GetComponent <Damagable>().OnPartDestroyed.AddListener(HandleConnectedPartDestroyed);
     Ship.RegisterConnectable(connectable);
     ConnectedPart = connectable;
 }
Beispiel #2
0
    public void OnBeginDrag(PointerEventData eventData)
    {
        GameObject obj = new GameObject("anchor", new System.Type[] { typeof(RectTransform) });

        tempConnectable = obj.AddComponent <Connectable>();
        GetComponentInParent <Node>().next = tempConnectable;
        tempConnectable.anchor             = tempConnectable.transform;
        tempConnectable.transform.SetParent(transform, true);
        tempConnectable.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
//		tempConnectable.GetComponent<RectTransform>().anchoredPosition = RectTransformExtension.switchToRectTransform(GetComponent<RectTransform>(), tempConnectable.GetComponent<RectTransform>());
    }
Beispiel #3
0
 public void OnDrag(PointerEventData eventData)
 {
     tempConnectable.GetComponent <RectTransform>().anchoredPosition += eventData.delta;
 }