유니티 C# 조건문 if, else, Swtich 문 간단 사용법


유니티 C# 조건문 if, else, Swtich 문 간단 사용법

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Example : MonoBehaviour { int a = 0; int b = 0; string s = "안녕하세요"; string t = "반갑습니다"; private void Start() { if (a > b) { Debug.Log("a가 b보다 큽니다."); } else { Debug.Log("a가 b보다 같거나 작습니다."); } if (s.Equals(t)) { Debug.Log("서로 같습니다."); } else { Debug.Log("서로 다릅니다."); } switch(a) { case..


원문링크 : 유니티 C# 조건문 if, else, Swtich 문 간단 사용법