Пример #1
0
    public void ConfirmPlacementPressed()
    {
        if (_selectedObject != null)
        {
            GridManager.Instance.ClearVisualization(_selectedObject);

            //First update the coordinates of the object to its new location...
            _selectedObject.SetCoordinates(GridManager.Instance.GetGridCoordinates(_selectedObject.transform.position));
            //and then notify the GridManager of its new home.
            GridManager.Instance.PlaceObject(_selectedObject);
            GridManager.Instance.DeselectObject();

            _selectedObject.ConfirmPlacement();
        }
    }