Esempio n. 1
0
    /// <summary>
    /// 增加鲜花
    /// </summary>
    /// <param name="randomData"></param>
    /// <param name="startPosition"></param>
    /// <param name="flowerData"></param>
    public static void AddFlower(uint randomData, Vector3Int startPosition, BiomeForPlantData flowerData)
    {
        float addRate          = WorldRandTools.GetValue(startPosition, randomData);
        int   flowerTypeNumber = WorldRandTools.Range(0, flowerData.listPlantType.Count);

        if (addRate < flowerData.addRate)
        {
            WorldCreateHandler.Instance.manager.AddUpdateBlock(startPosition.x, startPosition.y + 1, startPosition.z, flowerData.listPlantType[flowerTypeNumber]);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 增加火焰花
    /// </summary>
    /// <param name="wPos"></param>
    public void AddFireFlower(Vector3Int wPos)
    {
        BiomeForPlantData flowersData = new BiomeForPlantData
        {
            addRate       = 0.005f,
            listPlantType = new List <BlockTypeEnum> {
                BlockTypeEnum.FlowerFire
            }
        };

        BiomeCreatePlantTool.AddFlower(201, wPos, flowersData);
    }
Esempio n. 3
0
    protected void AddWeed(Vector3Int wPos)
    {
        BiomeForPlantData weedData = new BiomeForPlantData
        {
            addRate       = 0.3f,
            listPlantType = new List <BlockTypeEnum> {
                BlockTypeEnum.WeedLong, BlockTypeEnum.WeedNormal, BlockTypeEnum.WeedShort
            }
        };

        BiomeCreatePlantTool.AddPlant(333, wPos, weedData);
    }
Esempio n. 4
0
    protected void AddFlower(Vector3Int wPos)
    {
        BiomeForPlantData flowersData = new BiomeForPlantData
        {
            addRate       = 0.01f,
            listPlantType = new List <BlockTypeEnum> {
                BlockTypeEnum.FlowerSun, BlockTypeEnum.FlowerRose, BlockTypeEnum.FlowerChrysanthemum, BlockTypeEnum.FlowerWood
            }
        };

        BiomeCreatePlantTool.AddFlower(101, wPos, flowersData);
    }
Esempio n. 5
0
    public void AddFlower(Vector3Int wPos)
    {
        BiomeForPlantData flowersData = new BiomeForPlantData
        {
            addRate       = 0.005f,
            listPlantType = new List <BlockTypeEnum> {
                BlockTypeEnum.MushroomLuminous
            }
        };

        BiomeCreatePlantTool.AddFlower(701, wPos, flowersData);
    }
Esempio n. 6
0
    protected void AddFlower(Vector3Int wPos)
    {
        BiomeForPlantData flowersData = new BiomeForPlantData
        {
            addRate       = 0.02f,
            listPlantType = new List <BlockTypeEnum> {
                BlockTypeEnum.FlowerMetal
            }
        };

        BiomeCreatePlantTool.AddFlower(101, wPos, flowersData);
    }