本文整理汇总了C#中CharacterData类的典型用法代码示例。如果您正苦于以下问题:C#CharacterData类的具体用法?C#CharacterData怎么用?C#CharacterData使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:createButton
publicvoidcreateButton()
{
stringnick=GameObject.Find("Canvas/CreatePanel/NickInput/Text").GetComponent
().text;
if(nick.Length<3||Service.db.SelectCount("FROMcharactersWHEREname=?",nick)!=0){
return;
}
intinicialHealth=270;
intinicialMana=130;
CharacterDatacharacter=newCharacterData
{
name=nick,
model="male_01",
position="",
level=1,
health=inicialHealth,
maxHealth=inicialHealth,
mana=inicialMana,
maxMana=inicialMana,
money=234670,
id=Service.db.Id(1)
};
boolsucess=character.create();
if(sucess){
Menu.Instance.showPanel("MainPanel");
}else{
Debug.Log("Somethingwentwrong");
}
}
原文链接:http://www.jxszl.com/biancheng/C/556726.html