示例#1
0
    void ReadQuizFiletype()
    {
        //초기화
        spawnList.Clear();
        spawnIndex = 0;
        spawnEnd   = false;
        //텍스트파일 읽기
        TextAsset    text1 = Resources.Load("source") as TextAsset;
        StringReader str   = new StringReader(text1.text);

        while (str != null)
        {
            //텍스트파일 읽기2
            line = str.ReadLine();
            if (line == null)
            {
                break;
            }

            //읽은 값 리스트에 넣기
            QuizFiletype quizData = new QuizFiletype
            {
                zungguo = line.Split('/')[0],
                //Debug.Log(quizData.zungguo);
                sungjo  = int.Parse(line.Split('/')[1]),
                meaning = line.Split('/')[2]
            };

            spawnList.Add(quizData);
        }
        //파일 닫기
        str.Close();
        //res = spawnList[0].sungjo;
        //1번 스폰 딜레이 적용
    }
示例#2
0
    public void ReadQuizFiletype()
    {
        //초기화
        spawnList.Clear();
        spawnIndex = 0;
        spawnEnd   = false;
        //텍스트파일 읽기
        TextAsset    text1 = Resources.Load("resource") as TextAsset; // txt파일 든 폴더이름을 Resources로 바꿔야함
        StringReader str   = new StringReader(text1.text);

        while (str != null)
        {
            //텍스트파일 읽기2
            line = str.ReadLine();
            if (line == null)
            {
                break;
            }

            //읽은 값 리스트에 넣기
            QuizFiletype quizData = new QuizFiletype
            {
                word    = line.Split('/')[0],
                meaning = line.Split('/')[1]
            };

            spawnList.Add(quizData);
        }
        //파일 닫기
        str.Close();
        //res = spawnList[0].sungjo;
        //1번 스폰 딜레이 적용
    }