Beispiel #1
0
    void Spawn()
    {
        if (Physics.CheckSphere(transform.position, 1f))
        {
            return;
        }

        var play = Instantiate(player, transform.position, player.transform.rotation);

        //play.GetComponent<Player>().p1 = p1;
        controls.Disable();
        Destroy(gameObject);
    }
Beispiel #2
0
    //public void Spawn()
    //{
    //    var spawner = Instantiate(playerSpawner);
    //    spawner.GetComponent<PlayerSpawner>().p1 = p1;
    //    Destroy(gameObject);
    //}

    public void Pause(bool paused)
    {
        if (paused == true)
        {
            pausedVelocity        = rb.velocity;
            pausedAngularVelocity = rb.angularVelocity;
            controls.Disable();
        }

        rb.isKinematic = paused;

        if (paused == false)
        {
            rb.velocity        = pausedVelocity;
            rb.angularVelocity = pausedAngularVelocity;
            controls.Enable();
        }
    }
Beispiel #3
0
 private void OnDisable()
 {
     carController.Disable();
 }
Beispiel #4
0
 private void OnDisable()
 {
     mainControls.Disable();
 }
Beispiel #5
0
 private void OnDisable()
 {
     controls.Disable();
 }
Beispiel #6
0
 private void OnDisable()
 {
     _controls?.Disable();
 }