전체 글 (129) 썸네일형 리스트형 #03 유니티 InputManager 아래는 인풋매너저를 적용한 코드이다. InputManager.csusing System;using System.Collections;using System.Collections.Generic;using UnityEngine;public class InputManager{ public Action KeyAction = null; public void OnUpdate() { if (Input.anyKey == false) return; if (KeyAction != null) KeyAction.Invoke(); }} Managers.csusing System.Collections;using System.Collections.. #02 유니티 플레이어 이동 키의 입력은 받는 Input.GetKey를 이용 하여 플레이어의 이동을 조작할수 있다. transform.position = 백터값 입력을 하면 플레이어의 포지션을 이동 할 수 있다.Vector3( x 좌표, y좌표, z좌표) 를 이용하여 아래 코드와 같이 이동 로직을 구현 할 수있다.using System.Collections;using System.Collections.Generic;using UnityEngine;public class PlayerController : MonoBehaviour{ void Start() { } // GameObject (Player) // Transform // PlayerController (*) v.. #01 유니티 게임 오브잭트 코드로 가져오기(Find, AddComponent, DontDestroyOnLoad) GameObject.Find("오브잭트 이름"); 으로 유니티 게임내 오브잭트를 가져올 수 있다.using System.Collections;using System.Collections.Generic;using UnityEngine;public class Player : MonoBehaviour{ // Start is called before the first frame update void Start() { // 게임오브잭트를 이름을 찾는거 자체가 부하가 심하다. /*GameObject go = GameObject.Find("@Managers"); Managers mg = go.GetComponent();*/ // 해결책: 싱글톤을 적용.. GIT 명령어 * 용어정리 origin : 원격저장소의 이름 HAED : 현재 체크아웃된 브런치 또는 커밋을 가리키는 포인터다. * 기본 설정 변경 - 병합(Merge) 방식 설정 git config pull.rebase false - 재정렬(Rebase) 방식 설정 git config pull.rebase true - Fast-Forward만 허용(Fast-Forward Only): 로컬 브랜치가 원격 브랜치보다 뒤처져 있으면 가져오지만, 이력이 다를 경우 동작하지 않는다 git config pull.ff only % 설정을 전역으로 적용하려면 --global 옵션을 추가 git config --global pull.rebase false * 커밋 생성 - 새 git 저장소 생성 git init을 실행하면 해당 디렉.. #05 자료구조 Queue TestApppublic class TestApp { public static void main(String[] args) { MyQueue q = new MyQueue(); System.out.println("capacity:" + q.capacity()); // 10 최초 10 System.out.println("size:" + q.size()); // 0 q.enqueue(1); q.enqueue(2); q.enqueue(3); q.enqueue(4); q.enqueue(5); q.enqueue(6); q.enqueue(7); q.enqueue(8); .. #04 자료구조 Stack TestAppimport java.util.Stack;public class TestApp { public static void main(String[] args) {// Stack stack = new Stack(); MyStack stack = new MyStack(); System.out.println("capacity:" + stack.capacity()); // 10 최초 10 System.out.println("size:" + stack.size()); // 0 stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.. #03 자료구조 LinkedList TestAppimport java.util.LinkedList;public class TestApp { public static void main(String[] args) { MyLinkedList list = new MyLinkedList(); System.out.println(list); // "" list.addFirst(1); // 맨 앞에 추가(더미노드 무시) System.out.println(list); // 1 list.addLast(2); // 맨 뒤에 추가(더미노드 무시) list.addLast(3); list.addLast(4); list.addFirst(0); Sys.. #02 자료구조 동적 배열 Vector(동적배열) TestApppublic class TestApp { public static void main(String[] args) { MyArrayList list = new MyArrayList(); list.add(1); list.add(2); list.add(3); list.add(4); list.add(5); System.out.println(list); System.out.println(list.size()); list.remove(3); // index로 삭제 숫자 4가 삭제되어야함 System.out.println(list); Syst.. 이전 1 2 3 4 ··· 17 다음