반응형
- 코드 작성
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;
}
}
반응형
'개발 > C#' 카테고리의 다른 글
유니티 C# 삼항 연산자 간단 구현 - Ternary operator (0) | 2023.02.18 |
---|---|
유니티 C# SerializeField 간단 사용법 (0) | 2023.02.18 |
유니티 C# 반올림, 올림, 내림, 소수점 2자리 버리기 간단 구현 (0) | 2023.02.18 |
유니티 C# RectTransform width height 간단 수정법 (0) | 2023.02.17 |
유니티 C# 자료구조 스택 Stack 간단 사용법 (0) | 2023.01.29 |
유니티 C# 자료구조 리스트 List 간단 사용법 (0) | 2023.01.29 |
유니티 C# 자료구조 큐 Queue 간단 사용법 (0) | 2023.01.29 |
유니티 C# 플레이어 추적하는 Monster AI 간단 구현 (0) | 2023.01.29 |
댓글