Пример #1
0
  public FlatRoof (BuildingMesh parent)
    : base(parent)
  {
    width = 0.1f;
    height = 0.05f;

    boundaries = new Vector3[8];

    for (int i = 0; i < 4; ++i)
    {
      boundaries[i] = parentMesh.roofBase.boundaries[i + 4] +
                      width * parentMesh.faces[i].normal +
                      width * parentMesh.faces[(i + 3) % 4].normal;

      boundaries[i + 4] = boundaries[i] + height * Vector3.up;
    }

    decor = new RoofDecoration(this);
    if (parentMesh.parent.roofDecorMaterial == null)
    {
      var list = MaterialManager.Instance.GetCollection("mat_roof_decor");
      decor.material = list[Random.Range(0, list.Count)];
    }
    else
      decor.material = parentMesh.parent.roofDecorMaterial;
    parentMesh.parent.AddCombinable(decor.material.name, decor);
  }
Пример #2
0
        public FlatRoof(BuildingMesh parent)
            : base(parent)
        {
            width = 0.1f;
            height = 0.05f;

            boundaries = new Vector3[8];

            for (int i = 0; i < 4; ++i)
            {
              boundaries[i] = parentMesh.roofBase.boundaries[i + 4] +
                      width * parentMesh.faces[i].normal +
                      width * parentMesh.faces[(i + 3) % 4].normal;

              boundaries[i + 4] = boundaries[i] + height * Vector3.up;
            }

            decor = new RoofDecoration(this);
            if (parentMesh.parent.roofDecorMaterial == null)
            {
              var list = MaterialManager.Instance.GetCollection("mat_roof_decor");
              decor.material = list[Random.Range(0, list.Count)];
            }
            else
              decor.material = parentMesh.parent.roofDecorMaterial;
            parentMesh.parent.AddCombinable(decor.material.name, decor);
        }
Пример #3
0
 public Roof (BuildingMesh parent)
 {
   parentMesh = parent;
   decor = null;
 }