'PhotonNetwork' does not contain a definition for 'Playerlist'

Options
The script is using the namespaces; Photon.PUN and Photon.Realtime. PhotonNetwork can't recognize 'Playerlist' I wonder what can cause this issue.
pun.jpg

Comments

  • M4TT
    Options
    Yo
    You should have tried to show potential fixes it may have told you that it's not Playerlist but PlayerList
    ‎‎‎‎‎‎‎‎‏‏
  • bysammy
    Options
    I already tried alternative spellings. Potential fixes are all about generating fields and properties.
    Any ideas?
    pun2.jpg
  • M4TT
    M4TT
    edited January 2020
    Options
    Actually weird
    Could you go at line 365 of PhotonNetwork class? It should be this definition for PlayerList
    /// <summary>
    /// A sorted copy of the players-list of the current room. This is using Linq, so better cache this value. Update when players join / leave.
    /// </summary>
    public static Player[] PlayerList
    {
        get
        {
            Room room = CurrentRoom;
            if (room != null)
            {
                // TODO: implement more effectively. maybe cache?!
                return room.Players.Values.OrderBy((x) => x.ActorNumber).ToArray();
            }
            return new Player[0];
        }
    }
    
  • bysammy
    Options
    That was weird indeed. The exact same definition of PlayerList exists in PhotonNetwork class; but is defined as 'player'. I wonder what could have caused this alteration in the name only while the content remains the same. Anyway, glad it's resolved.
    pun3.jpg