- Home /
(Solved)StreamWriter Write line
EDIT: Solved
Final Code
import System.IO; var numberOfLines : int;
//We want to write out a template first function Start(){ //How many triggers are there that need its own line? var TriggerCounter = GameObject.Find("TRIGGERGENERATOR").GetComponent(InstantPrefab).gridY; numberOfLines = TriggerCounter; } function Update(){ //To create the template if(Input.GetKeyDown(KeyCode.I)){ WriteTemplate(); } } //here we write the template //The template should look someting like this... //1 0 0 0 0 0 //2 0 0 0 0 0 //3 0 0 0 0 0 //4 0 0 0 0 0 //5 0 0 0 0 0 //** //The numbers to the far left is the number of the line //the other numbers represent where the enemy will spawn //1 = one enemy //2 = some other enemy //3 = maybe a boss or something //4 = items... etc function WriteTemplate(){ var sw : StreamWriter = new StreamWriter("STG.txt"); for(var i = 0; i
Your answer
Follow this Question
Related Questions
PlayerPrefs.GetString returns wrong value 3 Answers
How to write/read .txt on FTP (Javascript) 3 Answers
Reading files in Unity from different platform 2 Answers
Using System.IO for Diary? 0 Answers
Can Unity use .ini files? 1 Answer