baiyu0708 2015-02-22 15:38 采纳率: 0%
浏览 3190

unity脚本中的Transform指什么?

假设下面只涉及类型Transform和类型GameObject
现有Transform的实例t。t代表下列哪一个?
1.三元组(位置、旋转、缩放);
2.t唯一地确定了一个GameObject的实例。

我认为是第二个,因为Transform有实例方法GetComponent()。例如GetComponent在下面的脚本中出现:

public class BulletCreater : MonoBehaviour {
    public Transform bullet;
    // Use this for initialization
    void Start () {
        BulletForward bulletForward = bullet.GetComponent<BulletForward> ();
        if (bulletForward != null) {
            Debug.Log (bulletForward.velocity);
        }
    }

    // Update is called once per frame
    void Update () {

    }
}

上述脚本涉及了素材(Asset):
@prefab Bullet
使用脚本@ref "BulletForward"
@script BulletForward 控制子弹向前
拥有属性public velocity
@script BulletCreater

另外,Transform的两个实例t1和t2等价的充要条件是什么?
1.两个实例代表的位置、旋转、缩放均等价
2.t1和t2确定了同一个gameObject,其中gameObject是GameObject的实例

  • 写回答

2条回答 默认 最新

  • devmiao 2015-02-22 15:46
    关注
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!