void Update() { Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position); if (screenPosition.y < 10) { CarCollider.Dead(); //Application.LoadLevel(Application.loadedLevel); } }
// Start is called before the first frame update public override void OnStartAuthority() { car = GetComponentInChildren <Car>(); engine = GetComponentInChildren <CarEngine>(); brakes = GetComponentInChildren <BrakeManager>(); turbo = GetComponentInChildren <Turbo>(); colliders = GetComponentInChildren <CarCollider>(); chat = GetComponent <ChatBehavior>(); chat.enabled = true; car.enabled = true; engine.enabled = true; brakes.enabled = true; turbo.enabled = true; colliders.enabled = true; car.SetEngineOn(true); }