private void CreateBuilding() { var position = grid.GetGridPostion(CameraUtils.GetMousePosition3D()); if (!grid.IsInsideGrid(position.X, position.Y)) { DebugPopup.Create("Can't create here."); return; } var gridObject = new GridObject( CurrentBuilding.Width, CurrentBuilding.Height, currentDirection ); if (!grid.TrySetGridValue(grid.GetWorldPosition(position.X, position.Y), gridObject)) { return; } var building = buildingPooling.GetAvailableObject(CurrentBuilding.Tag).Get(); building .GetComponent <Building>() .Setup(gridObject) .Activate((go) => { go .transform .position = grid.GetWorldPosition(position.X, position.Y, gridObject); go .transform .rotation = Quaternion.Euler(0f, currentDirection.Rotation, 0f); }); }
// Start is called before the first frame update void Start() { //DebugTextManager.Display(() => "PopupQueueCount:" + popupQueue.Count.ToString() + "\n", -100); popup = textPopupBox.GetComponent <DebugPopup>(); }