コード例 #1
0
    private void MountVehicle(DrivingComponent drivingComp)
    {
        Debug.Log("Mounting: " + drivingComp.gameObject.name);

        // Parent player to mount location
        gameObject.transform.SetParent(drivingComp.mountLocation, false);
        gameObject.transform.SetPositionAndRotation(drivingComp.mountLocation.position, drivingComp.mountLocation.rotation);


        playerComp.playerFlags |= PlayerComp.c_MOUNTED;
    }
コード例 #2
0
    // Called from InteractableComponent
    public void DriveVehicle(DrivingComponent drivingComp)
    {
        MountVehicle(drivingComp);

        // Probably set up the driveable vehicle so it can move
    }