Example #1
0
    public void ApplyDefaultPart(Team inTeam, CarPart.PartType inPartType)
    {
        CarManager carManager = inTeam.carManager;

        carManager.UnfitAllParts(carManager.GetCar(0));
        carManager.UnfitAllParts(carManager.GetCar(1));
        CarPartInventory partInventory = inTeam.carManager.partInventory;

        partInventory.DestroyParts(inPartType);
        partInventory.AddPart(this.GetDefaultPart(inPartType, inTeam));
        partInventory.AddPart(this.GetDefaultPart(inPartType, inTeam));
        carManager.AutoFit(carManager.GetCar(0), CarManager.AutofitOptions.Performance, CarManager.AutofitAvailabilityOption.UnfitedParts);
        carManager.AutoFit(carManager.GetCar(1), CarManager.AutofitOptions.Performance, CarManager.AutofitAvailabilityOption.UnfitedParts);
    }
Example #2
0
    public void ApplySpecPart(Team inTeam)
    {
        CarManager carManager = inTeam.carManager;

        carManager.UnfitAllParts(carManager.GetCar(0));
        carManager.UnfitAllParts(carManager.GetCar(1));
        CarPartInventory partInventory = inTeam.carManager.partInventory;

        for (int index = 0; index < this.specParts.Count; ++index)
        {
            partInventory.DestroyParts(this.specParts[index]);
            partInventory.AddPart(this.GetSpecPart(this.specParts[index], inTeam));
            partInventory.AddPart(this.GetSpecPart(this.specParts[index], inTeam));
        }
        carManager.AutoFit(carManager.GetCar(0), CarManager.AutofitOptions.Performance, CarManager.AutofitAvailabilityOption.UnfitedParts);
        carManager.AutoFit(carManager.GetCar(1), CarManager.AutofitOptions.Performance, CarManager.AutofitAvailabilityOption.UnfitedParts);
    }