UnityEditor.MaterialEditor.PrepareMaterialPropertiesForAnimationMode C# (CSharp) Méthode

PrepareMaterialPropertiesForAnimationMode() public static méthode

public static PrepareMaterialPropertiesForAnimationMode ( MaterialProperty properties, bool isMaterialEditable ) : Renderer
properties MaterialProperty
isMaterialEditable bool
Résultat UnityEngine.Renderer
        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;
        }
MaterialEditor