Beispiel #1
0
    public void Place(BaseTile placementTile, PlayerData.PlayerId owner)
    {
        m_isBeingCarried = false;
        transform.parent = null;
        RestoreRigidbody();
        DOTween.Kill(transform);

        placementTile.AddBuildingPart(this);
        placementTile.Claim(owner);

        VFXManager.Instance.DoPlacePuffVFX(transform.position);
    }
Beispiel #2
0
    public void GenerateBuilding(BaseTile tile, int height, bool addRoof = false)
    {
        if (height <= 0)
        {
            return;
        }

        for (int i = 0; i < height; ++i)
        {
            GameObject       storyObj = Instantiate(m_buildingStoryPrefab, m_buildingsContainer);
            BaseBuildingPart story    = storyObj.GetComponent <BaseBuildingPart>();
            tile.AddBuildingPart(story);
        }

        if (addRoof)
        {
            GameObject       roofObj = Instantiate(m_buildingRoofPrefab, m_buildingsContainer);
            BaseBuildingPart roof    = roofObj.GetComponent <BaseBuildingPart>();
            roof.transform.rotation = Utils.GetRandomAlignedRotation();
            tile.AddBuildingPart(roof);
        }
    }