Random Bool
[유니티] Bool 난수 생성하기
[유니티] Bool 난수 생성하기
2020.02.26깔끔하게 Bool 난수 생성하는 법 예전에 본 코드인데 가끔 사용해서 노트로 남깁니다. Random.value를 써서 간단하게 구현할 수 있습니다. void Update() { bool randBool = (Random.value > 0.5f); Debug.Log(randBool); } 대표 이미지 출처: Icons made by Good Ware from www.flaticon.com