Unity克隆物体

public GameObject prefab;
    void Start()
    {
        //克隆预制体
        GameObject obj = Instantiate(prefab) as GameObject;
        //设置游戏对象obj的位置
        obj.transform.position = new Vector3(0,3,0);
    }

 

posted @ 2017-12-15 08:32  easydots  阅读(6649)  评论(0编辑  收藏  举报