void Start() { if (brakeLights == null) { brakeLights = GetComponent <BrakeLights>(); } if (drivetrain == null) { drivetrain = GetComponent <Drivetrain>(); } if (aerodynamicResistance == null) { aerodynamicResistance = GetComponent <AerodynamicResistance>(); } if (soundController == null) { soundController = GetComponent <SoundController>(); } if (carDynamics == null) { carDynamics = GetComponent <CarDynamics>(); } if (axles == null) { axles = GetComponent <Axles>(); } if (axisCarController == null) { axisCarController = GetComponent <AxisCarController>(); } if (carDamage == null) { carDamage = GetComponent <CarDamage>(); } if (arcader == null) { arcader = GetComponent <Arcader>(); } if (setup == null) { setup = GetComponent <Setup>(); } if (bodyRb == null) { bodyRb = GetComponent <Rigidbody>(); } if (camerasController == null) { camerasController = GetComponent <CamerasController>(); } }
void Awake() { body = GetComponent <Rigidbody>(); originalCenterOfMass = body.centerOfMass; myTransform = transform; drivetrain = GetComponent <Drivetrain>(); axisCarController = GetComponent <AxisCarController>(); mouseCarcontroller = GetComponent <MouseCarController>(); mobileCarController = GetComponent <MobileCarController>(); brakeLights = GetComponent <BrakeLights>(); dashBoard = myTransform.GetComponentInChildren <DashBoard>(); steeringWheel = transform.GetComponentInChildren <SteeringWheel>(); soundController = GetComponent <SoundController>(); SetController(controller.ToString()); axles = GetComponent <Axles>(); //frontWheels=axles.frontAxle.wheels; //rearWheels=axles.rearAxle.wheels; //otherWheels=axles.otherWheels; //axles.allWheels=axles.axles.allWheels; invAllWheelsLength = 1f / axles.allWheels.Length; fixedTimeStepScalar = 0.02f / Time.fixedDeltaTime; invFixedTimeStepScalar = 1 / fixedTimeStepScalar; }
///<inheritdoc/> public override int GetHashCode() { int hash = 17; // Overflow is fine, just wrap unchecked { hash = (hash * 29) + PaintScheme.GetHashCode(); hash = (hash * 29) + Mobility.GetHashCode(); hash = (hash * 29) + FirePower.GetHashCode(); hash = (hash * 29) + Damage.GetHashCode(); hash = (hash * 29) + Smoke.GetHashCode(); hash = (hash * 29) + TrailingEffects.GetHashCode(); hash = (hash * 29) + Hatch.GetHashCode(); hash = (hash * 29) + HeadLights.GetHashCode(); hash = (hash * 29) + TailLights.GetHashCode(); hash = (hash * 29) + BrakeLights.GetHashCode(); hash = (hash * 29) + Flaming.GetHashCode(); hash = (hash * 29) + Launcher.GetHashCode(); hash = (hash * 29) + CamouflageType.GetHashCode(); hash = (hash * 29) + Concealed.GetHashCode(); hash = (hash * 29) + FrozenStatus.GetHashCode(); hash = (hash * 29) + PowerPlantStatus.GetHashCode(); hash = (hash * 29) + State.GetHashCode(); hash = (hash * 29) + Tent.GetHashCode(); hash = (hash * 29) + Ramp.GetHashCode(); hash = (hash * 29) + BlackoutLights.GetHashCode(); hash = (hash * 29) + BlackoutBrakeLights.GetHashCode(); hash = (hash * 29) + SpotLights.GetHashCode(); hash = (hash * 29) + InteriorLights.GetHashCode(); hash = (hash * 29) + SurrenderState.GetHashCode(); hash = (hash * 29) + MaskedCloaked.GetHashCode(); } return(hash); }
void Awake(){ body=rigidbody; originalCenterOfMass=body.centerOfMass; myTransform=transform; drivetrain= GetComponent<Drivetrain>(); axisCarController = GetComponent <AxisCarController>(); mouseCarcontroller = GetComponent <MouseCarController>(); mobileCarController = GetComponent <MobileCarController>(); brakeLights=GetComponent <BrakeLights>(); dashBoard = myTransform.GetComponentInChildren <DashBoard>(); steeringWheel = transform.GetComponentInChildren <SteeringWheel>(); soundController=GetComponent<SoundController>(); SetController(controller.ToString()); axles=GetComponent<Axles>(); //frontWheels=axles.frontAxle.wheels; //rearWheels=axles.rearAxle.wheels; //otherWheels=axles.otherWheels; //axles.allWheels=axles.axles.allWheels; invAllWheelsLength=1f/axles.allWheels.Length; fixedTimeStepScalar=0.02f/Time.fixedDeltaTime; invFixedTimeStepScalar=1/fixedTimeStepScalar; }