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); } }
private void ApplyProperty(object previousValue, int changedPropertyMask) { string name; if ((this.targets == null) || (this.targets.Length == 0)) { throw new ArgumentException("No material targets provided"); } Object[] targets = this.targets; if (targets.Length == 1) { name = targets[0].name; } else { object[] objArray1 = new object[] { targets.Length, " ", ObjectNames.NicifyVariableName(ObjectNames.GetClassName(targets[0])), "s" }; name = string.Concat(objArray1); } bool flag = false; if (this.m_ApplyPropertyCallback != null) { flag = this.m_ApplyPropertyCallback(this, changedPropertyMask, previousValue); } if (!flag) { ShaderUtil.ApplyProperty(this, changedPropertyMask, "Modify " + this.displayName + " of " + name); } }
private void ApplyProperty(object previousValue, int changedPropertyMask) { if (this.targets == null || this.targets.Length == 0) { throw new ArgumentException("No material targets provided"); } UnityEngine.Object[] targets = this.targets; string str; if (targets.Length == 1) { str = targets[0].name; } else { str = targets.Length.ToString() + " " + ObjectNames.NicifyVariableName(ObjectNames.GetClassName(targets[0])) + "s"; } bool flag = false; if (this.m_ApplyPropertyCallback != null) { flag = this.m_ApplyPropertyCallback(this, changedPropertyMask, previousValue); } if (flag) { return; } ShaderUtil.ApplyProperty(this, changedPropertyMask, "Modify " + this.displayName + " of " + str); }