본문 바로가기
728x90

Unity44

Unity & C# ~ text를 수정했을 때, ContentSizeFitter가 사이즈 조정을 안 했을 때 tmp_text나 text ui 등을 수정했을 때, 자기 자신의 component 이외에 상위 부모 component에 추가한 contentsizefitter에 의해서 transform size가 새로고침이 되지 않는 현상이 있습니다. 다른 블러거 분들이나 forum에서는 이를 contentsizefitter 버그가 아닌가로 보고 있는 듯 하고, contentsizefitter를 refresh 해주면 현상이 해결되는 것을 확인했습니다. 저의 경우는 상위 부모 2계층에 contentsizefitter가 자식까지 총 3개가 연이어 들어간 구조였기에 다음과 같은 코드를 적용했습니다. - 구조 부모1-component에 contentsizefitter add ㄴ부모2-component에 contentsizefi.. 2022. 11. 7.
Unity & C# ~ 문자열에서 여러 요소 바꾸기 String.Replace("&", "and").Replace(",", "").Replace(" ", " ") .Replace(" ", "-").Replace("'", "").Replace(".", "") .Replace("eacute;", "é").ToLower(); // 다른 방식으로 변환 StringBuilder sb = new StringBuilder(string); sb.Replace(",", ""); sb.Replace(" ", ""); sb.Replace("'", ""); sb.Replace(".", ""); var text = sb.ToString(); Debug.Log(text); 2022. 10. 24.
Unity & C# ~ 문자열에서 단어 검색 방법 string factMessage = "Extension methods have all the capabilities of regular static methods."; // Write the string and include the quotation marks. Console.WriteLine($"\"{factMessage}\""); // Simple comparisons are always case sensitive! // 문자열에 검색할 단어가 있는지 확인 bool containsSearchResult = factMessage.Contains("extension"); Console.WriteLine($"Contains \"extension\"? {containsSearchResult}"); // F.. 2022. 10. 24.
Tmpro Font Creator Unicode Range 최초 작성일 : 2022.10.21 최종 수정일 : 2022.10.21 Text Mesh Pro에서 Font를 만들 때 사용하는 유니코드 범위 한국어 한글 범위 : 44032-55203 한글 자모(자음) : 1100-1112 한글 자모(모음) : 1161-1175 한글 자모(자음 클러스터 있음) : 11A8-11C2 한글 음절 : AC00-D7AF 일본어 히라가나 : 3041-3096 카타카나 : 30A1-30FA 한자 : 3400-4DB5, 4E00-9FCB, F900-FA6A 중국어 CJK 통합 : 4E00-9FFF 영어 영어 대문자 : 0041-005A 영어 소문자 : 0061-007A 영어 전체 : 32-126 기타 특수문자 : 8200 - 9900 로마자 : FF00-FFEF -참조 https:.. 2022. 10. 21.
Unity Tool ~ Json parse 및 직렬화에 도움을 주는 툴 https://github.com/jsonfx/jsonfx GitHub - jsonfx/jsonfx: JsonFx v2.0 - JSON serialization framework for .NET JsonFx v2.0 - JSON serialization framework for .NET - GitHub - jsonfx/jsonfx: JsonFx v2.0 - JSON serialization framework for .NET github.com jsonfx는 c#에서 json의 직렬화에 도움을 주는 툴입니다. Unity Assets - Plugins 폴더에 JsonFx.json 파일을 넣어 사용하면 됩니다. 해당 git 페이지에는 사용법이 잘 소개되어 있으니 따라하기 편합니다. 2022. 10. 14.
Unity & C# ~ 두 오브젝트의 색상과 이미지가 중복되지 않는 랜덤 출력 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestRandomObjectsColor : MonoBehaviour { [SerializeField] List RanColors; // 사용될 색상 [SerializeField] List RanObjects; // 1번 이미지에 사용될 이미지들 [SerializeField] List RanObjects1; // 2번 이미지에 사용될 이미지들 private Coroutine RanCoroutine = null; private int ColorValue { get; set; } // 1번 이미지 색상 값 .. 2022. 10. 7.
SMALL