규칙 및 구문

Tutorial

Beginner

+10XP

5 mins

(94)

Unity Technologies

규칙 및 구문

도트 연산자, 세미콜론, 들여쓰기, 주석 처리 등 코드 작성의 기본 규칙과 구문에 대해 알아보세요.

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

이전: 변수 및 함수

다음: If 문

1. 규칙 및 구문

using UnityEngine;
using System.Collections;

public class BasicSyntax : MonoBehaviour
{
    void Start ()
    {
        //이 행은 오브젝트의 x 위치를 나타냅니다.

        /*안녕하세요.
         * 두 줄로 구성된 주석입니다.
         * */
        Debug.Log(transform.position.x);
        
        if(transform.position.y <= 5f)
        {
            Debug.Log ("I'm about to hit the ground!");
        }
    }
}

Complete this Tutorial