0
Answered

Help with Photon and Bolt

Skloutown 2 years ago updated by William ianneci 2 years ago 5

I want to do this.

public override void OnJoinedLobby()
{
    PhotonNetwork.JoinRandomRoom();
}<br><br>

but i dont have idea how do the public void OnJoinedLobby and I find inside bolt only this


and I add the ONJoinnedLobby but its not work

                   

How I can do that? any solution pls

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Answered

This approach won't work, because Bolt doesn't create new classes and therefore it can't override a member of the parent class like OnJoinedLobby.

My suggestion would be to make a small BoltToPhotonInterop script that does:

public override void OnJoinedLobby()
{ CustomEvent.Trigger(gameObject, "OnJoinedLobby");
}

Then you can add this component to any object with which you want to use Bolt, and use the OnJoinedLobby custom event.

Lazlo, does that mean there is no equivalent to ⬇️ in Bolt and we would have to use custom or is this unique this situation?

public override void

That's right, there is no equivalent to method overriding, because Bolt does not create new types or classes.