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); }
//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(); } }
private void OnDisable() { carController.Disable(); }
private void OnDisable() { mainControls.Disable(); }
private void OnDisable() { controls.Disable(); }
private void OnDisable() { _controls?.Disable(); }