Photon Properties

Options
marf
marf
edited January 2012 in DotNet
Hi, can anybody tell me an example how I can use Properties in my games, according with this:

http://doc.exitgames.com/v3/liteandlitelobbyaddon/liteconcepts

I need to assign a variable and edit his value every time that a player connects into the room.

Marco

Comments

  • Tobias
    Options
    There are actor- and room/game-properties.
    In the dotnet library, you can use OpSetPropertiesOfActor, OpGetPropertiesOfActor or OpSetPropertiesOfGame and OpGetPropertiesOfGame.
    When a player joins a game with properties, those are provided in the join response. These response parameters are used:
    ActorProperties (249)
    A hashtable of actor properties, one key-value per actor in room. The key is the (int) actornumber, value is a hashtable of properties.
    GameProperties (248)
    A hashtable of this room's properties (custom and "pre-defined" ones).

    Also, setting properties offers you the ability to "broadcast" them, which forwards changes to other players in the room.
  • marf
    Options
    I don't understand very weel, if I want to OpSetPropertiesOfGame and setting a number = 1 for the game room what I neeed to do? Can you put some code for example?


    Thanks,

    Marco