示例#1
0
    void DisableCar(bool brake = true)
    {
        CarCameras CarCams = m_Car.GetComponent <CarCameras>() as CarCameras;

        CarCams.showFixedCams = false;
        m_Car.motorInput      = 0.0f;
        m_Car.brakeInput      = brake ? 1.0f : 0;
        CarSettings Settings = m_Car.GetComponent <CarSettings>() as CarSettings;

        if (Settings)
        {
            Settings.bypassABS = true;
        }
        m_Car.readUserInput = false;
        nitroDown           = false;
    }
示例#2
0
    void LoadCar()
    {
        if (m_Car)
        {
            _Pool.Save(m_Car.gameObject);
        }
        string path     = cop ? "police" : owner.carSet.carName;
        Spawn  spawnPos = GetSpawnStartPos();

        m_Car = _Pool.Load2(Resources.Load(path), spawnPos.pos, spawnPos.rot).GetComponent <CarControl>();
        if (m_Car.m_CarDamage.meshTest)
        {
            m_Car.m_CarDamage.meshTest.Reset(this == _Player);
            m_Car.rigidbody.velocity = m_Car.rigidbody.angularVelocity = Vector3.zero;
        }

        //m_Car = ((GameObject)Instantiate(Resources.Load(path), spawnPos.pos, spawnPos.rot)).GetComponent<CarControl>();
        m_Car.name   = "Player Car " + pv.playerName;
        transformCar = m_Car.tr;
        rigidbody    = m_Car.rigidbody;
        rigidbody.solverIterationCount = 6;
        m_CarSettings           = m_Car.GetComponent <CarSettings>() as CarSettings;
        m_CarSound              = m_Car.GetComponent <CarSound>() as CarSound;
        m_CarSettings.bypassABS = false;
        m_Car.pl = this;
        OnQualityChanged();
        var priority = this == _Player ? 100 : 130;

        foreach (var a in GetComponents <AudioSource>())
        {
            a.priority = priority;
        }
        foreach (var a in m_Car.audioSources)
        {
            a.priority = priority;
        }

        if (IsMine && !bot2)
        {
            _Game.MainCamera.Target = m_Car.tr;
        }
        AmplifyMotionEffect.RegisterRecursivelyS(m_Car.gameObject);
    }
    void LoadCar()
    {
        if (m_Car)
            _Pool.Save(m_Car.gameObject);
        string path = cop ? "police" : owner.carSet.carName;
        Spawn spawnPos = GetSpawnStartPos();
        m_Car = _Pool.Load2(Resources.Load(path), spawnPos.pos, spawnPos.rot).GetComponent<CarControl>();
        if (m_Car.m_CarDamage.meshTest)
        {
            m_Car.m_CarDamage.meshTest.Reset(this == _Player);
            m_Car.rigidbody.velocity = m_Car.rigidbody.angularVelocity = Vector3.zero;
        }

        //m_Car = ((GameObject)Instantiate(Resources.Load(path), spawnPos.pos, spawnPos.rot)).GetComponent<CarControl>();
        m_Car.name = "Player Car " + pv.playerName;
        transformCar = m_Car.tr;
        rigidbody = m_Car.rigidbody;
        rigidbody.solverIterationCount = 6;
        m_CarSettings = m_Car.GetComponent<CarSettings>() as CarSettings;
        m_CarSound = m_Car.GetComponent<CarSound>() as CarSound;
        m_CarSettings.bypassABS = false;
        m_Car.pl = this;
        OnQualityChanged();
        var priority = this == _Player ? 100 : 130;
        foreach (var a in GetComponents<AudioSource>())
            a.priority = priority;
        foreach (var a in m_Car.audioSources)
            a.priority = priority;

        if (IsMine && !bot2)
            _Game.MainCamera.Target = m_Car.tr;
        AmplifyMotionEffect.RegisterRecursivelyS(m_Car.gameObject);
    }