예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        _resourceManager = FindObjectOfType <ResourceManager>();

        if (OilExtractor.ExtractedOilSlick.type == OilSlickType.Land)
        {
            OilVehicle        = OilTruck;
            LoadedOilCapacity = 100f;
        }
        else
        {
            OilVehicle        = OilTanker;
            LoadedOilCapacity = 1_000f;
        }
        //OilVehicle.SetActive(true);
        //OilVehicle.transform.position = OilExtractor.DockingArea.transform.position;

        City.RegisterTradeRoute(this);
        OilExtractor.RegisterTradeRoute(this);

        _roadManager = OilExtractor.ExtractedOilSlick.type == OilSlickType.Land ? GameObject.FindGameObjectWithTag("TruckRoadManager").GetComponent <RoadManager>() :
                       GameObject.FindGameObjectWithTag("SeaLaneManager").GetComponent <RoadManager>();
        _roadManager.GenerateTradeRoutePath(this);
    }