Is there an OnPhotonDestroy (similar to OnPhotonInstantiate)

Options
Hey,

Do we get a callback when a netowrked object is detroyed?

I don't see anything here:
http://doc.photonengine.com/en/pun/current/tutorials/instantiation

Thanks,

Answers

  • Tobias
    Options
    Unity will call OnDestroy().
    Can you give us some info on the usecase?
  • gibsnson
    Options
    I have a use case for this :)

    One example is checking things that depend on the PhotonView (e.g. photonView.isMine) - as far as I can tell it's too late to check anything like that about the PhotonView in OnDestroy. Some kind of callback during object destruction where we can still check state on the PhotonView would be ideal.

    I can get around this by memoizing the state that I need (e.g. the owner of the photon view), but it would be more convenient to not need to do this.
  • OneManArmy
    OneManArmy ✭✭✭
    edited May 2019
    Options
    +1

    Edit: Actually it's not required.