Ejemplo n.º 1
0
        public Door(Face parent, Vector3 dr, Vector3 dl, ComponentCoordinate position)
            : base(parent, position)
        {
            height = parentBuilding.doorHeight;
            depth = 0.4f;

            float mod = 0.4f;
            if (masterParent.doorWidth > 0f)
              mod = (masterParent.doorWidth - (dr - dl).magnitude) / 2f;

            dr += mod * parentFace.right;
            dl -= mod * parentFace.right;

            var ul = new Vector3(dl.x, dl.y + height, dl.z);
            var ur = new Vector3(dr.x, dr.y + height, dr.z);

            boundaries = new Vector3[4];
            boundaries[0] = dr;
            boundaries[1] = dl;
            boundaries[2] = ul;
            boundaries[3] = ur;

            frame = new ComponentFrame(this);
            frame.name = "neo_door_frame";
            frame.material = MaterialManager.Instance.Get("ComponentFrame");
            parentBuilding.parent.AddCombinable(frame.material.name, frame);

            body = new DoorBody(this);
            body.name = "neo_door_body";
            body.material = parentBuilding.parent.doorMaterial;
            parentBuilding.parent.AddCombinable(body.material.name, body);
        }
Ejemplo n.º 2
0
 public Vertex(float x, float y, Face face)
 {
     VertexVector = new Vector2(x, y); faces.Add(face); VertexID = counter; counter++;
 }
Ejemplo n.º 3
0
 public Vertex(Vector2 vertex, Face face)
 {
     VertexVector = vertex; faces.Add(face); VertexID = counter; counter++;
 }
Ejemplo n.º 4
0
 //Setting+Getting of FaceList
 public void AddFace(Face face)
 {
     faces.Add(face);
 }
Ejemplo n.º 5
0
        /*************** CONSTRUCTORS ***************/
        public Balcony(Face parent, Vector3 dr, Vector3 dl, ComponentCoordinate position)
            : base(parent, position)
        {
            height = parentBuilding.balconyHeight;
            width = (dr - dl).magnitude;
            depth = 0.2f;

            if (masterParent.balconyWidth > 0f)
            {
              var mod = (masterParent.balconyWidth - width) / 2f;
              width = masterParent.balconyWidth;
              dr += mod * parentFace.right;
              dl -= mod * parentFace.right;
            }

            boundaries = new Vector3[4];
            boundaries[0] = dr;
            boundaries[1] = dl;
            boundaries[2] = new Vector3(dl.x, dl.y + height, dl.z);
            boundaries[3] = new Vector3(dr.x, dr.y + height, dr.z);

            frame = new BalconyFrame(this);
            frame.name = "neo_balcony_frame";
            frame.material = MaterialManager.Instance.Get("ComponentFrame");
            parentBuilding.parent.AddCombinable(frame.material.name, frame);

            body = new BalconyBody(this);
            body.name = "neo_balcony_body";
            body.material = parentBuilding.parent.balconyDoorMaterial;
            parentBuilding.parent.AddCombinable(body.material.name, body);

            balconyFloor = new BalconyFloor(this);
            balconyFloor.name = "neo_balcony_floor";
            balconyFloor.material = parentBuilding.material;
            parentBuilding.parent.AddCombinable(balconyFloor.material.name, balconyFloor);

            balconyRail = new BalconyRail(balconyFloor);
            balconyRail.name = "neo_balcony_rail";
            balconyRail.material = MaterialManager.Instance.Get("mat_balcony_rail");
            parentBuilding.parent.AddCombinable(balconyRail.material.name, balconyRail);

            rightShutter = new Shutter(this, ShutterSide.Right);
            rightShutter.name = "bal_right_shutter";
            rightShutter.material = parentBuilding.parent.shutterMaterial;
            parentBuilding.parent.AddCombinable(rightShutter.material.name, rightShutter);

            leftShutter = new Shutter(this, ShutterSide.Left);
            leftShutter.name = "bal_left_shutter";
            leftShutter.material = parentBuilding.parent.shutterMaterial;
            parentBuilding.parent.AddCombinable(leftShutter.material.name, leftShutter);

            if (position.floor >= 1)
            {
              decor = new ComponentDecor(this);
              decor.name = "window_decor";
              decor.material = parentBuilding.parent.compDecorMaterial;
              parentBuilding.parent.AddCombinable(decor.material.name, decor);
            }
            else
            {
              decor = new ComponentDecor(this, true);
              decor.name = "window_decor";
              decor.material = parentBuilding.parent.simpleCompDecorMaterial;
              parentBuilding.parent.AddCombinable(decor.material.name, decor);
            }
        }
Ejemplo n.º 6
0
  /*************** CONSTRUCTORS ***************/

  public FaceComponent (Face parent, ComponentCoordinate position)
  {
    parentFace = parent;
    this.position = position;
  }