コード例 #1
0
    public void ExitVehicle()
    {
        if (isInVehicle)
        {
            isInVehicle     = false;
            canEnterVehicle = true;
            canEnterPlanet  = true;
            playerMovement.EnableControls(true);
            playerLook.EnableLook(true);
            camera.enabled = true;

            cockpit.UnloadPlayerFromVehicle();
            cockpit = null;
        }
    }
コード例 #2
0
ファイル: PlanetEntry.cs プロジェクト: lawrencezahner/station
    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();
        }
    }
コード例 #3
0
    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);
        }
    }
コード例 #4
0
 private void Start()
 {
     vehicleCockpit = GetComponentInChildren <VehicleCockpit>();
 }