분류 전체보기 504

[Unity] LINE CHART 그래프 만들기 (2) 그래프에 라벨 숫자 넣기

숫자 표시하기 UI작업 GraphContainer에 x좌표와 y좌표의 값을 나타낼 때 사용할 Text박스를 만든다. (TMP로 만듦 상관없음.) 만들어 놓은 labelTemplateX, labelTemplateY는 상단 체크박스를 통해 active false로 만들어 준다. 소스코드 using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class UI_WindowGraph : MonoBehaviour { [SerializeField] private Sprite circleSprite; private RectTransform graphContainer; private RectTransform..

Unity 2023.11.20

[Unity] LINE CHART 그래프 만들기 (1)

UI작업 1. LineChart를 담을 가장 부모 오브젝트를 만든다. 먼저 LineChar트를 담을 빈 오브젝트를 캔버스에 추가한다. 사이즈는 자유롭게 정의 하며 앵커는 중앙값으로 놓는다. 2. LineChart의 배경과 라인과 점이 그려질 Container 오브젝트를 만든다. 사이즈는 부모오브젝트를 벗어나지 않는 선에서 만들며 가장 왼쪽에서부터 그래프가 그려져 야하기 때문에 가장 오른쪽 밑으로 앵커속성을 놓는다.(중요) 3. Graph container에 Image를 넣어 백그라운드를 채워 넣는다. 4. 차트를 그려줄 Script를 만든다. UI_LineChart.cs작업 1. 점찍기(1) Sprite는 SerializeField로 만들었기 때문에 에디터에서 적당한 Sprite 모양을 연결시켜 줘야 한..

Unity 2023.11.20

[C#] Google Protobuf형식 기반 ProtoBuff-net 사용 방법

Protobuf 참고 사이트 및 공식 https://github.com/protobuf-net/protobuf-net GitHub - protobuf-net/protobuf-net: Protocol Buffers library for idiomatic .NET Protocol Buffers library for idiomatic .NET . Contribute to protobuf-net/protobuf-net development by creating an account on GitHub. github.com https://dotnetcoretutorials.com/protobuf-in-c-net-part-1-getting-started/#google_vignette Protobuf In C# .NET..

VisualStudio/C# 2023.11.02

[Unity] UI 마우스 Drag로 UI 이동 방법

Panel클릭시 UI Drag 소개합니다. 우선 아래와 같이 패널하나를 추가합니다. 만들어둔 Panel안에 컴포넌트로 cs파일을 추가합니다. 저는 cs 파일이름을 UI_DragPanel로 정의 했습니다. UI_DragPanel.cs 정의 1. IBeginDragHandler, IDragHandler을 사용하여 구현 방법 IBeginDragHandler - UI 요소, 예를 들어 버튼이나 이미지와 같은 UI 구성 요소나 객체와 상호 작용할 때 드래그 작업이 시작되었을 때를 감지하고 응답하는 데 사용됩니다. IDragHandler - IDragHandler는 UI 요소의 드래그 작업 중에 이벤트를 감지하고 응답하기 위한 인터페이스입니다. 드래그 작업 중에 UI 요소가 이동하거나 다른 동작을 수행하는 등의 상..

Unity 2023.10.27

[Git] 깃 데스크탑(GitDaskTop) 사용방법

저장소 만들기 File -> new repository 클릭 Create a new Repository Name - 저장소 이름(추 후 변경 가능) Description - 저장소 설명(추 후 변경 가능) Local path - 로컬 저장소 위치 Initialize this repository with a README - Readme 설명 파일 생성 유무 Git ignore - 사용 하는 프로그래밍 언어 설정 C#은 따로없기 때문에 VisualStudio 선택 License - 저작권 설정 생성된 저장소 Publish repository - github 사이트에 연결 생성된 저장소 안에 파일 Publish repository 클릭 후 Desktop 화면 Keep this code private - 소스코..

형상관리/Git 2023.10.27

[C#] List<T> LINQ 모음

1. Take List에서 index 0부터 원하는 count만큼 객체를 반환한다 이때 ListCount보다 찾고자 하는 Count가 클 경우 오류가 발생하지 않고 List가 반환된다. 아래 예제는 0번인덱스 부터 0~1 2개의 객체를 반환하라는 뜻이다. static void Main(string[] args) { List testList = new List() { 1,2,3,4,5 }; List taskList = testList.Take(2).ToList(); foreach (var item in taskList) Console.WriteLine(item); } 2. Skip List에서 원하는 index부터 끝까지 객체를 반환한다. 아래 예제는 3번 index 부터 나머지 모든 객체를 반환한다. s..

VisualStudio/C# 2023.09.21

[프로그래머스]Lv1 성격 유형 검사하기 C++ (map)

https://school.programmers.co.kr/learn/courses/30/lessons/118666?language=cpp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 map은 c#과 다르게 자동정렬됨 초기화안해도 바로 insert됨 #include #include #include using namespace std; string solution(vector survey, vector choices) { string answer = ""; map m; for (int i = 0; i < choices.size(); i++) { ..

[프로그래머스]Lv1 숫자 짝꿍C++ (char 숫자 int로 변경)

https://school.programmers.co.kr/learn/courses/30/lessons/131128?language=cpp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 int temp = X[i] - '0'; Char값을 그대로 int형으로 변경가능 #include #include using namespace std; string solution(string X, string Y) { string answer = ""; int xArray[10] = {0}; int yArray[10]= { 0 }; for (int i = 0; ..