Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private List<GameObject>() objetos;
- void Start() {
- objetos = new List<GameObject>();
- }
- void Update() {
- //Tu codigo
- if(Input.GetKey("F")){
- objetos.Add(Instantiate(obj), new Vector3(2f, 0f, 0f), Quaternion.identity);
- }
- if(Input.GetKey("b"){
- foreach(var obj in objetos) {
- Destroy(obj);
- Debug.Log("Destruido");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement