示例#1
0
文件: Turbo.cs 项目: JausGames/CarBR
    // Start is called before the first frame update
    void Start()
    {
        car    = GetComponent <Car>();
        engine = transform.GetComponent <CarEngine>();

        _rigidbody  = engine.GetComponentInChildren <Rigidbody>();
        colliders   = transform.GetComponentInChildren <CarColliders>();
        particles   = transform.GetComponentInChildren <ParticleManager>();
        POWER       = (1f / 2f) * car.GetBoost();
        AMOUNT      = 200f + 3f * car.GetBoostAmount();
        realAmount  = AMOUNT;
        TIME_TO_MAX = (1f / 100f) * car.GetBoostTimeToMax();
    }
示例#2
0
    private void Awake()
    {
        //Debug.Log("Client");
        car = GetComponent <Car>();

        _rigidbody = GetComponent <Rigidbody>();
        _rigidbody.centerOfMass = centerOfMass.localPosition;
        colliders = transform.GetComponentInChildren <CarColliders>();
        wheels    = GetComponentInChildren <WheelsManager>();

        maxSpeed     = 2 * car.GetSpeed();
        MOTOR_TORQUE = 3350f + 1.5f * car.GetPower();
        MAX_STEER    = car.GetSteer();
    }