Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to use hooks?

Discussion in 'Multiplayer' started by AllMightyNico, Aug 11, 2015.

  1. AllMightyNico

    AllMightyNico

    Joined:
    Jun 12, 2015
    Posts:
    14
    Hello dear community,

    I'm trying to create a custom lobby in which I want to be able to customize my own LobbyPlayer instances.
    Well, I see that the NetworkLobbyManager callback has some nice callbacks already. But my question is:

    How do I use them? Should I make my own class which derives from NetworkLobbyManager and override the functions? If yes, should I still call the base functions? If no, what's the other way?

    In particular I'd like to use OnLobbyServerSceneLoadedForPlayer for customizing the GamePlayer,
    and beside from that I'd like to get the GameObject returned by OnLobbyServerCreateLobbyPlayer in order to customize my LobbyPlayer. Yet, I can't figure out how to use these funtions.

    Would anyone please tell me how to use it?

    Thanks alot,
    Nicolas
     
  2. AllMightyNico

    AllMightyNico

    Joined:
    Jun 12, 2015
    Posts:
    14
    Ah I just figured it out. Nevermind. But that opens another question, why is the public variable for the LobbyPlayerPrefab a NetworkLobbyPlayer? How do I use it in conjunction with OnLobbyServerCreateLobbyPlayer?