Merge locations or areas for single manipulation

It’s not an error, but a question about Unity’s features.

I have purchased an asset which allows me to create a hexagonal map. Each of the tiles can be set to have their own individual textures, I was wondering whether there was a way to unite an amount of area of these tiles and put a single major texture on top of them. I would like to select a certain tile and all the tiles surrounding it and have them share flag of a certain kingdom to specifically designate the territory. I can set textures for all 7 of these tiles individually, but it will result in 7 separate tiles each with tiny flags. The problem is that that change cannot be permanent, territories will be won and lost, so I need ability to reassign or drop the texture on the fly, so I cannot simply merge these objects together**.**
TLDR: How do I temporarily put a texture over multiple GameObject’s areas?

Do you mean make a single texture “projected” onto a bunch of disparate GameObjects? And are the GameObjects actually geometry?

If so, I have an open-source project called “makegeo” that does various procedural geometry stuff, and one of the scripts sets the UV coordinates on a bunch of unrelated GameObjects, setting them to what I consider “useful” related-to-world positions.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

https://github.com/kurtdekker/makegeo

The script you want is called SetUVToWorld.cs. I’ll include it here for fun, but there is a full demo scene that uses it in the above project.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetUVToWorld : MonoBehaviour
{
    // set this if you are putting it on a parent object, otherwise
    // this script operates only on the current GameObject.
    public    bool        DriveToAllChildren;

    public    Material    MaterialToUse;

    public    bool        PreserveColor;

    public    bool        IncludeRotation;

    void Reset()
    {
        IncludeRotation = true;
        MaterialToUse = null;
    }

    public static void AddToAllMeshRenderersWithMeshFilters(
        GameObject go,
        bool _PreserveColor = false,
        Material _MaterialToUse = null)
    {
        MeshRenderer[] rndrrs = go.GetComponentsInChildren<MeshRenderer> ();
        foreach( var mr in rndrrs)
        {
            MeshFilter mf = mr.GetComponent<MeshFilter> ();
            if (mf != null)
            {
                var uvsetter = mr.gameObject.AddComponent<SetUVToWorld> ();
                uvsetter.PreserveColor = _PreserveColor;
                uvsetter.MaterialToUse = _MaterialToUse;
            }
        }
    }

    void Start()
    {
        // be careful: we are intentionally adding instances of this
        // script that don't have the DriveToAllChildren bit set, in
        // order to benefit from setting things once.
        if (DriveToAllChildren)
        {
            AddToAllMeshRenderersWithMeshFilters(
                gameObject, PreserveColor, MaterialToUse);
            return;
        }

        MeshFilter mf = GetComponent<MeshFilter> ();
        if (mf)
        {
            Vector2[] uvs = mf.mesh.uv;
            Vector3[] verts = mf.mesh.vertices;
            int[] tris = mf.mesh.triangles;

            for (int i = 0; i < verts.Length; i++)
            {
                verts [i] = transform.TransformPoint (verts [i]);
                if (!IncludeRotation)
                {
                    verts [i] = Quaternion.Inverse (transform.rotation) * verts [i];
                }
            }

            for ( int i = 0; i < tris.Length; i += 3)
            {
                Vector3 norm = Vector3.Cross (
                    verts [tris [i + 1]] - verts [tris [i + 0]],
                    verts [tris [i + 1]] - verts [tris [i + 2]]).normalized;

                float dotX = Mathf.Abs (Vector3.Dot (norm, Vector3.right));
                float dotY = Mathf.Abs (Vector3.Dot (norm, Vector3.up));
                float dotZ = Mathf.Abs (Vector3.Dot (norm, Vector3.forward));

                if (dotX > dotY && dotX > dotZ)
                {
                    for ( int j = 0; j < 3; j++)
                    {
                        uvs [tris[i + j]] = new Vector2 (verts [tris[i + j]].z, verts [tris[i + j]].y);
                    }
                }
                else
                {
                    if (dotY > dotX && dotY > dotZ)
                    {
                        for ( int j = 0; j < 3; j++)
                        {
                            uvs [tris[i + j]] = new Vector2 (verts [tris[i + j]].x, verts [tris[i + j]].z);
                        }
                    }
                    else
                    {
                        for ( int j = 0; j < 3; j++)
                        {
                            uvs [tris[i + j]] = new Vector2 (verts [tris[i + j]].x, verts [tris[i + j]].y);
                        }
                    }
                }
            }
            mf.mesh.uv = uvs;

            if (MaterialToUse)
            {
                Dictionary<Color, Material> ColorDictToSaveDrawcalls = new Dictionary<Color, Material>();

                Renderer rndrr = GetComponent<Renderer>();
                if (rndrr)
                {
                    Material[] allNewMaterials = new Material[ rndrr.materials.Length];

                    for (int i = 0; i < allNewMaterials.Length; i++)
                    {
                        Color preservedColor = Color.white;

                        Material originalMaterial = rndrr.materials[i];

                        var instancedMaterial = MaterialToUse;

                        if (originalMaterial)
                        {
                            if (PreserveColor)
                            {
                                preservedColor = originalMaterial.color;

                                if (ColorDictToSaveDrawcalls.ContainsKey( preservedColor))
                                {
                                    instancedMaterial = ColorDictToSaveDrawcalls[preservedColor];
                                }
                                else
                                {
                                    instancedMaterial = new Material( MaterialToUse);
                                    instancedMaterial.color = preservedColor;
                                    ColorDictToSaveDrawcalls[preservedColor] = instancedMaterial;
                                }
                            }
                        }

                        allNewMaterials[i] = instancedMaterial;
                    }

                    rndrr.materials = allNewMaterials;
                }
            }
        }
        else
        {
            Debug.LogError (
                GetType() + ": there is no MeshFilter on GameObject '" + name + "'!");
        }
    }
}