Unity Spine 指定导入新Spine动画的默认材质

指定导入新Spine动画的默认材质

找到Spine的Editor导入配置

通常在 Assets/Editor/SpineSettings.asset


配置文件对应着 Edit/Preferences/Spine 选项卡

  • Default Mix. 设置新导入的SkeletonDataAssets的 Default Mix Duration.
  • Default SkeletonData Scale. 设置新导入的SkeletonDataAssets的默认 Scale 值.
  • Default Shader. 设置新导入的skeleton atlas textures创建materials时使用的默认着色器.
  • Apply Atlas Texture Settings. 对下方指定的texture导入器应用参考的 Atlas Texture Settings .
  • Atlas Texture Settings. 在新导入的atlas textures 和 materials上应用选定的texture导入设置. 当从Spine导出atlas textures并启用 Premultiply alpha (默认为此)时, 你可以将其保持为 PMATexturePreset. 如果你已经禁用了 Premultiply alpha, 请将其设置为 StraightAlphaTexturePreset. 你也可以新建自己的 TextureImporter Preset 资产并分配于此处.
  • Additive Material. 设置槽位blend模式为 Additive 的Material模板. 具体参见 SkeletonData Blend 模式 Materials.
  • Multiply Material. 设置槽位blend模式为 Multiply 的Material模板. 具体参见 SkeletonData Blend 模式 Materials.
  • Screen Material. 设置槽位blend模式为 Screen 的Material模板. 具体参见 SkeletonData Blend 模式 Materials.

如何修改

方法一: 你可以通过脚本 去修改Assets/Editor/SpineSettings.asset文件

csharp 复制代码
   [MenuItem( "Tools/Spine/Change Spine default shader" )]
    public static void ChangeSpineDefaultShader( )
    {
        SetDefaultShaderForSpine( "Spine/Skeleton Fill" );
    }

    public static void SetDefaultShaderForSpine( string shaderName )
    {
        Shader shader = Shader.Find( shaderName );
        Debug.Assert( shader != null, $"There is no {{{shaderName}}} shader." );

        var guids = AssetDatabase.FindAssets( "t:SpinePreferences" );
        string assetPath = AssetDatabase.GUIDToAssetPath( guids[ 0 ] );
        SpinePreferences asset = AssetDatabase.LoadAssetAtPath<SpinePreferences>( assetPath );
        if ( asset != null )
        {
            asset.defaultShader = shaderName;
        }
        EditorUtility.SetDirty( asset );
        AssetDatabase.SaveAssetIfDirty( asset );
    }

方法二:通过面板手动设置

相关推荐
unable code2 天前
磁盘取证-Flying_High
网络安全·ctf·misc·1024程序员节·磁盘取证
unable code3 天前
磁盘取证-ColorfulDisk
网络安全·ctf·misc·1024程序员节·内存取证
unable code4 天前
磁盘取证-[第十章][10.1.2 磁盘取证方法]磁盘取证1
网络安全·ctf·misc·1024程序员节·内存取证
开开心心就好5 天前
免费抽奖工具支持批量导入+自定义主题
linux·运维·服务器·macos·pdf·phpstorm·1024程序员节
开开心心就好9 天前
卸载工具清理残留,检测垃圾颜色标识状态
linux·运维·服务器·python·安全·tornado·1024程序员节
子燕若水10 天前
Facebook reels 运营指南
1024程序员节
尘觉13 天前
创作 1024 天|把热爱写成长期主义
数据库·1024程序员节
写点什么呢14 天前
Word使用记录
word·1024程序员节
开开心心就好14 天前
内存清理工具点击清理,自动间隔自启
linux·运维·服务器·安全·硬件架构·材料工程·1024程序员节
开开心心就好15 天前
内存清理工具开源免费,自动优化清理项
linux·运维·服务器·python·django·pdf·1024程序员节