Documentation

Unity Engine

Download Unity

Unity Engine

warnAboutOutOfDateShaders

Whether Unity logs a warning when it loads a SubShader built with a different major or minor Unity version.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public static bool warnAboutOutOfDateShaders { get; set; }

Remarks

Set this property to
true
to display a warning in the Console when Unity loads a
SubShader
built with a different Unity version. An out-of-date
SubShaders
can render incorrectly or lead to reduced performance. To fix the warning, rebuild the AssetBundle or content directory that contains the shader.
Unity checks each
SubShader
in a shader separately. Unity compares only the major and minor parts of the version, and ignores the patch version. For example, for a
SubShader
built with Unity 7000.1.2f1:
  • Unity 7000.1.5f1 doesn't display a warning when it loads the
    SubShader
    , because only the patch version differs.
  • Unity 7000.2.0f1 displays a warning when it loads the
    SubShader
    , because the minor version differs.
Unity skips the check if any of the following is true:
  • The AssetBundle or a content directory containing a shader was built while this property was set to
    false
    .
  • The Player that loads the content was built with this setting set to
    false
    .
  • The Editor that loads the content has this property set to
    false
    .
If the AssetBundle or content directory was built with a Unity version earlier than 7.0, Unity skips the
SubShader
and displays an error. Unity does this even if this property is false.