Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class InstantiateWalls : MonoBehaviour {
  6.  
  7. public List<Walls> AllWall = new List<Walls>();
  8.  
  9. void Start () {
  10.  
  11. }
  12.  
  13. // Update is called once per frame
  14. void Update () {
  15. if (Input.GetKeyDown (KeyCode.Space)) {
  16. addWalls ();
  17.  
  18. }
  19. }
  20.  
  21. public void addWalls (){
  22.  
  23. for (int x = 0; x < 5; x++) {
  24. Walls block = (Walls)Instantiate (AllWall [1]) ;
  25. block.transform.position = new Vector3 (0, 0, 0);
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement