public override void SetupAbility() { base.SetupAbility(); interfaceCarDrive4W = GetComponentInParent <InterfaceCarDrive4W>(); // old vars GetComponent <PhotonView>().RPC(nameof(SaveVars), RpcTarget.AllBuffered); }
// Start is called before the first frame update. void Start() { myRb = GetComponent <PhysXRigidBody>(); meshstateTracker = FindObjectOfType <MeshstateTracker>(); deformableMeshes = new List <DeformableMesh>(GetComponentsInChildren <DeformableMesh>()); DeformableMesh.Subdivide(deformableMeshes[0].maxEdgeLength, deformableMeshes[0].GetMeshFilter().mesh); vertices = new List <Vector3>(deformableMeshes[0].GetMeshFilter().mesh.vertices); // Group similar vertices. meshGraph = meshstateTracker.GetMyMeshGraph(meshType); originalMesh = Instantiate(deformableMeshes[0].GetMeshFilter().mesh); collisionResolver = Instantiate(collisionResolver); resolverBody = collisionResolver.GetComponent <PhysXBody>(); resolverBody.position = new Vector3(0, 10000, 0); interfaceCar = GetComponent <InterfaceCarDrive4W>(); if (interfaceCar != null) { frWheel = interfaceCar.frontRightW; frWheelVertexGroup = NearestVertexTo(frWheel.transform.position); flWheel = interfaceCar.frontLeftW; flWheelVertexGroup = NearestVertexTo(flWheel.transform.position); rrWheel = interfaceCar.rearRightW; rrWheelVertexGroup = NearestVertexTo(rrWheel.transform.position); rlWheel = interfaceCar.rearLeftW; rlWheelVertexGroup = NearestVertexTo(rlWheel.transform.position); } teamId = GetComponent <NetworkPlayerVehicle>().teamId; }
public override void SetupAbility() { Debug.LogWarning("Nitro Ability Charge has not been ported to the new PhysX system"); base.SetupAbility(); interfaceCarDrive4W = GetComponentInParent <InterfaceCarDrive4W>(); // old vars GetComponent <PhotonView>().RPC(nameof(SaveVars), RpcTarget.AllBuffered); }
public void SetupVehicleManager() { // Debug.LogWarning("Vehicle Health Manager has not been fully ported to the new PhysX system"); gamestateTracker = FindObjectOfType <GamestateTracker>(); gamestateTrackerPhotonView = gamestateTracker.GetComponent <PhotonView>(); networkManager = FindObjectOfType <NetworkManager>(); maxHealth = health; rb = GetComponent <PhysXRigidBody>(); icd = GetComponent <InterfaceCarDrive>(); icd4 = GetComponent <InterfaceCarDrive4W>(); carDriver = icd.GetComponent <IDrivable>(); inputDriver = GetComponent <InputDriver>(); myPhotonView = GetComponent <PhotonView>(); npv = GetComponent <NetworkPlayerVehicle>(); announcerManager = FindObjectOfType <AnnouncerManager>(); _rammingDetails = new Weapon.WeaponDamageDetails(null, 0, 0, Weapon.DamageType.ramming, 0, Vector3.zero); for (int i = 0; i < collisionAreas.Count; i++) { CollisionArea collisionArea = collisionAreas[i]; collisionArea.rotation.eulerAngles = collisionArea.rotationEuler; collisionAreas[i] = collisionArea; } defaultDrag = rb.linearDamping; defaultAngularDrag = rb.angularDamping; playerTransformTracker = FindObjectOfType <PlayerTransformTracker>(); PlayerEntry player = gamestateTracker.players.Get((short)PhotonNetwork.LocalPlayer.ActorNumber); if (player.teamId == teamId) { tutorials.SetActive(true); } else { tutorials.SetActive(false); } player.Release(); }
public override void SetupAbility() { Debug.LogWarning("Nitro Ability Sustained has not been ported to the new PhysX system"); base.SetupAbility(); interfaceCarDrive4W = GetComponentInParent <InterfaceCarDrive4W>(); oldMaxSteerAngle = interfaceCarDrive4W.maxSteerAngle; oldMotorTorque = interfaceCarDrive4W.motorTorque; oldBrakeTorque = interfaceCarDrive4W.brakeTorque; oldBrakeForce = interfaceCarDrive4W.brakeForce; oldbaseExtremiumSlip = interfaceCarDrive4W.baseExtremiumSlip; oldAntiRollStiffness = interfaceCarDrive4W.antiRollStiffness; interfaceCarDrive4W.maxSteerAngle = maxSteerAngle; interfaceCarDrive4W.motorTorque = motorTorque; interfaceCarDrive4W.brakeTorque = brakeTorque; interfaceCarDrive4W.brakeForce = brakeForce; interfaceCarDrive4W.baseExtremiumSlip = baseExtremiumSlip; interfaceCarDrive4W.antiRollStiffness = antiRollStiffness; }
private void Awake() { // Debug.LogWarning("AI control needs porting to new PhysX system."); // return; // get the car controller reference myRb = GetComponent <PhysXRigidBody>(); interfaceCarDrive = GetComponent <InterfaceCarDrive4W>(); // give the random perlin a random value m_RandomPerlin = Random.value * 100; m_Rigidbody = GetComponent <Rigidbody>(); CarDriver = interfaceCarDrive.GetComponent <IDrivable>(); m_Driving = true; WaypointCircuit wpc = FindObjectOfType <WaypointCircuit>(); if (wpc != null) { circuitFound = true; } }