public void UpdateWindow()
 {
     foreach (Transform child in listContente)
     {
         if (child.gameObject.activeSelf)
         {
             Destroy(child.gameObject);
         }
     }
     if (onStore)
     {
         groupesDropdown.gameObject.SetActive(true);
         List <string> dropdownOption = new List <string>();
         foreach (Group curGroupe in Group.groups)
         {
             dropdownOption.Add(curGroupe.name);
         }
         dropdownOption.Add("None");
         groupesDropdown.ClearOptions();
         groupesDropdown.AddOptions(dropdownOption);
         groupesDropdown.value = Group.groups.Count;
         foreach (VehicleData curVehicle in FIleSys.GetAllInstances <VehicleData>())
         {
             Transform _go = Instantiate(templateStoreVehicle).transform;
             _go.SetParent(listContente);
             _go.Find("Name").GetComponent <Text>().text        = curVehicle.name;
             _go.Find("Description").GetComponent <Text>().text = curVehicle.description;
             _go.Find("Buy").GetComponent <Button>().onClick.AddListener(delegate
             {
                 VehicleContoler vehicle = depot.BuyVehicle(curVehicle);
                 if (groupesDropdown.value != Group.groups.Count)
                 {
                     vehicle.MyGroup = Group.groups[groupesDropdown.value];
                 }
             });
             _go.Find("Buy").GetComponent <ButtonInteractMoney>().condiction = delegate()
             {
                 return(GameManager.Money >= curVehicle.price);
             };
             _go.gameObject.SetActive(true);
         }
     }
     else
     {
         groupesDropdown.gameObject.SetActive(false);
         foreach (VehicleContoler curVehicle in VehicleManager.GetVehicleByPos(depot))
         {
             Transform _go = Instantiate(templateDepotVehicle).transform;
             _go.SetParent(listContente);
             _go.Find("Name").GetComponent <Text>().text   = curVehicle.vehicleData.name;
             _go.Find("Damage").GetComponent <Text>().text = string.Format("Damage: {0}%", Mathf.Floor(curVehicle.damage * 100));
             _go.Find("ID").GetComponent <Text>().text     = "ID: " + curVehicle.Id;
             _go.Find("Info").GetComponent <Button>().onClick.AddListener(delegate { WindowsOpener.OpenVehicleWindow(curVehicle.GetComponent <VehicleContoler>()); });
             _go.gameObject.SetActive(true);
         }
     }
     templateDepotVehicle.SetActive(false);
     templateStoreVehicle.SetActive(false);
 }
    public static void MakeAuto(Vector2Int origine)
    {
        //Vector2Int origine = new Vector2Int(200, 200);
        for (int i = -30; i <= 0; i++)
        {
            MapManager.map.AddConstruction(origine + new Vector2Int(i, 1), new Road());
        }
        for (int i = 0; i <= 30; i++)
        {
            MapManager.map.AddConstruction(origine + new Vector2Int(0, i), new Road());
        }
        for (int i = -15; i <= 15; i += 15)
        {
            Industrise indus = MapManager.map.CreatIndustrise(origine + new Vector2Int(-35, i));
            indus.industriseData          = FIleSys.GetAllInstances <IndustriseData>()[0];
            indus.materialProductionRatio = 200;
            indus.SetInputeOutpure();
        }
        for (int i = -15; i <= 15; i += 15)
        {
            Industrise indus = MapManager.map.CreatIndustrise(origine + new Vector2Int(i, 35));
            indus.industriseData          = FIleSys.GetAllInstances <IndustriseData>()[1];
            indus.materialProductionRatio = 200;
            indus.SetInputeOutpure();
        }

        MapManager.map.AddConstruction(origine + new Vector2Int(-31, 1), new LoadingBay());
        MapManager.map.AddConstruction(origine + new Vector2Int(0, 31), new LoadingBay());

        MapManager.map.AddConstruction(origine, new Depot());
        Depot depot = MapManager.map.GetParcel <Depot>(origine);

        Debug.Log(depot);
        Debug.Log(FIleSys.GetAllInstances <VehicleData>()[1]);
        Group group = new Group()
        {
            name = "Auto Generate Groupe"
        };
        List <VehicleContoler> vehicles = new List <VehicleContoler>();

        for (int i = 0; i < 3; i++)
        {
            vehicles.Add(depot.BuyVehicle(FIleSys.GetAllInstances <VehicleData>()[1]));
            vehicles[i].MyGroup = Group.groups[0];
        }
        group.forceRoute = true;
        group.route      = new Route()
        {
            points = new List <Vector2Int>()
            {
                origine + new Vector2Int(-31, 1),
                origine + new Vector2Int(0, 31),
                origine,
            }
        };
        Group.groups[0].StartEveryVehicle();
    }