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 );
    }

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

相关推荐
数据皮皮侠AI2 天前
顶刊同款!中国地级市风灾风险与损失数据集(2000-2022)|灾害 / 环境 / 经济研究必备
大数据·人工智能·笔记·能源·1024程序员节
Fab1an3 天前
Busqueda——Hack The Box 靶机
linux·服务器·学习·1024程序员节
技术专家4 天前
Stable Diffusion系列的详细讨论 / Detailed Discussion of the Stable Diffusion Series
人工智能·python·算法·推荐算法·1024程序员节
学传打活6 天前
古代汉语是源,现代汉语是流,源与流一脉相承。
微信公众平台·1024程序员节·汉字·中华文化
学传打活11 天前
【边打字.边学昆仑正义文化】_19_星际生命的生存状况(1)
微信公众平台·1024程序员节·汉字·昆仑正义文化
unable code18 天前
[HNCTF 2022 WEEK2]ez_ssrf
网络安全·web·ctf·1024程序员节
unable code19 天前
[NISACTF 2022]easyssrf
网络安全·web·ctf·1024程序员节
unable code20 天前
BUUCTF-[第二章 web进阶]SSRF Training
网络安全·web·ctf·1024程序员节
开开心心就好21 天前
进程启动瞬间暂停工具,适合调试多开
linux·运维·安全·pdf·智能音箱·智能手表·1024程序员节
仰泳之鹅22 天前
【51单片机】第一课:单片机简介与软件安装
单片机·嵌入式硬件·51单片机·1024程序员节