응용프로그램/유니티(Unity)
유니티 랜덤값 얻기
zelkova
2016. 12. 9. 17:14
- using UnityEngine;
- using System.Collections;
- public class test : MonoBehaviour {
- private int r; // 랜덤값을 넣어줄 int형 변수
- // Use this for initialization
- void Start () {
- r = Random.Range(0, 10); // 0~9중에 하나가 들어갑니다.
- }
- // Update is called once per frame
- void Update () {
- Debug.Log(r);
- }
- }
반응형