SHARE
TWEET

Untitled

a guest Dec 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top