조건문 썸네일형 리스트형 unity if문 using UnityEngine; using System.Collections; public class IfStatements : MonoBehaviour { float coffeeTemperature = 85.0f; float hotLimitTemperature = 70.0f; float coldLimitTemperature = 40.0f; void Update () { if(Input.GetKeyDown(KeyCode.Space)) TemperatureTest(); coffeeTemperature -= Time.deltaTime * 5f; } void TemperatureTest () { // 커피 온도가 가장 뜨거운 섭취 온도보다 높은 경우 if(coffeeTemperature > hotLimitT.. 더보기 C# 프로그래밍 - if문 조건문 if/else i if문 조건문 비교 연산자 if else 조건문 int a = -3; if (a == 1){ print("a는 1"); }else{ print("a는 1이 아님"); } //콘솔에 거짓 출력 int a = 1; if (a == 1){ print("a는 1"); }else{ print("a는 1이 아님"); } //콘솔에 참 출력 int a = 3; if(a==1){ Console.WriteLine("a 1"); }else if(a==2){ Console.WriteLine("a 2"); }else{ Console.WriteLine("a는 1, 2 nothing"); } 사용 컴파일러 https://www.onlinegdb.com/online_csharp_compiler 출처 - https://youtu.. 더보기 이전 1 다음