Skip to content

Instantly share code, notes, and snippets.

@Shogan
Last active August 29, 2015 14:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Shogan/7bb02ff347cdc94ea069 to your computer and use it in GitHub Desktop.
private void CreateCharacterInTable()
{
var newCharacter = new CharacterEntity
{
CharacterID = Guid.NewGuid().ToString(),
BodySpriteName = selectedBody,
FaceSpriteName = selectedFace,
ShirtSpriteName = selectedShirt,
HairSpriteName = selectedHair,
PantsSpriteName = selectedPants,
ShoesSpriteName = selectedShoes,
Name = nameInput.text,
Age = Int32.Parse(ageInput.text),
Dexterity = Int32.Parse(dexterityInput.text),
Intelligence = Int32.Parse(intelligenceInput.text),
Strength = Int32.Parse(strengthInput.text)
};
// Save the character asynchronously to the table.
Context.SaveAsync(newCharacter, (result) =>
{
if (result.Exception == null)
resultText.text += @"character saved";
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment