少年修仙传客户端基础资源
client_Hale
2018-10-13 61b861e120ff49d08d6e446910ebb3c103e5de94
3270 【开发】主干:模型生成工具, 增加按照配置生成的逻辑
2个文件已修改
2个文件已添加
105 ■■■■■ 已修改文件
Assets/Editor/Actor/ActorEditor.cs 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Actor/NpcResourcesBuilder.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Config/ui_ac_config.txt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Config/ui_ac_config.txt.meta 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Actor/ActorEditor.cs
@@ -4,6 +4,7 @@
using UnityEditor;
using UnityEditor.Animations;
using TableConfig;
using System;
public class ActorEditor : EditorWindow
{
@@ -13,6 +14,38 @@
    {
        EditorWindow _window = CreateInstance<ActorEditor>();
        _window.Show();
    }
    [MenuItem("程序/角色相关/卸载NPC动画状态机")]
    static void RemoveAnimator()
    {
        var _dict = Config.Instance.GetAllValues<NPCConfig>();
        int i = 0;
        foreach (var _model in _dict)
        {
            if (_model.NPCType != 0
             && _model.NPCType != 2
             && _model.NPCType != 3
             && _model.NPCType != 4
             && _model.NPCType != 5
             && _model.NPCType != 8
             && _model.NPCType != 9
             && _model.NPCType != 14
             && _model.NPCType != 16
             && _model.NPCType != 17
             && _model.NPCType != 18
             && _model.NPCType != 19)
            {
                continue;
            }
            if (string.IsNullOrEmpty(_model.MODE))
            {
                continue;
            }
        }
    }
    private enum BuildNpcType
@@ -79,42 +112,12 @@
            m_NpcResBuilder.BuildNpc(m_ModelName, m_BuildName, (int)m_NpcType, m_HighMesh);
        }
        if (GUILayout.Button("生成所有", GUILayout.Height(24)))
        if (GUILayout.Button("按照给定的NPC配置信息生成"))
        {
            bool _result = EditorUtility.DisplayDialog("温馨提醒", "生成所有换装资源将会耗费比较长的时间, 请记得几点, 是否是需要生成所有的资源, 如果不是, 记得可以去掉不生成的资源,是不是不需要生成已经存在的资源, 如果不需要, 记得勾选[只生成不存在的]", "确认生成", "我按错了");
            if (_result)
            {
                var _dict = Config.Instance.GetAllValues<NPCConfig>();
                int i = 0;
                foreach (var _model in _dict)
                {
                    if (_model.NPCType != 0
                     && _model.NPCType != 2
                     && _model.NPCType != 3
                     && _model.NPCType != 4
                     && _model.NPCType != 5
                     && _model.NPCType != 8
                     && _model.NPCType != 9
                     && _model.NPCType != 14
                     && _model.NPCType != 16
                     && _model.NPCType != 17
                     && _model.NPCType != 18
                     && _model.NPCType != 19)
                    {
                        continue;
                    }
                    if (string.IsNullOrEmpty(_model.MODE))
                    {
                        continue;
                    }
                    m_NpcResBuilder.BuildNpc(_model.MODE, m_BuildName, (int)m_NpcType, m_HighMesh);
                    // if (i++ > 3)
                    // {
                    //     break;
                    // }
                }
                BuildAllUIAnimatorController();
            }
        }
@@ -212,6 +215,26 @@
        if (GUILayout.Button("重命名AssetBundle"))
        {
            ReAssetBundleName();
        }
    }
    private void BuildAllUIAnimatorController()
    {
        string _configPath = EditorUtility.OpenFilePanel("选择配置文件", Application.dataPath + "/Editor/Config", "txt");
        if (!string.IsNullOrEmpty(_configPath))
        {
            string[] _modeNames = File.ReadAllLines(_configPath);
            for (int i = 0; i < _modeNames.Length; ++i)
            {
                _modeNames[i] = _modeNames[i].Trim();
                if (string.IsNullOrEmpty(_modeNames[i]))
                {
                    continue;
                }
                m_NpcResBuilder.BuildNpc(_modeNames[i], null, (int)m_NpcType, m_HighMesh);
            }
        }
    }
@@ -320,7 +343,7 @@
    static void ExportAnimationClips()
    {
        Object[] _selectObjects = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
        UnityEngine.Object[] _selectObjects = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
        if (_selectObjects == null || _selectObjects.Length == 0)
        {
            return;
@@ -349,7 +372,7 @@
            string _assetPath = string.Empty;
            string _newAssetPath = string.Empty;
            string _assetName = string.Empty;
            Object _clip = null;
            UnityEngine.Object _clip = null;
            int _index = 0;
            foreach (var _object in _selectObjects)
            {
Assets/Editor/Actor/NpcResourcesBuilder.cs
@@ -21,6 +21,10 @@
        {
            for (int i = 0; i < _item.showNpcs.Length; i++)
            {
                if(_item.showNpcs[i] == 0)
                {
                    continue;
                }
                _npcModel = Config.Instance.Get<NPCConfig>(_item.showNpcs[i]);
                if (_npcModel == null)
                {
Assets/Editor/Config/ui_ac_config.txt
New file
@@ -0,0 +1,2 @@
M033
M034
Assets/Editor/Config/ui_ac_config.txt.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4ececb82ae06a3459d07ab42758226f
timeCreated: 1539412448
licenseType: Free
TextScriptImporter:
  userData:
  assetBundleName:
  assetBundleVariant: