public static Renderer PrepareMaterialPropertiesForAnimationMode(MaterialProperty[] properties, bool isMaterialEditable)
{
bool flag = AnimationMode.InAnimationMode();
Renderer associatedRenderFromInspector = GetAssociatedRenderFromInspector();
if (associatedRenderFromInspector != null)
{
ForwardApplyMaterialModification modification = new ForwardApplyMaterialModification(associatedRenderFromInspector, isMaterialEditable);
MaterialPropertyBlock dest = new MaterialPropertyBlock();
associatedRenderFromInspector.GetPropertyBlock(dest);
foreach (MaterialProperty property in properties)
{
property.ReadFromMaterialPropertyBlock(dest);
if (flag)
{
property.applyPropertyCallback = new MaterialProperty.ApplyPropertyCallback(modification.DidModifyAnimationModeMaterialProperty);
}
}
}
if (flag)
{
return associatedRenderFromInspector;
}
return null;
}