/// <summary> /// Load level from bytes (TextAsset bytes) /// </summary> public List <Board> LoadBoardsFromBytes(byte[] filebytes) { LevelFileIO lfio = gameObject.GetComponent <LevelFileIO>(); if (lfio == null) { Debug.LogError("You will need a fileIO to load a file"); return(null); } return(lfio.loadLevel(filebytes)); }
// Update is called once per frame void Update() { if (checkThisToCreateFile) { checkThisToCreateFile = false; if (filename.Length == 0) { Debug.LogError("You might wanna name your level"); return; } LevelFileIO io = GetComponent <LevelFileIO>(); if (io != null) { Debug.Log("Creating level template"); string fn = filePath + filename + fileExt; Debug.Log("file is " + fn); io.createNewTemplate(fn); Debug.Log("finished writing file (may take a second to appear)"); } } }