Remembering Previously Loaded Scenes "Doors"

Hey, I am making a game just to try out some mechanics i might use in a later game. It uses Randomly selected scenes from a list, to simulate a random world. You leave out of a door, it loads a random scene, etc. The problem with this is i have no idea how to make it so that if you want to go backwards into the door, it will load the scene you were already in, instead of a random one. I have no idea where to start, but i was thinking playerprefs? Hopelessly Lost, been searching for hours for a solution that might not exist. Then again, I am a novice Csharp-ist.

Any help would be greatly appreciated.


Create an empty GameObject with this code:

String[] DoorTarget= new String[#Doors];

void Start(){

public void DoorCollision(int DoorId){ =DoorId

Every door has an Id and every id is linkt to an target you call this function with an Id, I think this would work but I didn’t test it so…