コード例 #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);
        }
コード例 #2
0
ファイル: Vertex.cs プロジェクト: JanikScholl/myRepos
 public Vertex(float x, float y, Face face)
 {
     VertexVector = new Vector2(x, y); faces.Add(face); VertexID = counter; counter++;
 }
コード例 #3
0
ファイル: Vertex.cs プロジェクト: JanikScholl/myRepos
 public Vertex(Vector2 vertex, Face face)
 {
     VertexVector = vertex; faces.Add(face); VertexID = counter; counter++;
 }
コード例 #4
0
ファイル: Vertex.cs プロジェクト: JanikScholl/myRepos
 //Setting+Getting of FaceList
 public void AddFace(Face face)
 {
     faces.Add(face);
 }
コード例 #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);
            }
        }
コード例 #6
0
  /*************** CONSTRUCTORS ***************/

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