Fixed building issues when placing over destroyed buildings
This commit is contained in:
@@ -2540,7 +2540,7 @@ RectTransform:
|
|||||||
m_GameObject: {fileID: 2048015617}
|
m_GameObject: {fileID: 2048015617}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 0.25, y: 0.25, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 2112507919}
|
m_Father: {fileID: 2112507919}
|
||||||
@@ -2548,7 +2548,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: -1100, y: 0}
|
m_AnchoredPosition: {x: -1100, y: 0}
|
||||||
m_SizeDelta: {x: 1600, y: 150}
|
m_SizeDelta: {x: 6400, y: 600}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &2048015619
|
--- !u!114 &2048015619
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -2571,17 +2571,17 @@ MonoBehaviour:
|
|||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_FontData:
|
m_FontData:
|
||||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
m_Font: {fileID: 12800000, guid: 25598a8975ed29243bb850b56f191920, type: 3}
|
||||||
m_FontSize: 75
|
m_FontSize: 300
|
||||||
m_FontStyle: 0
|
m_FontStyle: 0
|
||||||
m_BestFit: 0
|
m_BestFit: 0
|
||||||
m_MinSize: 0
|
m_MinSize: 0
|
||||||
m_MaxSize: 75
|
m_MaxSize: 300
|
||||||
m_Alignment: 3
|
m_Alignment: 3
|
||||||
m_AlignByGeometry: 0
|
m_AlignByGeometry: 0
|
||||||
m_RichText: 1
|
m_RichText: 1
|
||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 1
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: 'Current Money: $0'
|
m_Text: 'Current Money: $0'
|
||||||
--- !u!222 &2048015620
|
--- !u!222 &2048015620
|
||||||
|
|||||||
@@ -130,7 +130,16 @@ namespace Fruitomation.Game
|
|||||||
File.WriteAllText(Filepath, json);
|
File.WriteAllText(Filepath, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveBuilding(Building building) => Buildings.Remove(building);
|
public void RemoveBuilding(Building building)
|
||||||
|
{
|
||||||
|
Buildings.Remove(building);
|
||||||
|
|
||||||
|
for (int x = building.GridPosition.x; x < building.GridPosition.x + building.SizeOnGrid.x; x++)
|
||||||
|
for (int y = building.GridPosition.y; y < building.GridPosition.y + building.SizeOnGrid.y; y++)
|
||||||
|
{
|
||||||
|
InhabitedCells[x, y] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool AddBuildingAt(Vector2Int position, BuildingRegistry.BuildingInfo building, bool isFlipped)
|
public bool AddBuildingAt(Vector2Int position, BuildingRegistry.BuildingInfo building, bool isFlipped)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user