Esempio n. 1
0
    public void ReloadPlant()
    {
        var temp1 = plants.Find(somePlant => somePlant == currentPlant);

        if (temp1 != PlantType.None)
        {
            plants.Remove(temp1);
        }
        stateStorageSO.SetPlantCounter(plants);
        if (plants.Count > 0)
        {
            var temp = GetNextPlant();
            if (temp != PlantType.None)
            {
                currentPlant = temp;
                stateStorageSO.SetNewPlant(temp);
                material.color = plantTypeStorageSO.GetColor(currentPlant);
            }
        }
        else
        {
            material.color = plantTypeStorageSO.GetColor(PlantType.None);
        }
    }