using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LandListDataControl
{
    private string LAND_LIST_DATA_JSON = "LandListDataJson";
    private bool isShowGuide = false;//是否走引导
    private int wormRate = 0;
    private int videoAdRate = 0;
    private int safetyFtuitNum = 0;
    private float mTimeRate = 0f;
    private int mStopWormNum;//前多少课不生虫
    private int mCurrentWormNum;//当前已经生虫的数量
    private static LandListDataControl instance;
    private string[] landNameList = { "白菜", "番茄", "南瓜", "萝卜", "玉米", "茄子", "西瓜", "葡萄", "草莓" };
    private string backUp = "{\"landList\":[{\"id\":1,\"name\":\"白菜\",\"unlockPrice\":0,\"seedPrice\":5,\"profit\":7,\"second\":60,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":60},{\"start\":31,\"countdown\":120},{\"start\":41,\"countdown\":300},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":45,\"acceleratorsNum\":0},{\"id\":2,\"name\":\"番茄\",\"unlockPrice\":5,\"seedPrice\":10,\"profit\":15,\"second\":120,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":120},{\"start\":31,\"countdown\":240},{\"start\":41,\"countdown\":360},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":47,\"acceleratorsNum\":0},{\"id\":3,\"name\":\"南瓜\",\"unlockPrice\":10,\"seedPrice\":20,\"profit\":32,\"second\":240,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":240},{\"start\":31,\"countdown\":360},{\"start\":41,\"countdown\":480},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":38,\"acceleratorsNum\":0},{\"id\":4,\"name\":\"萝卜\",\"unlockPrice\":50,\"seedPrice\":30,\"profit\":51,\"second\":480,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":480},{\"start\":31,\"countdown\":480},{\"start\":41,\"countdown\":600},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":720},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1500},{\"start\":96,\"countdown\":1800}],\"fruitNum\":34,\"acceleratorsNum\":0},{\"id\":5,\"name\":\"玉米\",\"unlockPrice\":100,\"seedPrice\":50,\"profit\":90,\"second\":600,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":600},{\"start\":31,\"countdown\":720},{\"start\":41,\"countdown\":900},{\"start\":46,\"countdown\":1200},{\"start\":51,\"countdown\":1500},{\"start\":71,\"countdown\":1800},{\"start\":81,\"countdown\":2700},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":7200}],\"fruitNum\":38,\"acceleratorsNum\":0},{\"id\":6,\"name\":\"茄子\",\"unlockPrice\":200,\"seedPrice\":80,\"profit\":144,\"second\":720,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":720},{\"start\":31,\"countdown\":900},{\"start\":41,\"countdown\":1200},{\"start\":46,\"countdown\":1500},{\"start\":51,\"countdown\":1800},{\"start\":71,\"countdown\":2400},{\"start\":81,\"countdown\":3600},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":32,\"acceleratorsNum\":0},{\"id\":7,\"name\":\"西瓜\",\"unlockPrice\":300,\"seedPrice\":100,\"profit\":180,\"second\":900,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":900},{\"start\":31,\"countdown\":1200},{\"start\":41,\"countdown\":1500},{\"start\":46,\"countdown\":1800},{\"start\":51,\"countdown\":2400},{\"start\":71,\"countdown\":3600},{\"start\":81,\"countdown\":5400},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":20,\"acceleratorsNum\":0},{\"id\":8,\"name\":\"葡萄\",\"unlockPrice\":500,\"seedPrice\":200,\"profit\":360,\"second\":1200,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1200},{\"start\":31,\"countdown\":1500},{\"start\":41,\"countdown\":1800},{\"start\":46,\"countdown\":2400},{\"start\":51,\"countdown\":3600},{\"start\":71,\"countdown\":5400},{\"start\":81,\"countdown\":7200},{\"start\":91,\"countdown\":10800},{\"start\":96,\"countdown\":14400}],\"fruitNum\":18,\"acceleratorsNum\":0},{\"id\":9,\"name\":\"草莓\",\"unlockPrice\":1000,\"seedPrice\":300,\"profit\":540,\"second\":1500,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1500},{\"start\":31,\"countdown\":1800},{\"start\":41,\"countdown\":2400},{\"start\":46,\"countdown\":3600},{\"start\":51,\"countdown\":5400},{\"start\":71,\"countdown\":7200},{\"start\":81,\"countdown\":10800},{\"start\":91,\"countdown\":14400},{\"start\":96,\"countdown\":21600}],\"fruitNum\":16,\"acceleratorsNum\":0}]}";
    //private string landListJson = "{\"landList\":[{\"countDownSecond\":10,\"id\":1,\"name\":\"白菜\",\"ownNum\":0,\"profit\":6,\"second\":60,\"seedNum\":0,\"seedPrice\":5,\"status\":3,\"unlockPrice\":30},{\"countDownSecond\":110,\"id\":2,\"name\":\"番茄\",\"ownNum\":0,\"profit\":14,\"second\":120,\"seedNum\":0,\"seedPrice\":10,\"status\":2,\"unlockPrice\":50},{\"countDownSecond\":106,\"id\":3,\"name\":\"南瓜\",\"ownNum\":0,\"profit\":30,\"second\":300,\"seedNum\":0,\"seedPrice\":20,\"status\":2,\"unlockPrice\":100},{\"countDownSecond\":596,\"id\":4,\"name\":\"萝卜\",\"ownNum\":0,\"profit\":60,\"second\":600,\"seedNum\":0,\"seedPrice\":40,\"status\":2,\"unlockPrice\":200},{\"countDownSecond\":1799,\"id\":5,\"name\":\"玉米\",\"ownNum\":0,\"profit\":110,\"second\":1800,\"seedNum\":0,\"seedPrice\":80,\"status\":2,\"unlockPrice\":300},{\"countDownSecond\":0,\"id\":6,\"name\":\"茄子\",\"ownNum\":0,\"profit\":200,\"second\":3600,\"seedNum\":0,\"seedPrice\":160,\"status\":4,\"unlockPrice\":500},{\"countDownSecond\":0,\"id\":7,\"name\":\"西瓜\",\"ownNum\":0,\"profit\":380,\"second\":7200,\"seedNum\":0,\"seedPrice\":320,\"status\":0,\"unlockPrice\":1000},{\"countDownSecond\":0,\"id\":8,\"name\":\"葡萄\",\"ownNum\":0,\"profit\":712,\"second\":14400,\"seedNum\":0,\"seedPrice\":640,\"status\":0,\"unlockPrice\":2500},{\"countDownSecond\":0,\"id\":9,\"name\":\"草莓\",\"ownNum\":0,\"profit\":1352,\"second\":21600,\"seedNum\":0,\"seedPrice\":1280,\"status\":0,\"unlockPrice\":5000}]}";
    //private string landListJson = "{\"landList\":[{\"id\":1,\"name\":\"白菜\",\"unlockPrice\":0,\"seedPrice\":5,\"profit\":7,\"second\":60,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":60},{\"start\":31,\"countdown\":120},{\"start\":41,\"countdown\":300},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":45,\"acceleratorsNum\":0},{\"id\":2,\"name\":\"番茄\",\"unlockPrice\":5,\"seedPrice\":10,\"profit\":15,\"second\":120,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":120},{\"start\":31,\"countdown\":240},{\"start\":41,\"countdown\":360},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":47,\"acceleratorsNum\":0},{\"id\":3,\"name\":\"南瓜\",\"unlockPrice\":10,\"seedPrice\":20,\"profit\":32,\"second\":240,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":240},{\"start\":31,\"countdown\":360},{\"start\":41,\"countdown\":480},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":38,\"acceleratorsNum\":0},{\"id\":4,\"name\":\"萝卜\",\"unlockPrice\":50,\"seedPrice\":30,\"profit\":51,\"second\":480,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":480},{\"start\":31,\"countdown\":480},{\"start\":41,\"countdown\":600},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":720},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1500},{\"start\":96,\"countdown\":1800}],\"fruitNum\":34,\"acceleratorsNum\":0},{\"id\":5,\"name\":\"玉米\",\"unlockPrice\":100,\"seedPrice\":50,\"profit\":90,\"second\":600,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":600},{\"start\":31,\"countdown\":720},{\"start\":41,\"countdown\":900},{\"start\":46,\"countdown\":1200},{\"start\":51,\"countdown\":1500},{\"start\":71,\"countdown\":1800},{\"start\":81,\"countdown\":2700},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":7200}],\"fruitNum\":38,\"acceleratorsNum\":0},{\"id\":6,\"name\":\"茄子\",\"unlockPrice\":200,\"seedPrice\":80,\"profit\":144,\"second\":720,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":720},{\"start\":31,\"countdown\":900},{\"start\":41,\"countdown\":1200},{\"start\":46,\"countdown\":1500},{\"start\":51,\"countdown\":1800},{\"start\":71,\"countdown\":2400},{\"start\":81,\"countdown\":3600},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":32,\"acceleratorsNum\":0},{\"id\":7,\"name\":\"西瓜\",\"unlockPrice\":300,\"seedPrice\":100,\"profit\":180,\"second\":900,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":900},{\"start\":31,\"countdown\":1200},{\"start\":41,\"countdown\":1500},{\"start\":46,\"countdown\":1800},{\"start\":51,\"countdown\":2400},{\"start\":71,\"countdown\":3600},{\"start\":81,\"countdown\":5400},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":20,\"acceleratorsNum\":0},{\"id\":8,\"name\":\"葡萄\",\"unlockPrice\":500,\"seedPrice\":200,\"profit\":360,\"second\":1200,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1200},{\"start\":31,\"countdown\":1500},{\"start\":41,\"countdown\":1800},{\"start\":46,\"countdown\":2400},{\"start\":51,\"countdown\":3600},{\"start\":71,\"countdown\":5400},{\"start\":81,\"countdown\":7200},{\"start\":91,\"countdown\":10800},{\"start\":96,\"countdown\":14400}],\"fruitNum\":18,\"acceleratorsNum\":0},{\"id\":9,\"name\":\"草莓\",\"unlockPrice\":1000,\"seedPrice\":300,\"profit\":540,\"second\":1500,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1500},{\"start\":31,\"countdown\":1800},{\"start\":41,\"countdown\":2400},{\"start\":46,\"countdown\":3600},{\"start\":51,\"countdown\":5400},{\"start\":71,\"countdown\":7200},{\"start\":81,\"countdown\":10800},{\"start\":91,\"countdown\":14400},{\"start\":96,\"countdown\":21600}],\"fruitNum\":16,\"acceleratorsNum\":0}]}";
    //private string landListJson = "{\"landList\":[{\"id\":1,\"name\":\"白菜\",\"unlockPrice\":0,\"seedPrice\":5,\"profit\":7,\"second\":60,\"countDownSecond\":0,\"status\":4,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":60},{\"start\":31,\"countdown\":120},{\"start\":41,\"countdown\":300},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":45,\"acceleratorsNum\":4},{\"id\":2,\"name\":\"番茄\",\"unlockPrice\":5,\"seedPrice\":10,\"profit\":15,\"second\":120,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":120},{\"start\":31,\"countdown\":240},{\"start\":41,\"countdown\":360},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":47,\"acceleratorsNum\":4},{\"id\":3,\"name\":\"南瓜\",\"unlockPrice\":10,\"seedPrice\":20,\"profit\":32,\"second\":240,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":240},{\"start\":31,\"countdown\":360},{\"start\":41,\"countdown\":480},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1800}],\"fruitNum\":38,\"acceleratorsNum\":4},{\"id\":4,\"name\":\"萝卜\",\"unlockPrice\":50,\"seedPrice\":30,\"profit\":51,\"second\":480,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":480},{\"start\":31,\"countdown\":480},{\"start\":41,\"countdown\":600},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":720},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1500},{\"start\":96,\"countdown\":1800}],\"fruitNum\":34,\"acceleratorsNum\":4},{\"id\":5,\"name\":\"玉米\",\"unlockPrice\":100,\"seedPrice\":50,\"profit\":90,\"second\":600,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":600},{\"start\":31,\"countdown\":720},{\"start\":41,\"countdown\":900},{\"start\":46,\"countdown\":1200},{\"start\":51,\"countdown\":1500},{\"start\":71,\"countdown\":1800},{\"start\":81,\"countdown\":2700},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":7200}],\"fruitNum\":38,\"acceleratorsNum\":4},{\"id\":6,\"name\":\"茄子\",\"unlockPrice\":200,\"seedPrice\":80,\"profit\":144,\"second\":720,\"countDownSecond\":10771,\"status\":2,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":720},{\"start\":31,\"countdown\":900},{\"start\":41,\"countdown\":1200},{\"start\":46,\"countdown\":1500},{\"start\":51,\"countdown\":1800},{\"start\":71,\"countdown\":2400},{\"start\":81,\"countdown\":3600},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":33,\"acceleratorsNum\":4},{\"id\":7,\"name\":\"西瓜\",\"unlockPrice\":300,\"seedPrice\":100,\"profit\":180,\"second\":900,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":900},{\"start\":31,\"countdown\":1200},{\"start\":41,\"countdown\":1500},{\"start\":46,\"countdown\":1800},{\"start\":51,\"countdown\":2400},{\"start\":71,\"countdown\":3600},{\"start\":81,\"countdown\":5400},{\"start\":91,\"countdown\":7200},{\"start\":96,\"countdown\":10800}],\"fruitNum\":20,\"acceleratorsNum\":4},{\"id\":8,\"name\":\"葡萄\",\"unlockPrice\":500,\"seedPrice\":200,\"profit\":360,\"second\":1200,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1200},{\"start\":31,\"countdown\":1500},{\"start\":41,\"countdown\":1800},{\"start\":46,\"countdown\":2400},{\"start\":51,\"countdown\":3600},{\"start\":71,\"countdown\":5400},{\"start\":81,\"countdown\":7200},{\"start\":91,\"countdown\":10800},{\"start\":96,\"countdown\":14400}],\"fruitNum\":18,\"acceleratorsNum\":4},{\"id\":9,\"name\":\"草莓\",\"unlockPrice\":1000,\"seedPrice\":300,\"profit\":540,\"second\":1500,\"countDownSecond\":0,\"status\":3,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":5,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1500},{\"start\":31,\"countdown\":1800},{\"start\":41,\"countdown\":2400},{\"start\":46,\"countdown\":3600},{\"start\":51,\"countdown\":5400},{\"start\":71,\"countdown\":7200},{\"start\":81,\"countdown\":10800},{\"start\":91,\"countdown\":14400},{\"start\":96,\"countdown\":21600}],\"fruitNum\":17,\"acceleratorsNum\":4}]}";
    //新手数据
    private string landListJson = "{\"landList\":[{\"id\":1,\"name\":\"白菜\",\"unlockPrice\":0,\"seedPrice\":5,\"profit\":7,\"second\":60,\"countDownSecond\":0,\"status\":1,\"seedNum\":3,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":60},{\"start\":31,\"countdown\":120},{\"start\":41,\"countdown\":300},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":840},{\"start\":91,\"countdown\":960},{\"start\":96,\"countdown\":1200},{\"start\":141,\"countdown\":1800},{\"start\":146,\"countdown\":2400}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":2,\"name\":\"番茄\",\"unlockPrice\":5,\"seedPrice\":10,\"profit\":15,\"second\":120,\"countDownSecond\":0,\"status\":4,\"seedNum\":3,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":120},{\"start\":31,\"countdown\":240},{\"start\":41,\"countdown\":360},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1080},{\"start\":96,\"countdown\":1200},{\"start\":141,\"countdown\":2400},{\"start\":146,\"countdown\":3600}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":3,\"name\":\"南瓜\",\"unlockPrice\":10,\"seedPrice\":20,\"profit\":32,\"second\":240,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":240},{\"start\":31,\"countdown\":360},{\"start\":41,\"countdown\":480},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":720},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1500},{\"start\":141,\"countdown\":1800},{\"start\":146,\"countdown\":2400}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":4,\"name\":\"萝卜\",\"unlockPrice\":50,\"seedPrice\":30,\"profit\":51,\"second\":480,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":480},{\"start\":31,\"countdown\":480},{\"start\":41,\"countdown\":600},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":900},{\"start\":81,\"countdown\":1200},{\"start\":91,\"countdown\":1500},{\"start\":96,\"countdown\":1500},{\"start\":141,\"countdown\":1800},{\"start\":146,\"countdown\":2400}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":5,\"name\":\"玉米\",\"unlockPrice\":100,\"seedPrice\":50,\"profit\":90,\"second\":600,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":600},{\"start\":31,\"countdown\":720},{\"start\":41,\"countdown\":900},{\"start\":46,\"countdown\":1200},{\"start\":51,\"countdown\":1500},{\"start\":71,\"countdown\":1800},{\"start\":81,\"countdown\":2400},{\"start\":91,\"countdown\":3000},{\"start\":96,\"countdown\":4500},{\"start\":141,\"countdown\":4500},{\"start\":146,\"countdown\":4500}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":6,\"name\":\"茄子\",\"unlockPrice\":200,\"seedPrice\":80,\"profit\":144,\"second\":720,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":720},{\"start\":31,\"countdown\":900},{\"start\":41,\"countdown\":1200},{\"start\":46,\"countdown\":1500},{\"start\":51,\"countdown\":1800},{\"start\":71,\"countdown\":2100},{\"start\":81,\"countdown\":2700},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":5400},{\"start\":141,\"countdown\":5400},{\"start\":146,\"countdown\":5400}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":7,\"name\":\"西瓜\",\"unlockPrice\":300,\"seedPrice\":100,\"profit\":180,\"second\":900,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":900},{\"start\":31,\"countdown\":1200},{\"start\":41,\"countdown\":1500},{\"start\":46,\"countdown\":1800},{\"start\":51,\"countdown\":2100},{\"start\":71,\"countdown\":2400},{\"start\":81,\"countdown\":3000},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":7200},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":8,\"name\":\"葡萄\",\"unlockPrice\":500,\"seedPrice\":200,\"profit\":360,\"second\":1200,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1200},{\"start\":31,\"countdown\":1500},{\"start\":41,\"countdown\":1800},{\"start\":46,\"countdown\":2100},{\"start\":51,\"countdown\":2400},{\"start\":71,\"countdown\":2700},{\"start\":81,\"countdown\":3600},{\"start\":91,\"countdown\":4500},{\"start\":96,\"countdown\":7200},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":5},{\"id\":9,\"name\":\"草莓\",\"unlockPrice\":1000,\"seedPrice\":300,\"profit\":540,\"second\":1500,\"countDownSecond\":0,\"status\":0,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":0,\"growList\":[{\"start\":1,\"countdown\":1500},{\"start\":31,\"countdown\":1800},{\"start\":41,\"countdown\":2100},{\"start\":46,\"countdown\":2400},{\"start\":51,\"countdown\":2700},{\"start\":71,\"countdown\":3600},{\"start\":81,\"countdown\":4500},{\"start\":91,\"countdown\":5400},{\"start\":96,\"countdown\":7200},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":5}]}";
    //private string landListJson = "{\"landList\":[{\"id\":1,\"name\":\"白菜\",\"unlockPrice\":0,\"seedPrice\":5,\"profit\":7,\"second\":60,\"countDownSecond\":14,\"status\":2,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":60},{\"start\":41,\"countdown\":120},{\"start\":46,\"countdown\":300},{\"start\":51,\"countdown\":480},{\"start\":71,\"countdown\":600},{\"start\":81,\"countdown\":720},{\"start\":91,\"countdown\":840},{\"start\":96,\"countdown\":960},{\"start\":141,\"countdown\":1200},{\"start\":146,\"countdown\":1800},{\"start\":100000,\"countdown\":2400}],\"fruitNum\":6,\"acceleratorsNum\":1,\"targetVideoNum\":0,\"currentVideoNum\":0,\"stopSecond\":14,\"suspend\":1},{\"id\":2,\"name\":\"番茄\",\"unlockPrice\":5,\"seedPrice\":10,\"profit\":15,\"second\":120,\"countDownSecond\":53,\"status\":2,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":120},{\"start\":41,\"countdown\":240},{\"start\":46,\"countdown\":360},{\"start\":51,\"countdown\":480},{\"start\":71,\"countdown\":600},{\"start\":81,\"countdown\":720},{\"start\":91,\"countdown\":900},{\"start\":96,\"countdown\":1080},{\"start\":141,\"countdown\":1200},{\"start\":146,\"countdown\":2400},{\"start\":100000,\"countdown\":3600}],\"fruitNum\":4,\"acceleratorsNum\":1,\"targetVideoNum\":0,\"currentVideoNum\":0,\"stopSecond\":53,\"suspend\":1},{\"id\":3,\"name\":\"南瓜\",\"unlockPrice\":10,\"seedPrice\":20,\"profit\":32,\"second\":240,\"countDownSecond\":29,\"status\":2,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":240},{\"start\":41,\"countdown\":360},{\"start\":46,\"countdown\":480},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":600},{\"start\":81,\"countdown\":720},{\"start\":91,\"countdown\":900},{\"start\":96,\"countdown\":1200},{\"start\":141,\"countdown\":1500},{\"start\":146,\"countdown\":1800},{\"start\":100000,\"countdown\":2400}],\"fruitNum\":4,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":29,\"suspend\":1},{\"id\":4,\"name\":\"萝卜\",\"unlockPrice\":50,\"seedPrice\":30,\"profit\":51,\"second\":480,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":480},{\"start\":41,\"countdown\":480},{\"start\":46,\"countdown\":600},{\"start\":51,\"countdown\":600},{\"start\":71,\"countdown\":600},{\"start\":81,\"countdown\":900},{\"start\":91,\"countdown\":1200},{\"start\":96,\"countdown\":1500},{\"start\":141,\"countdown\":1500},{\"start\":146,\"countdown\":1800},{\"start\":100000,\"countdown\":2400}],\"fruitNum\":1,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":0,\"suspend\":0},{\"id\":5,\"name\":\"玉米\",\"unlockPrice\":100,\"seedPrice\":50,\"profit\":90,\"second\":600,\"countDownSecond\":109,\"status\":2,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":600},{\"start\":41,\"countdown\":720},{\"start\":46,\"countdown\":900},{\"start\":51,\"countdown\":1200},{\"start\":71,\"countdown\":1500},{\"start\":81,\"countdown\":1800},{\"start\":91,\"countdown\":2400},{\"start\":96,\"countdown\":3000},{\"start\":141,\"countdown\":4500},{\"start\":146,\"countdown\":4500},{\"start\":100000,\"countdown\":4500}],\"fruitNum\":0,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":109,\"suspend\":1},{\"id\":6,\"name\":\"茄子\",\"unlockPrice\":200,\"seedPrice\":80,\"profit\":144,\"second\":720,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":720},{\"start\":41,\"countdown\":900},{\"start\":46,\"countdown\":1200},{\"start\":51,\"countdown\":1500},{\"start\":71,\"countdown\":1800},{\"start\":81,\"countdown\":2100},{\"start\":91,\"countdown\":2700},{\"start\":96,\"countdown\":3600},{\"start\":141,\"countdown\":5400},{\"start\":146,\"countdown\":5400},{\"start\":100000,\"countdown\":5400}],\"fruitNum\":0,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":0,\"suspend\":0},{\"id\":7,\"name\":\"西瓜\",\"unlockPrice\":300,\"seedPrice\":100,\"profit\":180,\"second\":900,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":900},{\"start\":41,\"countdown\":1200},{\"start\":46,\"countdown\":1500},{\"start\":51,\"countdown\":1800},{\"start\":71,\"countdown\":2100},{\"start\":81,\"countdown\":2400},{\"start\":91,\"countdown\":3000},{\"start\":96,\"countdown\":3600},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200},{\"start\":100000,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":0,\"suspend\":0},{\"id\":8,\"name\":\"葡萄\",\"unlockPrice\":500,\"seedPrice\":200,\"profit\":360,\"second\":1200,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":1200},{\"start\":41,\"countdown\":1500},{\"start\":46,\"countdown\":1800},{\"start\":51,\"countdown\":2100},{\"start\":71,\"countdown\":2400},{\"start\":81,\"countdown\":2700},{\"start\":91,\"countdown\":3600},{\"start\":96,\"countdown\":4500},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200},{\"start\":100000,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":0,\"suspend\":0},{\"id\":9,\"name\":\"草莓\",\"unlockPrice\":1000,\"seedPrice\":300,\"profit\":540,\"second\":1500,\"countDownSecond\":0,\"status\":1,\"seedNum\":0,\"cloudSecond\":10,\"acceleratorsSecond\":10,\"guideStatus\":1,\"growList\":[{\"start\":31,\"countdown\":1500},{\"start\":41,\"countdown\":1800},{\"start\":46,\"countdown\":2100},{\"start\":51,\"countdown\":2400},{\"start\":71,\"countdown\":2700},{\"start\":81,\"countdown\":3600},{\"start\":91,\"countdown\":4500},{\"start\":96,\"countdown\":5400},{\"start\":141,\"countdown\":7200},{\"start\":146,\"countdown\":7200},{\"start\":100000,\"countdown\":7200}],\"fruitNum\":0,\"acceleratorsNum\":1,\"targetVideoNum\":1,\"currentVideoNum\":0,\"stopSecond\":0,\"suspend\":0}],\"rate\":100,\"configNum\":1,\"timeRate\":0.5,\"videoRate\":50}";
    private LandEntity[] landDataList = { null, null, null, null, null, null, null, null, null };
    private string xiaoManGifPath;

    public static LandListDataControl GetIns()
    {
        if (instance == null)
        {
            instance = new LandListDataControl();
        }
        return instance;
    }

    public string getGifPath()
    {
       return xiaoManGifPath;
    }

    public void setGifPath(string path)
    {
        xiaoManGifPath = path;
        Debug.Log("GIF" + xiaoManGifPath);
    }

    //LoadIng页 同步数据
    public bool saveLandListJson(string json)
    {
        landListJson = json;
        LandListEntity bean = JsonUtility.FromJson<LandListEntity>(json);
        if (bean != null)
        {
            wormRate = bean.rate;//生虫几率

            videoAdRate = bean.videoRate;//看视频除虫的概率

            safetyFtuitNum = bean.configNum;//保护期数量

            mTimeRate = bean.timeRate;//时间段百分比

            mStopWormNum = bean.stopConfigNum;//前多少课不生虫

            mCurrentWormNum = bean.currentWormNum;//当前已经生虫的数量

            if (bean.xiaoManPath != null)
            {
                xiaoManGifPath = bean.xiaoManPath;
            }
            Debug.Log("初始化");

            int mFruitNum = 0;

            for (int i = 0; i < bean.landList.Length; i++)
            {
                landDataList[i] = bean.landList[i];

                mFruitNum = mFruitNum + bean.landList[i].fruitNum;

                if (bean.landList[i].id == 2)
                {
                    if(bean.landList[i].status != 4)
                    {
                        PlayerPrefs.SetInt("GUIDE_FIVE", 1);
                    }
                }
            }
            CoinNumControl.GetIns().getMyAllFruit = mFruitNum;
            CoinNumControl.GetIns().getMyWaterBottle = bean.landList[0].acceleratorsNum;
            //if (CoinNumControl.GetIns().getMyWaterBottle <= 0)//加速剂数量小于0 未初始化，同步加速剂数量
            //{
            //    CoinNumControl.GetIns().getMyWaterBottle = bean.landList[0].acceleratorsNum;
            //}
            if (!getIsShowGuide)
            {
                if (landDataList[0] != null)
                {
                    if (landDataList[0].guideStatus == 0)
                    {
                        getIsShowGuide = true;
                    }
                    else
                    {
                        getIsShowGuide = false;
                    }
                }
            }
            PlayerPrefs.SetString(LAND_LIST_DATA_JSON, json);
        }
        return PlayerPrefs.HasKey(LAND_LIST_DATA_JSON);
    }

    public LandEntity getLandData(int postion)
    {
        if (landDataList[postion] == null)
        {
            saveLandListJson(landListJson);
        }
        return landDataList[postion];
    }

    public int getCloudTime()
    {
        if (landDataList[0] == null)
        {
            saveLandListJson(landListJson);
        }
        if (landDataList[0] == null)
        {
            return 10;
        }
        else
        {
            return landDataList[0].cloudSecond;
        }
    }

    public bool getIsShowGuide
    {
        get { return isShowGuide; }
        set { isShowGuide = value; }
    }

    public float getTimeRate
    {
        get { return mTimeRate; }
    }

    //是否生成虫子
    public bool isCreatWorm(int position)
    {
        bool isCreatTemp = false;
        //已收获数量超过安全范围
        if (CoinNumControl.GetIns().getMyAllFruit >= safetyFtuitNum)
        {
            //本次种植是否生虫
            isCreatTemp = IsCreatRedPack(wormRate);
        }
        if (isCreatTemp)
        {
            mCurrentWormNum++;
            if (mCurrentWormNum > mStopWormNum)
            {//当前生虫数量 达到目标 需要看视频除虫
                saveKillWormIsShowAd(position);
            }
        }
        //wormRateArr[position] = isCreatTemp;
        return isCreatTemp;
    }

    private bool IsCreatRedPack(int probabilityNum)
    {
        int num = probabilityNum / 5;
        bool[] randomArr = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };//  0&
        for (int i = 0; i < num; i++)
        {
            randomArr[i] = true;
        }
        return randomArr[Random.Range(0, randomArr.Length)];
    }

    public void saveKillWormIsShowAd(int position)
    {
        if (IsCreatRedPack(videoAdRate))
        {
            PlayerPrefs.SetInt("IS_AD_KILL_WORM" + position, 0);
        }
        else
        {
            PlayerPrefs.SetInt("IS_AD_KILL_WORM" + position, 1);
        }
    }
    public bool getKillWormIsShowAd(int position)
    {//0 看广告除虫 1 不看广告除虫
        return PlayerPrefs.GetInt("IS_AD_KILL_WORM" + position, 1) == 0;
    }
}
