TimelineImprovements

This commit is contained in:
ThomasCharester committed 2026-11-20 14:28:56 +03:00
1 parent e312131725
commit f927552adc
2211 files changed
+115416 -540944

No files matched your search

+20 -1
View File
@@ -78,6 +78,14 @@ namespace MK.Toon
}
public class FBoolProperty : Property<bool>
{
private bool _invertKeyword;
private bool _transparentOnly;
public FBoolProperty(Uniform uniform, string keyword, bool invertKeyword, bool transparentOnly = false) : base(uniform, keyword)
{
_invertKeyword = invertKeyword;
_transparentOnly = transparentOnly;
}
public FBoolProperty(Uniform uniform, string keyword) : base(uniform, keyword) {}
public FBoolProperty(Uniform uniform) : base(uniform) {}
@@ -88,7 +96,7 @@ namespace MK.Toon
public override void SetValue(Material material, bool value)
{
material.SetFloat(_uniform.id, value ? 1 : 0);
SetKeyword(material, value, 0);
SetKeyword(material, (_invertKeyword ? !value : value) && (!_transparentOnly || Properties.surface.GetValue(material) == Surface.Transparent), 0);
}
}
public class IntProperty : Property<int>
@@ -457,10 +465,17 @@ namespace MK.Toon
material.SetShaderPassEnabled("ShadowCaster", false);
break;
}
#if UNITY_6000_7_OR_NEWER
material.SetInt(uniform.id, (int)surface);
#endif
Properties.blend.SetValue(material, Properties.blend.GetValue(material));
Properties.renderPriority.SetValue(material, Properties.renderPriority.GetValue(material), Properties.alphaClipping.GetValue(material));
material.SetInt(uniform.id, (int)surface);
SetKeyword(material,(int) surface != 0, (int) surface);
#if UNITY_6000_7_OR_NEWER
if(material.HasProperty(Uniforms.screenSpaceReflectionsContributeTransparent.id))
Properties.screenSpaceReflectionsContributeTransparent.SetValue(material, Properties.screenSpaceReflectionsContributeTransparent.GetValue(material));
#endif
if(material.shader.name.Contains("URP"))
material.SetShaderPassEnabled("DepthOnly", Properties.zWrite.GetValue(material) == ZWrite.On ? true : false);
@@ -483,7 +498,11 @@ namespace MK.Toon
/// <param uniform="blend"></param>
public override void SetValue(Material material, Blend blend)
{
#if UNITY_6000_7_OR_NEWER
if(blend != Blend.Custom)
#else
if(Properties.blend.GetValue(material) != Blend.Custom)
#endif
{
Properties.zTest.SetValue(material, ZTest.LessEqual);
if(Properties.surface.GetValue(material) == Surface.Opaque)