Beispiel #1
0
    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);
		}
	}
Beispiel #3
0
 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();
    }
Beispiel #5
0
    void Start()
    {
        player = GameObject.Find(_PLAYER_DATA).GetComponent <_PlayerData>();

        Init();
    }