public void Paint(GTexturePainterArgs args)
        {
            IGTexturePainter p = ActivePainter;

            if (p == null)
            {
                return;
            }

            FillArgs(ref args);

#if UNITY_EDITOR
            if (args.MouseEventType == GPainterMouseEventType.Down)
            {
                Editor_CreateInitialHistoryEntry(args);
            }
#endif

            IEnumerator <GStylizedTerrain> terrains = GStylizedTerrain.ActiveTerrains.GetEnumerator();
            while (terrains.MoveNext())
            {
                if (terrains.Current.GroupId != GroupId && GroupId >= 0)
                {
                    continue;
                }
                p.Paint(terrains.Current, args);
            }

#if UNITY_EDITOR
            if (args.MouseEventType == GPainterMouseEventType.Up)
            {
                Editor_CreateHistory(args);
            }
#endif
        }
        public void Paint(GTexturePainterArgs args)
        {
            IGTexturePainter p = ActivePainter;

            if (p == null)
            {
                return;
            }

            FillArgs(ref args);

#if UNITY_EDITOR
            List <GStylizedTerrain> overlappedTerrain = GPaintToolUtilities.CheckBrushOverlap(groupId, args.WorldPointCorners);
            if (args.MouseEventType == GPainterMouseEventType.Down ||
                args.MouseEventType == GPainterMouseEventType.Drag)
            {
                Editor_CreateInitialHistoryEntry(args, overlappedTerrain);
            }
#endif

            IEnumerator <GStylizedTerrain> terrains = GStylizedTerrain.ActiveTerrains.GetEnumerator();
            while (terrains.MoveNext())
            {
                if (terrains.Current.GroupId != GroupId && GroupId >= 0)
                {
                    continue;
                }
                p.Paint(terrains.Current, args);
            }

#if UNITY_EDITOR
            EditedTerrains.UnionWith(overlappedTerrain);
            if (args.MouseEventType == GPainterMouseEventType.Up)
            {
                Editor_CreateHistory(args);
                currentInitialBackupName = null;
                InitialRecordedTerrains.Clear();
                EditedTerrains.Clear();
            }
#endif
        }