private void ApplyProperty(object previousValue, int changedPropertyMask)
{
if (targets == null || targets.Length == 0)
{
throw new ArgumentException("No material targets provided");
}
Object[] mats = targets;
string targetTitle;
if (mats.Length == 1)
{
targetTitle = mats[0].name;
}
else
{
targetTitle = mats.Length + " " + ObjectNames.NicifyVariableName(ObjectNames.GetClassName(mats[0])) + "s";
}
//@TODO: Maybe all this logic should be moved to C++
// reduces api surface...
bool didApply = false;
if (m_ApplyPropertyCallback != null)
{
didApply = m_ApplyPropertyCallback(this, changedPropertyMask, previousValue);
}
if (!didApply)
{
ShaderUtil.ApplyProperty(this, changedPropertyMask, "Modify " + displayName + " of " + targetTitle);
}
}