Canvas下GameObject的位置坐标

本文详细解析了轴心点与锚点的概念及其在物体旋转中的作用,阐述了轴心点是计算位置坐标的基点,而锚点是轴心点计算位置的(0,0)点,同时对比了transform.position与localPosition的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

轴心点是蓝色的小圆圈,锚点是白色的花瓣

1.轴心点是计算位置坐标的点,Rec Transform面板上的位置信息表示的是轴心点与其锚点的位置关系,当物体旋转时,绕轴心点旋转。

2.transform.position 的信息是轴心点相对世界原点的位置信息

Transform.position
The world space position of the Transform.

The position property of a GameObject’s Transform, which is accessible in the Unity Editor and through scripts. Alter this value to move a GameObject. Get this value to locate the GameObject in 3D world space.

3.transform.localPosition 的信息是子物体的轴心点相对父物体的轴心点的位置信息

Transform.localPosition
Position of the transform relative to the parent transform.

If the transform has no parent, it is the same as Transform.position.

1.位置关系

Rect Transform属性面板显示的是轴心点相对于其锚点的位置。
Console 面板输出的是transform.position。
2.物体旋转


锚点是轴心点计算位置的(0,0)点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值