少年修仙传客户端基础资源
client_Wu Xijin
2018-11-05 1cee93d63f19fd4e961b47f23cfa7621833e7d7f
Assets/Editor/Actor/ResourcesBuilder.cs
@@ -140,7 +140,7 @@
        if ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
         && !isHighMesh
         && suffix.Equals(InstanceResourcesLoader.raceSuffix))
         && (suffix.Equals(InstanceResourcesLoader.raceSuffix) || suffix.Equals(InstanceResourcesLoader.handSuffix)))
        {
            _absOriginalePath = string.Format("{0}/ART/Role/{1}/{2}_Dm.FBX", Application.dataPath, path, resName);
            _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}_Dm.FBX", path, resName);
@@ -149,8 +149,8 @@
        string _tempPrefabName = outName;
        if (isHighMesh
        && ((!resName.StartsWith("A_Zs") && !resName.StartsWith("A_Fs"))
            || !suffix.Equals(InstanceResourcesLoader.raceSuffix)))
        && ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
        && (suffix.Equals(InstanceResourcesLoader.raceSuffix) || suffix.Equals(InstanceResourcesLoader.handSuffix))))
        {
            _tempPrefabName += "_UI";
@@ -317,7 +317,9 @@
        string _tempName = resName;
        if ((resName.StartsWith("A_Zs") || resName.StartsWith("A_Fs"))
            && suffix.Equals(InstanceResourcesLoader.raceSuffix) && !isHighMesh)
            && (suffix.Equals(InstanceResourcesLoader.raceSuffix)
             || suffix.Equals(InstanceResourcesLoader.handSuffix))
            && !isHighMesh)
        {
            _tempName += "_Dm";
        }
@@ -331,7 +333,7 @@
        Renderer _renderer = _rendererNode.GetComponent<Renderer>();
        if (_renderer)
        {
            OnSetupRenderer(path, resName, ref _renderer);
            OnSetupRenderer(path, _tempName, ref _renderer);
        }
        Animation _animation = _prefab.GetComponent<Animation>();
@@ -340,18 +342,26 @@
            Object.DestroyImmediate(_animation);
        }
        Animator _animator = _prefab.GetComponent<Animator>();
        if (!_animator)
        if (suffix.Equals(InstanceResourcesLoader.raceSuffix)
         || suffix.Equals(InstanceResourcesLoader.horseSuffix)
         || suffix.Equals(InstanceResourcesLoader.wingSuffix))
        {
            _animator = _prefab.AddComponent<Animator>();
        }
            Animator _animator = _prefab.GetComponent<Animator>();
        // 绑定动画控制器
        RuntimeAnimatorController _runtimeAnimatorContorller = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(_acAssetPath);
        if (_runtimeAnimatorContorller)
        {
            _animator.runtimeAnimatorController = _runtimeAnimatorContorller;
            if (!_animator)
            {
                _animator = _prefab.AddComponent<Animator>();
            }
            if (suffix.Equals(InstanceResourcesLoader.wingSuffix))
            {
                // 绑定动画控制器
                RuntimeAnimatorController _runtimeAnimatorContorller = AssetDatabase.LoadAssetAtPath<RuntimeAnimatorController>(_acAssetPath);
                if (_runtimeAnimatorContorller)
                {
                    _animator.runtimeAnimatorController = _runtimeAnimatorContorller;
                }
            }
        }
        PrefabUtility.CreatePrefab(_assetPath, _prefab, ReplacePrefabOptions.Default);