static void place(Vector2Int tileID) { currentGO.GetComponent <SpriteRenderer>().sortingOrder = Map.MapSideSize * 3 - (int)currentGO.transform.position.y * 2; if (currentBuilding is StandaloneBuilding) { currentBuilding.Initialize(tileID); } else if (currentBuilding is BuildingNearRoad) { BuildingNearRoad bnr = (BuildingNearRoad)currentBuilding; bnr.Initialize(tileID, tileID + GameUtility.GetNearbyIDByDirection(currentRotation)); } Map.PlaceBuildingOnMap(currentGO, currentBuilding, tileID); currentBuilding = null; StopedConstructing.Invoke(); }
public static void StopContructing() { instance.StopAllCoroutines(); GameObject.Destroy(currentGO); StopedConstructing.Invoke(); }