Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class InstantiateWalls : MonoBehaviour {
- public List<Walls> AllWall = new List<Walls>();
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKeyDown (KeyCode.Space)) {
- addWalls ();
- }
- }
- public void addWalls (){
- for (int x = 0; x < 5; x++) {
- Walls block = (Walls)Instantiate (AllWall [1]) ;
- block.transform.position = new Vector3 (0, 0, 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement