Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Respawner : MonoBehaviour
- {
- public float repeat_time;
- public float curr_time;
- public GameObject monster;
- void Start()
- {
- curr_time = repeat_time;
- }
- void Update()
- {
- if (GameSystem.MonsterCount <= 0)
- return;
- curr_time -= Time.deltaTime;
- if(curr_time <= 0)
- {
- curr_time = repeat_time;
- Instantiate(monster, transform.position, Quaternion.identity);
- GameSystem.MonsterCount--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement