Пример #1
0
    public static void ApplyDefaultMaterialProperties(Material material, CharacterMaterialType materialType)
    {
        material.shader = Shader.Find("Pegasus/CH/CH_Base");
        material.DisableKeyword("_MATERIALTYPE_BODY");
        material.EnableKeyword($"_MATERIALTYPE_{materialType.ToKeywordString()}");
        material.SetInt("_MaterialType", (int)materialType);

        material.SetFloat("_OutlineWidth", 0.2f);
        material.SetColor("_OutlineColor", new Color(0.1f, 0.1f, 0.1f, 1f)); // TODO: Calculate from average texture color
        material.SetFloat("_OutlineOffset", 0.5f);
        material.SetColor("_HighlightColor", Color.white);
        material.SetColor("_AddColor", Color.black);
        material.SetColor("_Condition", Color.gray);
        material.SetColor("_Visible", Color.white);

        material.SetTexture("_ShadowColor", TextureHelpers.GetDefaultTexture("ShadowColor"));
        material.SetTexture("_MatCap", TextureHelpers.GetDefaultTexture("CH_LightMap"));
        material.SetTexture("_Kamishitu", TextureHelpers.GetDefaultTexture("Gayousi_loop"));
        material.SetTexture("_HSVMaskTex", TextureHelpers.GetDefaultTexture("HSVMaskTex"));
    }