Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class gerador : MonoBehaviour {
- public Transform[] locais;
- public GameObject plata;
- private float relogio;
- // Use this for initialization
- void Start () {
- //Random.Range (0, locais.Length);
- }
- // Update is called once per frame
- void Update () {
- transform.Translate(0,3*Time.deltaTime,0);
- relogio += Time.deltaTime;
- if(relogio >= 1)
- {
- int f = Random.Range(0,locais.Length);
- int i = Random.Range(0,locais.Length);
- Debug.Log(i);
- Instantiate(plata,locais[i].position,transform.rotation);
- if(f != i){
- Instantiate(plata,locais[f].position,transform.rotation);
- }
- relogio =0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement