Beispiel #1
0
    public void LoadPlant(PlantSave plant)
    {
        if (wasLoaded)
        {
            return;
        }
        wasLoaded = true;

        _type = plant.Type;       //type of plant. ex : Bean

        _growGen = plant.GrowGen; //btw 90-100 will indicate how farr will go a plant just by genes

        //the duration of a plant in days
        _lifeDuration = plant.LifeDuration;//120 is for corn

        //when was seeded
        _seedDate = plant.SeedDate;

        //at wht step of growing is,  0.1-1
        _currentGrowStep = plant.CurrentGrowStep;

        //the amout will grow the gameObj created so it happens nie and smotth the grow
        _amtToGrow = plant.AmtToGrow;

        _isReadyToHarvest = plant.IsReadyToHarvest;

        _readyToHarvestDate = plant.ReadyToHarvestDate;
        _daysToRotten       = plant.DaysToRotten;
        _isRotten           = plant.IsRotten;

        gameObject.transform.localScale = plant.LocalScale;
    }
Beispiel #2
0
 public FieldFarm(Structure building, PlantSave plant)
 {
     _plantSave = plant;
     _building  = building;
     _plantType = plant.Type;
     Init();
 }