if statement1 Unity If Statement 조건 C# 기반의 유니티의 조건문에는 크게 if switch 삼항 연산자(ternary operator) 가 있다 if 부터 살펴보자면 using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestIf : MonoBehaviour //TestIf 라는 클래스를 선언해준뒤 { int a = 8; //integer Type의 a는 8 int b = 10; //b는 10이라는 변수를 선언해준뒤 bool result; void start() { result = a > b if(result) // result가 참일경우에 아래 구현부를 출력한다. { print("a가 더큽니다"); } else { print(.. 2021. 5. 20. 이전 1 다음