Exemplo n.º 1
0
 private void DraggablePipe_AbortDragging(PathDraggable sender, float percentage)
 {
     if (percentage >= this.triggerPercentage)
     {
         this.draggablePipe.StopDragging -= DraggablePipe_AbortDragging;
         this.draggablePipe.GetComponent <Clickable>().enabled = false;
         this.draggablePipe.enabled = false;
         End();
     }
 }
Exemplo n.º 2
0
        private void Awake()
        {
            pathDraggable      = GetComponent <PathDraggable>();
            animationDraggable = GetComponent <AnimationDraggable>();
            var arrow = new GameObject("Arrow", typeof(RectTransform), typeof(SVGImage));

            arrowTransform = arrow.GetComponent <RectTransform>();
            arrowTransform.SetParent(transform);
            arrowTransform.localPosition = Vector3.zero;
            arrowTransform.localScale    = Vector3.one;
            arrowTransform.localRotation = Quaternion.identity;
            arrowTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 1);
            arrowTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 1);

            image = arrow.GetComponent <SVGImage>();
            if (sprite != null)
            {
                image.sprite = sprite;
            }
        }
Exemplo n.º 3
0
    void Start()
    {
        PathDraggable p = GetComponent <PathDraggable>();

        p.OnArrive += P_OnArrive;
    }
Exemplo n.º 4
0
    private void P_OnArrive(PathDraggable sender, float percentage)
    {
        string location = (percentage.Equals(1f)) ? "END" : "START";

        Debug.Log("ARRIVED: " + location + " (" + percentage.ToString() + ")");
    }
Exemplo n.º 5
0
 void Start()
 {
     this.draggablePipe = GetComponent <PathDraggable>();
     this.draggablePipe.StopDragging += DraggablePipe_AbortDragging;
 }