public void ExitVehicle() { if (isInVehicle) { isInVehicle = false; canEnterVehicle = true; canEnterPlanet = true; playerMovement.EnableControls(true); playerLook.EnableLook(true); camera.enabled = true; cockpit.UnloadPlayerFromVehicle(); cockpit = null; } }
private void DisablePlayerEntry(GameObject go) { VehicleCockpit vc = go.GetComponentInChildren <VehicleCockpit>(); PlayerController pc = go.GetComponent <PlayerController>(); if (pc == null && vc != null) { pc = vc.GetPlayer(); } if (pc != null) { pc.DisablePlanetEntry(); } }
public void EnterVehicle(GameObject vehicle) { cockpit = vehicle.GetComponentInChildren <VehicleCockpit>(); if (cockpit != null) { isInVehicle = true; canEnterVehicle = false; canEnterPlanet = false; playerMovement.EnableControls(false); playerLook.EnableLook(false); camera.enabled = false; cockpit.LoadPlayerIntoVehicle(gameObject); } }
private void Start() { vehicleCockpit = GetComponentInChildren <VehicleCockpit>(); }