boseok-note
  • README
  • javascript
    • 함수형 자바스크립트
    • core
      • 이벤트루프 (Event Loop)
      • boxing, unboxing
      • prototype
      • 실행컨텍스트
      • hoisting
      • 클로져(Closure)
      • arguments
      • Scope - 스코프 - 유효범위
    • api
      • Promise
      • Fetch API
      • worker-api
      • Web API
    • lib
      • rxjs
        • rxjs
    • 호스트객체?
    • es6
      • var-let-const
      • template-literals
      • async-await
    • tip
      • array-like
      • Object literal, new Object
    • dom-api
      • HTML Element get Text
      • get-size
      • scrollToBottom
    • for in, for of 차이
    • storage
    • Constructor (생성자)
    • Javascript
    • module
  • front-end
    • vuejs
      • vue-rx
      • README
        • 1-start
        • 2-basic-component
        • 3-add-component
        • 4-advanced-component
        • 5-dynamic-methods-event
        • 6-internal-process
      • next-tick
      • compare-react
      • v-model-with-props
      • v-for
      • vuejs
      • vuex
    • browser
      • dom
      • cssom
      • reflow, repaint
      • 렌더링 트리(Rendering Tree)
      • web-standard
    • css
      • text-ellipse
      • white-space
      • css layout
    • Pre-render
    • react-native
      • react-native
    • 최적화 관련
    • reactjs
      • performance
      • reactjs
    • CSR, SSR
  • server-side
    • letsencrypt
    • auto-deploy
    • nlb
    • Certbot, aws https setting with wildcard
    • mysql
    • node.js
      • npm
        • npm install
      • node-dynamodb
      • node에서 간편하게 letsencrypt를 사용하여 https 구현하는 방법
    • Docker
    • nginx
    • Amazon Web Service
    • nginx https 설정
  • design-pattern
    • observer
    • flux
    • README
  • coop
    • git
      • gitignore
      • remote
      • ssh key 사용하기
      • password
      • credential
      • git
  • cs
    • port
    • data-structure
      • tree
      • binary-tree
    • network
      • home-router
      • tcp-udp
      • http
    • process
  • etc
    • sync-async
    • seo
      • seo
      • SEO Check Point
    • rest
    • unity
      • methods
Powered by GitBook
On this page
  • 레이캐스트(Raycast)
  • 자주 사용하는 메소드
  1. etc
  2. unity

methods

레이캐스트(Raycast)

  • 광선을 쏴서 지정한 방향과 거리 이내에 부딪히는 게임오브젝트가 있는지 판단하는 알고리즘

    Distance

  • 두 오브젝트의 거리 구하기

    float distance1 = Vector3.Distance(transform.position, box.position);

    자식 게임오브젝트 찾기

    Transform[] child2 = GameObject.Find("부모이름").GetComponentsInChildren<Transform>();

    Coroutine(코루틴)

  • 쓰레드와 비슷한 개념이지만 차이가 좀 있음.

    Scene 씬의 전환

    빌드&세팅 메뉴에서 add open scenes로 씬을 먼저 등록한다음,

    Application.LoadLevel("이름");

    PlayerPrefs

간단한 데이터를 저장하고 불러올수있는 클래스

key-value 형식으로 저장한다.

PlayerPrefs.SetInt("score", 100);
PlayerPrefs.SetString("name", "developer");

자주 사용하는 메소드

Camera.main.ScreenToWorldPoint(Input.mousePosition)

화면 상에서 마우스의 위치이다. Input.mousePosition을 메인 카메라가 본 시점에서의 위치.

Instantiate(생성물, 위치, 회전)

오브젝트 생성 함수.

Input.GetKey(keycode)

키 눌렀을 때 입력 확인

Input.GetMouseButtonDown()

0은 왼쪽, 1은 오른쪽, 2는 휠.

Previousunity

Last updated 6 years ago