public Lixos spawnChiclete() { Lixos un = chiclete [chichleteIndex]; if (un.isActive()) { for (var i = 0; i < chiclete.Count; i++) { un = chiclete [i]; if (!un.isActive()) { chichleteIndex = (chichleteIndex + 1) % chiclete.Count; return(un); } } Debug.Log("Chiclete insuficiente"); return(null); } chichleteIndex = (chichleteIndex + 1) % chiclete.Count; return(un); }
public Lixos spawnVidro() { Lixos un = vidro [vidroIndex]; if (un.isActive()) { for (var i = 0; i < vidro.Count; i++) { un = vidro [i]; if (!un.isActive()) { vidroIndex = (vidroIndex + 1) % vidro.Count; return(un); } } Debug.Log("Vidro insuficiente"); return(null); } vidroIndex = (vidroIndex + 1) % vidro.Count; return(un); }
public Lixos spawnGarrafa() { Lixos un = garrafa [garrafaIndex]; if (un.isActive()) { for (var i = 0; i < garrafa.Count; i++) { un = garrafa [i]; if (!un.isActive()) { garrafaIndex = (garrafaIndex + 1) % garrafa.Count; return(un); } } Debug.Log("Garrafa insuficiente"); return(null); } garrafaIndex = (garrafaIndex + 1) % garrafa.Count; return(un); }
public Lixos spawnCoco() { Lixos un = coco [cocoIndex]; if (un.isActive()) { for (var i = 0; i < coco.Count; i++) { un = coco [i]; if (!un.isActive()) { cocoIndex = (cocoIndex + 1) % coco.Count; return(un); } } Debug.Log("Coco insuficiente"); return(null); } cocoIndex = (cocoIndex + 1) % coco.Count; return(un); }
public Lixos spawnCigarro() { Lixos un = cigarro [cigarroIndex]; if (un.isActive()) { for (var i = 0; i < cigarro.Count; i++) { un = cigarro [i]; if (!un.isActive()) { cigarroIndex = (cigarroIndex + 1) % cigarro.Count; return(un); } } Debug.Log("Cigarro insuficiente"); return(null); } cigarroIndex = (cigarroIndex + 1) % cigarro.Count; return(un); }
public Lixos spawnCerveja() { Lixos un = cerveja [cervejaIndex]; if (un.isActive()) { for (var i = 0; i < cerveja.Count; i++) { un = cerveja [i]; if (!un.isActive()) { cervejaIndex = (cervejaIndex + 1) % cerveja.Count; return(un); } } Debug.Log("Cerveja insuficiente"); return(null); } cervejaIndex = (cervejaIndex + 1) % cerveja.Count; return(un); }