コード例 #1
0
    void DisplayParts()
    {
        bodySprite.sprite   = carBodies[currentBody].sprite;
        engineSprite.sprite = carEngines[currentEngine].sprite;
        aeroSprite.sprite   = carAeroes[currentAero].sprite;
        tireSprite.sprite   = carTires[currentTire].sprite;

        customizerCar.Clear();
        customizerCar.body                = carBodies[currentBody];
        customizerCar.engine              = carEngines[currentEngine];
        customizerCar.aero                = carAeroes[currentAero];
        customizerCar.tire                = carTires[currentTire];
        customizerCar.transform.position += new Vector3(0, 0.2f, 0);
        customizerCar.Setup();

        speedStat.text    = customizerCar.maxVelocity.ToString() + "/" + maxSpeedStat;
        accelStat.text    = customizerCar.maxMotorTorque.ToString() + "/" + maxAccelStat;
        handlingStat.text = customizerCar.maxSteerAngle.ToString() + "/" + maxHandlingStat;
        brakingStat.text  = customizerCar.brakeMod.ToString() + "/" + maxBrakingStat;
        weightStat.text   = customizerCar.GetComponent <Rigidbody>().mass + "kg";
    }