반응형
- 코드 작성
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Notepad : MonoBehaviour
{
public InputField inputField;
public Text outputText;
private List<string> notes = new List<string>();
public void AddNote()
{
string input = inputField.text;
notes.Add(input);
inputField.text = "";
UpdateNotes();
}
public void UpdateNotes()
{
string output = "";
foreach (string note in notes)
{
output += note + "\n";
}
outputText.text = output;
}
}
반응형