本文整理汇总了C#中CharacterData类的典型用法代码示例。如果您正苦于以下问题:C# CharacterData类的具体用法?C# CharacterData怎么用?C# CharacterData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CharacterData类属于命名空间,在下文中一共展示了CharacterData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createButton
public void createButton()
{
string nick = GameObject.Find ("Canvas/CreatePanel/NickInput/Text").GetComponent<Text> ().text;
if (nick.Length < 3 || Service.db.SelectCount ("FROM characters WHERE name = ?", nick) != 0) {
return;
}
int inicialHealth = 270;
int inicialMana = 130;
CharacterData character = new CharacterData
{
name = nick,
model = "male_01",
position = "",
level = 1,
health = inicialHealth,
maxHealth = inicialHealth,
mana = inicialMana,
maxMana = inicialMana,
money = 234670,
id = Service.db.Id(1)
};
bool sucess = character.create();
if (sucess) {
Menu.Instance.showPanel("MainPanel");
} else {
Debug.Log("Something went wrong");
}
}
示例2: AddBlocks
public void AddBlocks(bool[] blocks, CharacterData characterData)
{
var eyeInBadCondition = manager.GetEyeRoom().GetScoreNegative();
for (var i = 0; i < blocks.Length; i++)
{
if (blocks[i])
{
/*
* Check if we have enough spare blocks in the queue
* otherwise we'll need to make some more.
*/
if (_blockQueue.Count == 0)
QueueUpNewBarBlocks(3);
var block = _blockQueue.Dequeue();
block.characterData = characterData;
// Chance to be bad
if (-eyeInBadCondition > Random.Range(0.0f, 1.0f))
block.newColor = Color.white;
_blocksToAdd.Enqueue(block);
}
else
{
// We add null here so that we can use it as a placeholder for
// an empty block in the column.
_blocksToAdd.Enqueue(null);
}
}
}
示例3: InitEntry
public void InitEntry(int index)
{
if (index < enemies.Count)
enemies[index] = new CharacterData();
else
Debug.Log("index does not exist!");
}
示例4: SetupRenderer
void SetupRenderer(CharacterData data)
{
CharacterView = data.CharacterView.Instantiate();
CharacterView.name = "Skeleton";
CharacterView.transform.SetParent(transform, false);
CharacterView.transform.localPosition = Vector3.zero;
}
示例5: getClone
public CharacterData getClone ()
{
CharacterData characterToReturn = new CharacterData ( myID, name, position[0], position[1], characterValues[CHARACTER_ACTION_TYPE_POWER], characterValues[CHARACTER_ACTION_TYPE_DAMAGE],
characterValues[CHARACTER_ACTION_TYPE_RANGE], characterValues[CHARACTER_ACTION_TYPE_AREA], characterValues[CHARACTER_ACTION_TYPE_ATTACK_RATE], characterValues[CHARACTER_ACTION_TYPE_BUILD_RATE],
characterValues[CHARACTER_ACTION_TYPE_DEMOLISH_RATE], characterValues[CHARACTER_ACTION_TYPE_RAPAIR_RATE], characterValues[CHARACTER_ACTION_TYPE_RESCUING] );
return characterToReturn;
}
示例6: Awake
public override void Awake()
{
base.Awake();
atkAnimKeyFrame = 14;
CharacterData tempData = new CharacterData(new Hashtable(){{"type","pet"},{"hp",1000},{"mspd",170},{"aspd",0},{"atk",0},{"def",30},{"rewardCoins",0},{"rewardExp",0},{"cstk",0},{"evd",0},{"stk",0}});
initData(tempData);
hideHpBar();
}
示例7: createEnemyByType
public static GameObject createEnemyByType(string type, Vector3 pos)
{
GameObject pref = CacheMgr.getEnemyPrb (type) as GameObject;//Resources.Load("enemies/enemy"+type);
GameObject enemyObj = Instantiate (pref, pos, new Quaternion (0, 0, 0, 0)) as GameObject;
Enemy enemyDoc = enemyObj.GetComponent<Enemy> ();
CharacterData characterD = new CharacterData (EnemyDataLib.instance [type] as Hashtable);
enemyDoc.initData (characterD);
return enemyObj;
}
示例8: wizardPageContainer1_Finished
private void wizardPageContainer1_Finished(object sender, EventArgs e)
{
CharacterData cd = new CharacterData();
if (this.comboBox1.SelectedIndex == 0) cd.isMale = true;
else cd.isMale = false;
cd.Name = this.textBox1.Text;
Plr = cd;
Close();
}
示例9: Create
public static Character Create(CharacterData character)
{
var go = GameObject.Instantiate(PrefabSettings.main.characterDisplayPrefab);
go.name = character.name;
var component = go.GetComponent<Character>();
component.characterData = character;
return component;
}
示例10: Create
public static SingleGoalDisplay Create(CharacterData goalCharacter)
{
var go = GameObject.Instantiate(PrefabSettings.main.singleGoalDisplayPrefab);
go.name = goalCharacter.name;
var component = go.GetComponent<SingleGoalDisplay>();
component.goalCharacter = goalCharacter;
return component;
}
示例11: Awake
private void Awake ()
{
if (GetComponent<PlayerInput> () != null) {
isPlayer = true;
}
_characterData = gameObject.GetComponent<CharacterData> ();
GetComponent<Animation> ().Play ();
SetMouth (Random.Range (1, 3));
}
示例12: OnClickChCard
private void OnClickChCard(CharacterData chData)
{
GameObject sceneToSceneData = GameObject.Find("SceneToScene_datas");
sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Clear();
sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chName", chData.chName);
sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chLevel", chData.chLevel.ToString());
sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("chType", chData.chType);
sceneToSceneData.GetComponent<SceneToScene_Data>().gameChDatas.Add("detailScript", chData.detailScript);
SceneManager.LoadSceneAsync("popup_chInfo", LoadSceneMode.Additive);
}
示例13: Awake
public override void Awake()
{
base.Awake();
// id = EnemyMgr.getID();
// EnemyMgr.enemyHash[id] = this;
atkAnimKeyFrame = 13;
CharacterData characterD = new CharacterData(new Hashtable(){{"type","freezeGuyEft"},{ "hp",500},{ "mspd",0},{ "aspd",0},{ "atk",0},{ "def",0},{ "rewardCoins",0},{ "rewardExp",0},{ "cstk",0},{ "evd",0},{ "stk",0}});
initData(characterD);
this.hpBar.hideHpBar();
// MsgCenter.instance.addListener(MsgCenter.FREEZE_DEAD, heroDead);
}
示例14: Start
void Start()
{
db = GlobalVars.database;
db.AddCharacter(new CharacterData("You"));
CharacterData cd = new CharacterData("Sally");
cd.AddTopic(new TopicData("Cookies",topic));
cd.AddAvaliableTopic(0);
db.AddCharacter(cd);
}
示例15: Start
// Use this for initialization
void Start()
{
Team = GameObject.Find("GameControlCenter").GetComponent<CharacterTeam> ();
enTeam = GameObject.Find("EnemyTeam").GetComponent<CharacterTeam> ();
chDT = GameObject.Find ("GameControlCenter").GetComponent<CharacterData> ();
for (int i=0; i<chDT.character.Count; i++)
if (chDT.character[i].chID == ID) {
ch = i;
break;
}
}