Ejemplo n.º 1
0
    private void Handbrake()
    {
        var CarDriver = ICD.GetComponent <IDrivable>();

        if (Input.GetKey(KeyCode.Space))
        {
            CarDriver.Drift();
        }
        else
        {
            CarDriver.StopDrift();
        }
    }
Ejemplo n.º 2
0
    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();
    }