End a turn before time expires?

Options
Hi there!

I'm working in a turn based questions & answers game. This game has 5 turns of 10 seconds each, where two players (one in each internet side) have to answer a question. If time passes, they loose the opportunity to answer the actual question and a new question appears.

The game uses PUN 2 and now ends turns based on the 10 seconds premise. But I want to end the turn ALSO when the two players answered the question. (Think that the two players resolve the question in 4 seconds. It's a waste of time that they must wait for another 6 seconds...).

How can I achieve that?

Thank you so much for reading :)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @BreynartStudios,

    Thank you for choosing Photon!

    PUN1 has a TurnBased demo.
    While the demo is not in PUN2, the UtilityScripts used are available in PUN2: PunTurnManager, TurnExtensions, IPunTurnManagerCallbacks

    You can get inspiration from PunTurnManager or even use it as is or modified.
  • Thank you so much!! I'll have a look this same afternoon :)
  • SgtCode
    SgtCode
    edited August 2021
    Options
    I fail to see how that bit of documentation can be seen as a demo nor does it answer the question.
  • SgtCode
    SgtCode
    edited August 2021
    Options
    If other people find this, you can end a turn with PhotonNetwork.LocalPlayer.SetFinishedTurn(Turn);