분류 전체보기 172

유니티 튜토리얼 - TANKS! - 1

2016. 3. 8. 19:16 https://blog.naver.com/nagne2011/220649312535 유니티 공식홈페이지에서 제공하는 중급 튜토리얼 TANK!를 만들기로 합니다. (https://unity3d.com/kr/learn/tutorials/projects/tanks-tutorial) 우선 에셋을 다운로드 (https://www.assetstore.unity3d.com/en/#!/content/46209/) 오늘의 목표는, 1. 탱크 이동 2. 대포 발사 먼저 맵에 필드와 탱크를 띄워준다 간단하게 드래그앤드롭 대략 이렇게. 그리고 Asset폴더 내에 'shell' 모델을 가져온뒤 Capsule Collider와 Rigidbody를 붙여준다 충돌처리를 위한 Capsule Collide..

유니티 2022.02.13

유니티 Ray

2016. 3. 7. 18:54 https://blog.naver.com/nagne2011/220648267712 void Awake(){ Debug.Log ("Awake"); //객체 생성시 바로 실행 } void OnEnable(){ Debug.Log ("onEnable"); //객체가 활성화 되면 실행 } void Start (){ Debug.Log ("start"); //스크립트가 시작될때 실행 } 위의 순서대로 출력된다. void OnDrawGizmos() { Gizmos.color = Color.red; //이하 모든 gizmos는 red로 색칠됨 //선그리기 Gizmos.DrawLine (ray.origin, ray.origin + ray.direction * distance); //구 그리..

유니티 2022.02.13

c# 텍스트 저장

2016. 3. 2. 17:25 https://blog.naver.com/nagne2011/220643614050 class SaveText { private string saveData = "1.테스트\n 2.진행중\r\n 3.입니다."; private string[] saveData2 = {"1.테스트\n", "2.진행중\r\n","3.입니다."}; //WriteAllLines전용 배열형식의 string private const string path1 = "./save"; private const string path2 = ".\\save"; private const string path3 = @".\save"; //@가 붙은 string은 폴더 경로로 설정됨 //셋다 같은 의미 //파일 스트림 방식..

개발공부 2022.02.13

c# try-catch

2016. 3. 2. 17:01 https://blog.naver.com/nagne2011/220643586327 class ExceptionText { public int i = 0; } class Program { static void Main(string[] args) { try { ExceptionText t = null; Console.WriteLine("테스트 시트"); Console.WriteLine("ExceptionText: {0}", t.i); //애러 발생시, catch문으로 넘어가줌 } /* catch { Console.WriteLine("null을 참조했다."); //에러 메세지 출력 } */ catch (Exception e) //정식적인 에러 메세지를 위해서, { //e에 무엇..

개발공부 2022.02.13

c# 함수 상속

2016. 2. 26. 17:36 https://blog.naver.com/nagne2011/220639062533 namespace ConsoleApplication4 { //추상 클래스 abstract class Gun { public int damage = 1; public int ammo = 5; //추상함수 , C++에서 virtual 이라고 쓰던것. virtual 선언한 함수는 꼭 사용해야 한다 public abstract void Fire(); //함수에 사용하면, class에도 abstract를 붙여줘야 한다(오류가 뜸) } } namespace ConsoleApplication4 { //추상 클래스 abstract class Gun { public int damage = 1; public..

개발공부 2022.02.13

c# 함수 기초

2016. 2. 25. 18:36 https://blog.naver.com/nagne2011/220638119382 class Program { static void Test1() { Console.WriteLine("hellow"); } /// /// 3줄짜리 주석, 파라미터에 대한 내용을 적을 수 있다 (자동으로 작성된다) /// /// /// static void Test2(int i, int j) { Console.WriteLine("test2 : {0}, {1}", i,j); } /// /// 리턴 타입에 대한 설명도 쓸수있다. /// /// /// static int Test3(int num) { return num + 1; } static void Test4(ref int num) //str..

개발공부 2022.02.13

C# 기초 자료형

2016. 2. 23. 19:04 https://blog.naver.com/nagne2011/220635962629 class Program { static void Main(string[] args) { //Console.Write( ); = 엔터키를 안먹이고 출력 //Console.WriteLine( ); = 엔터키를 먹이고 출력 // =Console.Write(\n); string str = string.Format("{0} {1} {0}", 10,20); Console.WriteLine(str); Console.WriteLine("int {0} byte", sizeof(int)); //int형의 사이즈를 확인가능 Console.WriteLine("{0} ~ {1}", int.MinValue, in..

개발공부 2022.02.13
728x90