Beispiel #1
0
    public void SetProperty(string key, object obj)
    {
        if (NetworkManager.IsMasterClient == false)
        {
            Debug.LogWarning($"Attempting to set a room property ({key}) when you are not the master client!");
            //return;
        }

        if (GetProperty <object>(key) == obj)
        {
            // This is already the value on record, so we don't need to do anything, and just return.
            return;
        }

        Photon.SetCustomProperties(new Hashtable()
        {
            { key, obj }
        });
    }