美文网首页
unity 编辑(Editor)模式制作prefab

unity 编辑(Editor)模式制作prefab

作者: 红定义 | 来源:发表于2017-03-07 08:39 被阅读0次

    Object go2 = AssetDatabase.LoadAssetAtPath(MakeCreaturePrefabWindow.Check_modelNames[key].Replace(@"\", "/") + "/" + key + ".fbx", typeof(Object));

    if (null != go2)

    {

    GameObject GG = go2 as GameObject;

    if (GG)

    {

    Animation _animation = GG.GetComponent();

    if (_animation)

    {

    for (int i = 0; i < _clipList.Count; i++)

    {

    _animation.AddClip(_clipList[i], _clipList[i].name);

    }

    GG.transform.localPosition = Vector3.zero;

    Object _prefab = PrefabUtility.CreateEmptyPrefab(ProjectDirectory.PrefabLocalPath_Creature + "/" + key + ".prefab");

    PrefabUtility.ReplacePrefab(GG, _prefab);

    }

    else

    {

    DebugX.Log("animation is null.");

    }

    }

    else

    {

    DebugX.Log("NULL");

    }

    }

    else

    {

    DebugX.Log(MakeCreaturePrefabWindow.Check_modelNames + " is null.");

    }

    相关文章

      网友评论

          本文标题:unity 编辑(Editor)模式制作prefab

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