void SetPlayerProperty()
        {
            if (customPropertyValue == null)
            {
                LogError("customPropertyValue is null ");
                return;
            }

            PhotonPlayer _player = PhotonNetwork.player;

            ExitGames.Client.Photon.Hashtable _prop = new ExitGames.Client.Photon.Hashtable();
            Log(" set key " + customPropertyKey.Value + "=" + PlayMakerPhotonProxy.GetValueFromFsmVar(this.Fsm, customPropertyValue));

            _prop[customPropertyKey.Value] = PlayMakerPhotonProxy.GetValueFromFsmVar(this.Fsm, customPropertyValue);
            _player.SetCustomProperties(_prop);
        }
Ejemplo n.º 2
0
        void SetRoomProperty()
        {
            Room _room     = PhotonNetwork.room;
            bool _isInRoom = _room != null;

            if (!_isInRoom)
            {
                Fsm.Event(failureEvent);
                return;
            }

            ExitGames.Client.Photon.Hashtable _prop = new ExitGames.Client.Photon.Hashtable();

            _prop[customPropertyKey.Value] = PlayMakerPhotonProxy.GetValueFromFsmVar(this.Fsm, customPropertyValue);
            _room.SetCustomProperties(_prop);
            Fsm.Event(successEvent);
        }
Ejemplo n.º 3
0
        public override void OnEnter()
        {
            string _roomName = null;

            if (!string.IsNullOrEmpty(roomName.Value))
            {
                _roomName = roomName.Value;
            }


            ExitGames.Client.Photon.Hashtable _props = new ExitGames.Client.Photon.Hashtable();

            int i = 0;

            foreach (FsmString _prop in customPropertyKey)
            {
                _props[_prop.Value] = PlayMakerPhotonProxy.GetValueFromFsmVar(this.Fsm, customPropertyValue[i]);
                i++;
            }


            string[] lobbyProps = new string[lobbyCustomProperties.Length];

            int j = 0;

            foreach (FsmString _visibleProp in lobbyCustomProperties)
            {
                lobbyProps[j] = _visibleProp.Value;
                j++;
            }

            PhotonNetwork.CreateRoom(_roomName, isVisible.Value, isOpen.Value, maxNumberOfPLayers.Value, _props, lobbyProps);


            Finish();
        }