Code: Select all
public Unit unit = null;
Code: Select all
public class Room {
[HideInInspector][ES3Serializable]
public Unit joinUnit;
}
Code: Select all
void Save(){
Unit unit = new Unit();
room.joinUnit = unit;
ES3.Save("unit", unit, file_name);
ES3.Save("room", room, file_name);
}
void Load(){
unit = ES3.Load("unit");
room = ES3.Load("room");
Debug.Log(room.joinUnit, unit));
Debug.Log(ReferenceEquals(room.joinUnit, unit));
Debug.Log(Equals(room.joinUnit, unit));
}
For example, if I set the name of string to unit, the name of the unit and the name of the unit in the room match.
Therefore, the save and load appears to be somewhat normal...
However, because the clusters do not match, the unit cannot find the room it belonged to.
How can I fix this problem?