鸟语天空
Transform.TransformPoint()
post by:追风剑情 2016-11-9 20:53
using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

    public GameObject someObject;
    public void Awake()
    {
        //在当前对象(transform)的右边实例化一个物体(someObject)
        Vector3 thePosition = transform.TransformPoint(Vector3.right * 2);//返回世界坐标
        Instantiate(someObject, thePosition, someObject.transform.rotation);
    }
}
评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容