Ejemplo n.º 1
0
 public void SetBuildingParams(Vector2 size, BuildingController controller, Camera camera)
 {
     _camera           = camera;
     _cellSize         = size;
     _controller       = controller;
     _collider         = GetComponent <BoxCollider>();
     _collider.enabled = true;
     _materials        = GetComponent <BuildingMaterials>();
     _renderer         = GetComponent <MeshRenderer>();
     CanBuild          = false;
 }
Ejemplo n.º 2
0
 public void CopyValues(BeyondComponent bc)
 {
     Template  = bc.Template;
     PosInCell = bc.PosInCell;
     State     = bc.State;
     if (BuildingMaterials == null)
     {
         BuildingMaterials = new List <BuildingMaterial>();
     }
     foreach (BuildingMaterial gm in bc.BuildingMaterials)
     {
         BuildingMaterials.Add(gm);
     }
 }
Ejemplo n.º 3
0
 public void SetValues(Template t, State s, List <BuildingMaterial> lgm)
 {
     if (BuildingMaterials == null)
     {
         BuildingMaterials = new List <BuildingMaterial>();
     }
     Template  = t;
     PosInCell = t.ValidPosInCell[0]; // By default, a BC is in the first PosInCell of its template's ValidPosInCell
     State     = s;
     foreach (BuildingMaterial gm in lgm)
     {
         BuildingMaterials.Add(gm);
     }
 }