Пример #1
0
    private void CheckWaterReduce()
    {
        //happens every minute for every plant
        var start   = DateTime.Now;
        var oldDate = DateTime.Parse(plantStats[7]);

        if ((start - oldDate).TotalMinutes >= 1)
        {
            plantStats[5] = (Int16.Parse(plantStats[5]) - water_down_per_minute).ToString();
            plantStats[7] = DateTime.Now.ToString();
            //database
            db.ChangeWaterLevel(transform.name, plantStats[5]);
            db.ChangeWaterDate(transform.name, plantStats[7]);
        }
    }