脚本创建预制体

作者: 影子丢了 | 来源:发表于2016-02-26 13:31 被阅读161次
 static Object CreatePrefab(GameObject go, string name)
    {
        Object tempPrefab = EditorUtility.CreateEmptyPrefab("Assets/" + name + ".prefab");
        tempPrefab = EditorUtility.ReplacePrefab(go, tempPrefab);
        Object.DestroyImmediate(go);
        return tempPrefab;
    }

相关文章

网友评论

    本文标题:脚本创建预制体

    本文链接:https://www.haomeiwen.com/subject/clkwkttx.html