Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. private List<GameObject>() objetos;
  2.  
  3. void Start() {
  4.     objetos = new List<GameObject>();
  5. }
  6.  
  7. void Update() {
  8.     //Tu codigo
  9.     if(Input.GetKey("F")){
  10.         objetos.Add(Instantiate(obj), new Vector3(2f, 0f, 0f), Quaternion.identity);
  11.     }
  12.  
  13.     if(Input.GetKey("b"){
  14.         foreach(var obj in objetos) {
  15.             Destroy(obj);
  16.             Debug.Log("Destruido");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement