本文整理汇总了C#中Room.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Room.Load方法的具体用法?C# Room.Load怎么用?C# Room.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRoom
void CreateRoom()
{
// Create local Room.
var room = new Room("Unity SDK Test Room", null);
StartCoroutine(room.Commit(error =>
{
// Error on Commit.
Debug.LogError(error.Message);
}, success =>
{
// Move onto loading Room.
var searchedRoom = new Room(room.Id);
StartCoroutine(searchedRoom.Load(error =>
{
// Error on Load.
Debug.LogError(error.Message);
}, searchedRoomSuccess =>
{
if (searchedRoom.Title == room.Title)
{
// Load Room proves it's passed here.
Debug.Log("Saving new Room to Spark passed!");
LoadRoom(searchedRoom);
}
}));
}));
}
示例2: Test
void Test(Room room)
{
// Need to load
var searchedRoom = new Room(room.Id);
StartCoroutine(searchedRoom.Load(error =>
{
// Error on Load.
IntegrationTest.Fail(error.Message);
}, searchedRoomSuccess =>
{
if (searchedRoom.Title == room.Title)
{
TearDown(room);
}
}));
}
示例3: DeleteRoom
void DeleteRoom(Room room)
{
StartCoroutine(room.Delete(error =>
{
Debug.Log(error.Message);
}, success =>
{
// Check room was deleted successfully.
var checkDeletedRoom = new Room(room.Id);
StartCoroutine(checkDeletedRoom.Load(error =>
{
Debug.Log("Delete Room passed!");
ListRooms();
}, updateSuccess =>
{
Debug.LogError("Delete Room failed!");
}));
}));
}
示例4: UpdateRoom
void UpdateRoom(Room room)
{
room.Title = "Unity SDK Test Room - Updated";
StartCoroutine(room.Commit(error =>
{
Debug.Log(room.Title);
// Error on Update.
Debug.LogError(error.Message);
}, success =>
{
var checkUpdatedRoom = new Room(room.Id);
StartCoroutine(checkUpdatedRoom.Load(error =>
{
Debug.LogError(error.Message);
}, updateSuccess =>
{
if (checkUpdatedRoom.Title == room.Title)
{
Debug.Log("Update Room passed!");
DeleteRoom(checkUpdatedRoom);
}
}));
}));
}