Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Generator1 : MonoBehaviour {
- public GameObject[] obj;
- public float MinTime, MaxTime;
- void Start()
- {
- if (Puntuation.getPoints() >= 20)
- {
- Generate();
- }//outer
- }
- void Generate()
- {
- Object r = obj[Random.Range(0, obj.Length)];
- Instantiate( r , transform.position, Quaternion.identity);
- Invoke("Generate", Random.Range(MinTime, MaxTime));
- }//generar
- }//class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement