티스토리 뷰
728x170
Invoke()로 1초마다 함수 실행
1초마다 Spawn 함수 실행
using UnityEngine;
public class MonsterSpwaner : MonoBehaviour
{
public GameObject monsterPrefab;
void Start()
{
Invoke("Spawn", 1);
}
void Spawn()
{
Instantiate(monsterPrefab);
}
// Update is called once per frame
void Update()
{
}
}
2초 뒤, 1초마다 함수 호출
using UnityEngine;
public class MonsterSpwaner : MonoBehaviour
{
public GameObject monsterPrefab;
void Start()
{
InvokeRepeating("Spawn", 2, 1);
}
void Spawn()
{
Instantiate(monsterPrefab);
}
// Update is called once per frame
void Update()
{
}
}
그리드형
'개발 > Unity Engine' 카테고리의 다른 글
| Unity Engine의 .gitignore에 추가할 파일 이름들 (0) | 2024.12.02 |
|---|
공지사항
최근에 올라온 글
최근에 달린 댓글
링크
TAG
- adb
- java
- Unreal Engine
- Skia
- 리스보아 카드
- 와일드보어의 땅
- aosp 빌드
- 안드로이드
- 마비노기 모바일
- javascript
- 포르투갈
- 다크스텀프
- 메이플랜드
- 나무던전
- 포르투
- DART
- 주황버섯
- Flutter
- 파란버섯
- 티스토리챌린지
- 모루정원
- Python
- 리스본
- 와보땅
- 오블완
- 파이썬
- 12e 트램
- 원숭이의숲
- 15e 트램
- android
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
글 보관함
세로형
