Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4.  
  5. public class gerador : MonoBehaviour {
  6. public Transform[] locais;
  7. public GameObject plata;
  8. private float relogio;
  9. // Use this for initialization
  10. void Start () {
  11. //Random.Range (0, locais.Length);
  12.  
  13. }
  14.  
  15. // Update is called once per frame
  16. void Update () {
  17. transform.Translate(0,3*Time.deltaTime,0);
  18. relogio += Time.deltaTime;
  19. if(relogio >= 1)
  20. {
  21.  
  22. int f = Random.Range(0,locais.Length);
  23. int i = Random.Range(0,locais.Length);
  24. Debug.Log(i);
  25.  
  26. Instantiate(plata,locais[i].position,transform.rotation);
  27. if(f != i){
  28. Instantiate(plata,locais[f].position,transform.rotation);
  29. }
  30. relogio =0;
  31. }
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement