// wrap/filter/aniso editors will change serialized object
// but in case of textures we need an extra step to ApplySettings (so rendering uses new values)
// alas we cant have good things: it will be PITA to make sure we always call that after applying changes to serialized object
// meaning that we need to work without relying on it, hence we do similar to TextureImporter:
// use TextureUtil methods to update texture settings from current values of serialized property
// another possibility would be to do it separately for wrap/filter/aniso
// alas for wrapmode i dont see how it can be done clearly and leaving it out seems a bit weird
protected void ApplySettingsToTextures()
{
bool anisoDiffer = m_Aniso.hasMultipleDifferentValues, filterDiffer = m_FilterMode.hasMultipleDifferentValues;
bool wrapDiffer = m_WrapU.hasMultipleDifferentValues || m_WrapV.hasMultipleDifferentValues || m_WrapW.hasMultipleDifferentValues;
foreach (Texture tex in targets)
{
if (!anisoDiffer)
{
TextureUtil.SetAnisoLevelNoDirty(tex, m_Aniso.intValue);
}
if (!filterDiffer)
{
TextureUtil.SetFilterModeNoDirty(tex, (FilterMode)m_FilterMode.intValue);
}
if (!wrapDiffer)
{
TextureUtil.SetWrapModeNoDirty(tex, (TextureWrapMode)m_WrapU.intValue, (TextureWrapMode)m_WrapV.intValue, (TextureWrapMode)m_WrapW.intValue);
}
}
}