Пример #1
0
    public void Initialize(string name, Car_SO car)
    {
        this.name = name;
        this.car  = car;

        for (int i = 0; i < transform.childCount; i++)
        {
            GameObject child = transform.GetChild(i).gameObject;
            Destroy(child);
        }
        Instantiate(car.planePrefab, transform);

        var capsuleCollider = GetComponent <CapsuleCollider>();

        capsuleCollider.radius = car.capsuleColliderRadius;
        capsuleCollider.height = car.capsuleColliderLength;

        carStats = new CarStats(car.specs.durability,
                                car.specs.fuel,
                                car.specs.fuelRate,
                                this);

        movementScript.player = this;
        movementScript.SetSpecs(car.specs);
        movementScript.SetControls(controls);

        groundCollidersTouching = 0;

        AudioManager.Instance.Play(driveSound);
    }
Пример #2
0
 public void CarsSelected(Car_SO player0Car, Car_SO player1Car)
 {
     car0 = player0Car;
     car1 = player1Car;
 }