Beispiel #1
0
    public static InfoScene GetInstance(ConstructionBase construction)
    {
        var scene = Instantiate <InfoScene>();

        scene._construction             = construction;
        scene.Header.text               = construction.GetType().Name;
        scene.DeleteButton.interactable = construction.Removable;
        return(scene);
    }
Beispiel #2
0
 void ClearTask()
 {
     for (int x = 0; x < 3; x++)
     {
         for (int y = 0; y < 3; y++)
         {
             _aim[x, y].enabled = false;
         }
     }
     _building = null;
 }
Beispiel #3
0
 public void BeginPlace(ConstructionBase building)
 {
     if (_building != null)
     {
         Destroy(_building.gameObject);
     }
     _building = building;
     building.transform.SetParent(transform);
     building.transform.localPosition = Vector3.zero;
     for (int x = 0; x < 3; x++)
     {
         for (int y = 0; y < 3; y++)
         {
             _aim[x, y].enabled = x < building.Size.X && y < building.Size.Y;
         }
     }
 }
Beispiel #4
0
 public void PlaceConstruction(ConstructionBase constr, bool root = true)
 {
     Construction = constr;
     if (root)
     {
         constr.SetCell(this);
         for (int x = 0; x < constr.Size.X; x++)
         {
             for (int y = 0; y < constr.Size.Y; y++)
             {
                 if (x != 0 || y != 0)
                 {
                     GetNeighbour(x, y).PlaceConstruction(constr, false);
                 }
             }
         }
     }
 }
Beispiel #5
0
 public void PlaceBuilding(ConstructionBase building, Point position)
 {
     this[position].PlaceConstruction(building);
     building.transform.SetParent(transform);
     building.transform.localPosition = position;
 }