示例#1
0
    //private void Update()
    //{
    //    Vector3Int gridPos = m_currentMap.GetTileMapCom().WorldToCell(Camera.main.ScreenToWorldPoint(Input.mousePosition));
    //    Debug.Log("GridPOs: " + gridPos + "\n" + m_currentMap.GetTileMapCom().HasTile(gridPos));
    //    Debug.Log("Tile at : " + gridPos + "\n" + m_currentMap.GetTileMapCom().GetTile(gridPos));
    //}

    public void SetBuildModeUI(BaseBuildingsClass building)
    {
        //set UI
        if (building != null)
        {
            SpriteRenderer buildingSprite = building.GetSpriteRenderer();
            if (buildingSprite != null)
            {
                Vector2 uiOffset = new Vector2(0.0f, buildingSprite.bounds.size.y / 2.0f);
                IngameUIManager.instance.BuildModeUIOpen(building.GetSpriteGO().transform, uiOffset, building.GetBuildingSizeOnMap(), building.GetBuildingSpriteSize());
            }
        }
    }