Advertisement
Guest User

Atividade Marcelo

a guest
Sep 16th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.98 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Fortress : MonoBehaviour
  6. {
  7.    public Texture2D texturePiso;
  8.     // Start is called before the first frame update
  9.     void Start()
  10.     {
  11.         GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
  12.  
  13.         GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
  14.         cube.transform.position = new Vector3(4.5f, 1.5F, 4.5f);
  15.         cube.transform.localScale = new Vector3(1, 3, 1);
  16.  
  17.         GameObject cube1 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  18.         cube1.transform.position = new Vector3(-4.5f, 1.5F, 4.5f);
  19.         cube1.transform.localScale = new Vector3(1, 3, 1);
  20.  
  21.         GameObject cube2 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  22.         cube2.transform.position = new Vector3(4.5f, 1.5F, -4.5f);
  23.         cube2.transform.localScale = new Vector3(1, 3, 1);
  24.  
  25.         GameObject cube3 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  26.         cube3.transform.position = new Vector3(-4.5f, 1.5F, -4.5f);
  27.         cube3.transform.localScale = new Vector3(1, 3, 1);
  28.  
  29.         GameObject cube4 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  30.         cube4.transform.position = new Vector3(0, 1, 4.5f);
  31.         cube4.transform.localScale = new Vector3(8, 2, 0.1f);
  32.  
  33.         GameObject cube5 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  34.         cube5.transform.position = new Vector3(-2.5f, 1, -4.5f);
  35.         cube5.transform.localScale = new Vector3(3, 2, 0.1f);
  36.  
  37.         GameObject cube6 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  38.         cube6.transform.position = new Vector3(2.5f, 1, -4.5f);
  39.         cube6.transform.localScale = new Vector3(3, 2, 0.1f);
  40.  
  41.         GameObject cube7 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  42.         cube7.transform.position = new Vector3(-4.5f, 1F, 0);
  43.         cube7.transform.Rotate(0, 90, 0, Space.Self);
  44.         cube7.transform.localScale = new Vector3(8, 2, 0.1f);
  45.  
  46.         GameObject cube8 = GameObject.CreatePrimitive(PrimitiveType.Cube);
  47.         cube8.transform.position = new Vector3(4.5f, 1F, 0);
  48.         cube8.transform.Rotate(0, 90, 0, Space.Self);
  49.         cube8.transform.localScale = new Vector3(8, 2, 0.1f);
  50.  
  51.         GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  52.         sphere.transform.position = new Vector3(-4.5f, 3, 4.5f);
  53.  
  54.         GameObject sphere1 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  55.         sphere1.transform.position = new Vector3(4.5f, 3, -4.5f);
  56.  
  57.         GameObject sphere2 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  58.         sphere2.transform.position = new Vector3(4.5f, 3, 4.5f);
  59.  
  60.         GameObject sphere3 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
  61.         sphere3.transform.position = new Vector3(-4.5f, 3, -4.5f);
  62.        
  63.      
  64.        plane.GetComponent<Renderer>().material.mainTexture = texturePiso;
  65.     }
  66.  
  67.     // Update is called once per frame
  68.     void Update()
  69.     {
  70.        
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement