Пример #1
0
        // Called when the mouse begins hovering an editable object.
        public override void OnBrushEnter(z_EditableObject target, z_BrushSettings settings)
        {
            base.OnBrushEnter(target, settings);

            if (target.editMesh == null)
            {
                return;
            }

            likelySupportsTextureBlending = CheckForTextureBlendSupport(target.gameObject);

            if (likelySupportsTextureBlending && (brushColor == null || !brushColor.MatchesAttributes(meshAttributes)))
            {
                brushColor = new z_SplatWeight(z_SplatWeight.GetChannelMap(meshAttributes));
                SetBrushColorWithAttributeIndex(z_Math.Clamp(selectedAttributeIndex, 0, meshAttributes.Length - 1));
            }

            RebuildCaches(target.editMesh, settings.strength);
            RebuildColorTargets(brushColor, settings.strength);
        }