Advertisement
Guest User

random issue

a guest
Nov 19th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4.  
  5. public class Generator1 : MonoBehaviour {
  6.  
  7.     public GameObject[] obj;
  8.     public float MinTime, MaxTime;
  9.  
  10.     void Start()
  11.     {
  12.         if (Puntuation.getPoints() >= 20)
  13.         {
  14.             Generate();
  15.         }//outer
  16.     }
  17.  
  18.  
  19.     void Generate()
  20.     {
  21.         Object r = obj[Random.Range(0, obj.Length)];
  22.         Instantiate( r , transform.position, Quaternion.identity);
  23.         Invoke("Generate", Random.Range(MinTime, MaxTime));
  24.     }//generar
  25.  
  26. }//class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement