시험을 마치고 이어서 개인개발에 힘쓰자....
https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347
JSON .NET For Unity | 입출력 관리 | Unity Asset Store
Get the JSON .NET For Unity package from parentElement, LLC and speed up your game development process. Find this & other 입출력 관리 options on the Unity Asset Store.
assetstore.unity.com
https://shancarter.github.io/mr-data-converter/
Mr. Data Converter
shancarter.github.io
Online JSON Viewer
jsonviewer.stack.hu
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.202-windows-x64-installer
Download .NET 6.0 SDK (v6.0.202) - Windows x64 Installer
dotnet.microsoft.com
대사를 엑셀파일로 작성 -> convert -> format -> 텍스트에서 json으로 저장
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
public class QuoteData
{
public int id;
public string text;
public QuoteData(int id, string text)
{
this.id = id;
this.text = text;
}
}
public class QuotesManager : MonoBehaviour
{
//[SerializeField] private TextMesh
private Dictionary<int, string> mDictionary;
private void Awake()
{
mDictionary = new Dictionary<int, string>();
var jsonData = Resources.Load("Data/quotes") as TextAsset;
var jList = JsonConvert.DeserializeObject<List<QuoteData>>(jsonData.text);
foreach(var output in jList)
{
this.mDictionary.Add(output.id, output.text);
}
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public string GetQuote(int quotesID)
{
//딕셔너리에서 가져올 문자열을 담는곳
string tempQuote;
//id로부터 tempQuote에 텍스트를 대치한다
mDictionary.TryGetValue(quotesID, out tempQuote);
//리턴
return tempQuote;
}
public void DisplayQuote(int target, int quoteID, float duration)
{
}
}
TextMeshPro를 사용하기위해 사용폰트 제작
https://m.blog.naver.com/cdw0424/221641217203
유니티(Unity) - Textmesh Pro(텍스트 메쉬 프로) 한글 사용법
<2020-03-03 수정됨> - 본문 맨 아래 간단하고 쉬운 폰트 생성 법에 대한 내용이 추가되었습니다 - (...
blog.naver.com
★ 필요지식
1. JSON 파싱
2. TMP
3. 기타 알고리즘
4. 그룹레이아웃(말풍선크기)
JSON에서 데이터 가져오기 -> 각 딕셔너리로 분할 -> 텍스트 받아오기 -> delayTime만큼 큐로 가져오기
-> 시간지나면 alpha값으로 fadeout 효과주기
'unity etc. > others' 카테고리의 다른 글
유니티 UI(Button)과 RayCast가 동시에 일어나는 문제 해결 (0) | 2022.08.17 |
---|---|
유니티 벡터 연산의 이해 (0) | 2022.08.10 |
유니티 WebGL 로드 화면 바꾸기 (0) | 2022.08.05 |
유니티 WebGL 빌드 용량 최적화를 위한 로그 확인 (0) | 2022.07.31 |
유니티 WebGL 빌드 로컬에서 실행하기 / Apache 구축 (0) | 2022.07.29 |