public void Load(int playerIdentity) //Om aan te roepen: SaveLoadController.control.Load(); { if (File.Exists(Application.persistentDataPath + "/" + playerIdentity + ".dat")) { loadGame loadGame = new loadGame(); BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/" + playerIdentity + ".dat", FileMode.Open); PlayerData data = (PlayerData)bf.Deserialize(file); file.Close(); this.playerName = data.playerName; this.playerIdentity = data.playerIdentity; loadGame.LoadGame(playerIdentity); } else { this.playerName = ""; Application.LoadLevel("CreatePlayer"); } }
void OnMouseDown() { loadGame map = myMainGame.GetComponent <loadGame>(); map.searchRow(cx, cy); }