本文整理汇总了C#中Room.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# Room.Commit方法的具体用法?C# Room.Commit怎么用?C# Room.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.Commit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: SetUp
void SetUp()
{
// Create test room.
var room = new Room("Unity SDK Test Room", null);
StartCoroutine(room.Commit(error =>
{
// Error on Commit.
IntegrationTest.Fail("Failed to create test room" + error.Message);
}, success => {
Test(room);
}));
}
示例3: Test
void Test(Room room)
{
// Update the room.
room.Title = "Unity SDK Test Room - Updated";
StartCoroutine(room.Commit(error =>
{
// Error on Commit.
IntegrationTest.Fail(error.Message);
}, success => {
TearDown(room);
}));
}
示例4: Test
void Test()
{
var room = new Room("Unity SDK Test Room", null);
StartCoroutine(room.Commit(error =>
{
// Error on Commit.
IntegrationTest.Fail(error.Message);
}, success =>
{
TearDown(room);
}));
}
示例5: SetUp
void SetUp()
{
// Need a test room.
var room = new Room("Unity SDK Test Room", null);
StartCoroutine(room.Commit(error => {
IntegrationTest.Fail("Failed to create test room: " + error.Message);
}, success => {
// Need a test message.
var testMessage = new Message(room);
testMessage.Text = "Test Message";
StartCoroutine(testMessage.Commit(messageError => {
IntegrationTest.Fail("Failed to create Test Message: " + messageError.Message);
}, messageSuccess => {
Test(testMessage);
}));
}));
}
示例6: SetUp
void SetUp()
{
// We need a test room for the messages.
testRoom = new Room("Unity SDK Test Room", null);
StartCoroutine(testRoom.Commit(error =>
{
IntegrationTest.Fail("Failed to create test room" + error.Message);
}, success =>
{
// Need a message to look for.
testMessage = new Message(testRoom);
testMessage.Text = "Test Message";
StartCoroutine(testMessage.Commit(error =>
{
TearDown();
IntegrationTest.Fail("Failed to create test message: " + error.Message);
}, createMessage =>
{
Test();
}));
}));
}
示例7: CreateMessage
void CreateMessage()
{
// Create Temporary Test Room.
testRoom = new Room("Cisco Spark Unity Test Room", null);
var roomCommit = testRoom.Commit(error =>
{
Debug.LogError("Couldn't create test room: " + error.Message);
}, testRoomCreated =>
{
var testMessage = new Message(testRoom);
testMessage.Text = testMessageContent;
var messageCommit = testMessage.Commit(messageError =>
{
Debug.LogError("Create Message Failed: " + messageError.Message);
}, createMessageSuccess =>
{
GetMessage(testMessage.Id);
});
StartCoroutine(messageCommit);
});
StartCoroutine(roomCommit);
}
示例8: TestStart
void TestStart()
{
// Check people.
if (testPersonid == Person.AuthenticatedUser.Id)
{
Fail("Test person cannot be the authenticated user.");
}
// Need a person and a room first!
person = new Person(testPersonid);
testRoom = new Room("Cisco Spark Unity SDK Test", null);
// Commit Test Room.
StartCoroutine(testRoom.Commit(error =>
{
Fail(error.Message);
}, result =>
{
CreateMembership();
}));
}
示例9: 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);
}
}));
}));
}