Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4019.00元
局部坐标位移
张同学斯基发起了问答2017-03-20
1
回复
1113
浏览
 public RectTransform asT;
    void Start()
    {
        if (asT == null)
        {
            asT = GetComponent<RectTransform>();
        }
    }


 public void TuiChu()
    {
        asT.transform.DOLocalMoveX(0, 0.25f);
        this.transform.DOLocalMoveX(1000, 0.25f);
    }

我做了两个面板根据坐标互换做跳转功能。this面板位移走了在1000,asT面板坐标还在1000不回来啊.两个面板都是能走,却回不来。

所有回复
  • siki 2017-03-21

    使用recttransform里面的移动的方法

    DOAnchorPosX/DOAnchorPosY(float to, float duration, bool snapping)

    Tweens the target's anchoredPosition to the given value, tweening only the chosen axis.
    snapping If TRUE the tween will smoothly snap all values to integers.

    还有-5条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!