데이터 유형

Tutorial

Beginner

+10XP

5 mins

(32)

Unity Technologies

데이터 유형

변수의 작동 방식을 정확히 이해할 수 있도록 값과 레퍼런스 데이터 유형의 주요 차이점에 대해 알아보세요.

이 튜토리얼은 스크립팅의 기초 프로젝트에 포함되어 있습니다.

이전: 델타 시간

다음: 클래스

1. 데이터 유형

DatatypeScript

using UnityEngine;
using System.Collections;

public class DatatypeScript : MonoBehaviour 
{
    void Start () 
    {
        //값 유형 변수
        Vector3 pos = transform.position;
        pos = new Vector3(0, 2, 0);
        
        //레퍼런스 유형 변수
        Transform tran = transform;
        tran.position = new Vector3(0, 2, 0);
    }
}

Complete this Tutorial