[EDIT]
The easiest way to perform this is to use a static variable. A static variable will be global to your whole project and not your current scene. The solution you are looking for is very easy to implement, but there are several things to do.
First : the MainHall scene. You have 3D paintings in it, these 3D paintings are gameobject put in your scene. Into these gameobject, put a child gameObject called “Spawn”, and place the “Spawn” at the position and rotation you want for this specific painting. Then, you should have a script like this on your painting object :
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
// Represents the painting
public class PaintingSelector : MonoBehaviour
{
// This is the Spawn object inside the painting object
public Transform spawn;
void Start()
{
// At start, set the spawn transform by looking in painting's children
spawn = transform.FindChild ("Spawn");
}
void OnMouseDown()
{
// When you select the painting, set the statics then load the next scene
Statics.firstPlayerPosition = spawn.position;
Statics.firstPlayerRotation = spawn.eulerAngles;
SceneManager.LoadScene ("PaintingScene");
}
}
Now, your Statics file. It constains the position and rotation you want to keep between the two scenes:
using UnityEngine;
using System.Collections;
public class Statics
{
// This is used for the very first time you enter the MainHall, there is no seen painting at this moment
public static bool firstTimeInHallPassed = false;
// Position and rotation of the player next time you enter the MainHall
public static Vector3 firstPlayerPosition = Vector3.zero;
public static Vector3 firstPlayerRotation = Vector3.zero;
}
And now, the player. When the scene MainHall starts, you want to put the player at the position defined by your Statics, but only if you are coming from a PaintingScene, not the first time you play the game :
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour
{
void Start ()
{
if (Statics.firstTimeInHallPassed)
{
transform.position = Statics.firstPlayerPosition;
transform.eulerAngles = Statics.firstPlayerRotation;
}
else
{
Statics.firstTimeInHallPassed = true;
}
}
}
As your problem is like making a complete project with several scripts involed, I made a little Unity project to be sure that my solution is working. So I can tell you : it’s working.
So if you have a problem and it’s not working for you, it means that you have done a little mistake somewhere and I can help you to find it.