UnityEditor.ShaderUtil.ApplyProperty C# (CSharp) Method

ApplyProperty() private method

private ApplyProperty ( MaterialProperty prop, int propertyMask, string undoName ) : void
prop MaterialProperty
propertyMask int
undoName string
return void
        internal static extern void ApplyProperty(MaterialProperty prop, int propertyMask, string undoName);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

        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);
            }
        }
All Usage Examples Of UnityEditor.ShaderUtil::ApplyProperty