Exemplo n.º 1
0
        public async UniTask CreateRoom(string roomName, string anchorId)
        {
            if (string.IsNullOrWhiteSpace(roomName))
            {
                return;
            }

            var option = RoomUtility.GetCloudRoomTemplate(anchorId);
            await FailureHandlingPhotonTask(PhotoTask.CreateRoom(roomName, option, null), _ =>
            {
                RoomManager.Instance.Model.CreateRoom(roomName);
                RoomManager.Instance.Model.SetAnchorId(anchorId);
            });
        }
Exemplo n.º 2
0
        public async UniTask CreateRoom(string roomName)
        {
            if (string.IsNullOrWhiteSpace(roomName))
            {
                return;
            }

            var option = RoomUtility.GetCloudRoomTemplate(string.Empty);
            await FailureHandlingPhotonTask(PhotoTask.CreateRoom(roomName, option, null), _ =>
            {
                RoomManager.Instance.Model.CreateRoom(roomName);
                if (option.CustomRoomProperties.TryGetValue(RoomDefine.ANCHOR_KEY, out var anchorId))
                {
                    RoomManager.Instance.Model.SetAnchorId(anchorId.ToString());
                }
            });
        }