void load() { string path = Application.dataPath + "/Resources/Data/Enemies/"; if (System.IO.File.Exists(path + "Teams.bytes")) { var data = PersistantData.ReadBytesFromFile(path, "Teams.bytes"); _teamList = PersistantData.DeserializeToType <List <EnemyList> >(data); } }
void LoadEnemy(string name) { string path = Application.dataPath + "/Resources/Data/Enemies/"; if (System.IO.File.Exists(path + name + ".bytes")) { var data = PersistantData.ReadBytesFromFile(path, name + ".bytes"); _enemy = PersistantData.DeserializeToType <Character>(data); } }
private void Awake() { TextAsset assest = Resources.Load("Data/Enemies/Teams") as TextAsset; if (assest != null) { EnemyGroups = PersistantData.DeserializeToType <List <EnemyList> >(assest); } else { Debug.LogError("Failed to load enemy teams"); } }
public static Character CreateEnemyInstance(string filename) { Character enemy = new Character(); TextAsset assest = Resources.Load("Data/Enemies/" + filename) as TextAsset; if (assest != null) { enemy = PersistantData.DeserializeToType <Character>(assest); enemy.Alive = true; return(enemy); } Debug.LogError("Failed to load enemy from file with the name of " + filename); return(null); }