반응형
- 코드 작성
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Example : MonoBehaviour
{
public int minNumber = 0;
public int maxNumber = 10;
void Start()
{
int random = Random.Range(0, 10);
Debug.Log(random);
int random2 = Random.Range(minNumber, maxNumber);
Debug.Log(random2);
}
}
- 유니티 Api 참조
https://docs.unity3d.com/kr/530/ScriptReference/Random.Range.html
반응형