Jumping between Map and battle scene

I am making a turn based strategy game, where most game play takes place in the normal map scene, but when a players army collides with an enemy it will switch to an entirely new scene for battle. Such as in the total war series or heroes of might and magic etc. Is there a way to load a new scene while not losing any data from the current one? so that after the battle the map can be retrieved just as it was before the battle?

I have seen some suggestions of using an empty game object in the scene to put all the battle scene stuff in and move the camera to that when entering a battle, then destroy the gameobject after the battle… but this seems really clunky and not optimal at all.

You can make a script accessible from others scene with an access key. (C# code example)

public class YourScript : MonoBehaviour {
	
	public static YourScript access;

        //Set the access key
        void Start () {
	    access = (access == null) ? this : access;
	}

}

Then just attach this script to a object in the both scenes then you can access public variables.

To use simple do this:
//To get a public variable
string newString = YourScript.access.yourVariable;

//To use a function / void ( Need to be public on the script )
YourScript.access.yourFunction();

I solved this by having parent objects as the “scenes”, moving any required objects into the appropriate scene, deactivating the current scene and activating the new one.