public void Load(string path) { var serializer = new XmlSerializer(typeof(_PlayerData)); using (var stream = new FileStream(path, FileMode.Open)) { data = serializer.Deserialize(stream) as _PlayerData; } }
void MakePseudoSingleton() { if (data == null) { DontDestroyOnLoad(gameObject); data = this; } else if (data != this) { Destroy(gameObject); } }
void Start() { player = GameObject.Find(_PLAYER_DATA).GetComponent<_PlayerData>(); Init(); }
void Start() { player = GameObject.Find(_PLAYER_DATA).GetComponent <_PlayerData>(); Init(); }