//先获取RectTransform组件
var rt = MainSetMenu.GetComponent<RectTransform>();
//获取anchoredPosition属性
rt.anchoredPosition;
//Dotween 坐标移动
rt.DOAnchorPos([指定坐标], 0.5f);
注意
一定注意UI一定要用RectTransform,其他情况随意
//先获取RectTransform组件
var rt = MainSetMenu.GetComponent<RectTransform>();
//获取anchoredPosition属性
rt.anchoredPosition;
//Dotween 坐标移动
rt.DOAnchorPos([指定坐标], 0.5f);
一定注意UI一定要用RectTransform,其他情况随意
非特殊说明,本博所有文章均为博主原创。