목록C# (36)
유니티3D 프로그래밍

쿠키런 파일 불러오기 using System; using System.IO; using Newtonsoft.Json; using System.Collections.Generic; using System.Linq; namespace Study01 { public class App { public App() { Console.WriteLine("App"); string txt1 = File.ReadAllText("./cookierun.json"); Console.WriteLine(txt1); //역직렬화 CookieRun[] cookieRuns = JsonConvert.DeserializeObject(txt1); Dictionary dicCookieRunData; dicCookieRunData = cooki..
1. 엑셀 파일에서 자료를 만든다. 만든 엑셀 파일은 제대로된 이름으로 저장한다. 2. shancarter.github.io/mr-data-converter/에서 엑셀 파일에 만든 자료를 복사 붙여넣기 한 뒤 필요 없는 자료형은 삭제한다. 3. json 형태로 변환된 값을 jsonviewer.stack.hu/에 넣은 뒤 상단의 format을 누른다. 4. Viewer로 잘 처리 됬는지 확인 후 format된 내용을 메모장에 복사 붙여넣기 한다. 5. 메모장을 저장할 때 엑셀 파일과 같은 이름으로 저장하고 제목 뒤에 .json을 붙이고 UTF-8로 저장한다. 6. Visual studio에서 파일을 불러온다. 도구 -> Nuget 패키지 관리자 -> 솔루션용 패키지 관리 -> 찾아보기 -> json 검색 ..

대리자, 람다, 이벤트, LinQ 복습 using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; namespace Study01 { public delegate void GoHome(); public delegate void Say(string message); class CarDriver { public static void GoLeft() { Console.WriteLine("좌회전"); } public static void GoRight() { Console.WriteLine("우회전"); } public static void GoForward() ..

LINQ 및 람다 using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace Study01 { public class App { //생성자 public App() { Console.WriteLine("App"); //컬렉션 생성 List items = new List(); //Item 객체 생성 Item item1 = new Item("장검"); Item item2 = new Item("단검"); Item item3 = new Item("활"); Item item4 = new Item("장검"); //컬렉션 추가 items.Add(item1); items.Add(item2); it..

로켓 발사 using System; using System.Collections; using System.Collections.Generic; namespace Study01 { public class App { //생성자 public App() { Rocket rocket = new Rocket(); rocket.onRocket = this.RocketLauncher; rocket.RocketIngition(); } public void RocketLauncher() { Console.WriteLine("로켓이 발사되었습니다."); } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; usin..

Delegate using System; using System.Collections; using System.Collections.Generic; namespace Study01 { public class App { //1. 델리게이트 선언 public delegate void Del(string massage); //생성자 public App() { //3. 델리게이트 인스턴스화 (델리게이트에 메서드 연결) Del handler = this.DeligateMethod; //4. 델리게이트 호출 //handler("Hello World!"); MathodWithCallback(handler); } //2. 델리게이트 메서드 정의 public void DeligateMethod(string massage..

2차원 배열 연습 using System; using System.Collections; using System.Collections.Generic; namespace Study01 { public struct Indexes { public int rowIndex; public int colIndex; public Indexes(int rowIndex, int colIndex) { this.rowIndex = rowIndex; this.colIndex = colIndex; } } class App { private int[,] arr; private int row; private int col; //생성자 public App() { Console.WriteLine("App"); //int형 2차원 배열 ..

stack 복습 using System; using System.Collections; using System.Collections.Generic; namespace Study01 { class App { //생성자 public App() { Console.WriteLine("App"); //Stack 변수 선언과 인스턴스 생성 및 초기화 Stack names = new Stack(); //요소 추가 names.Push("질롯"); names.Push("템플러"); names.Push("드라군"); names.Push("다크템플러"); //foreach문을 사용해 요소 출력 foreach(string name in names) { Console.WriteLine(name); } //Pop string p..