本文整理汇总了C#中Buff.getCost方法的典型用法代码示例。如果您正苦于以下问题:C# Buff.getCost方法的具体用法?C# Buff.getCost怎么用?C# Buff.getCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Buff
的用法示例。
在下文中一共展示了Buff.getCost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setActionMsgForBuff
private void setActionMsgForBuff (Buff buff) {
if (buff.isUsed()) {
errorMsgTrans.gameObject.SetActive(false);
actionMsgTrans.gameObject.SetActive(false);
costTrans.localPosition = costPos_1;
} else {
if (!buff.isHavingTargetItem()) {
errorMsg.text = (buff.getBuffItemType() == BuffItemType.SHIELD)? "Надень щит":
(buff.getBuffItemType() == BuffItemType.ARMOR)? "Надень броню":
(buff.getBuffItemType() == BuffItemType.WEAPON)? "Возьми оружие": "Я ХЗ что происходит(";
costTrans.localPosition = costPos_2;
errorMsgTrans.gameObject.SetActive(true);
actionMsgTrans.gameObject.SetActive(false);
minY += .5f;
} else if (Vars.gold >= buff.getCost()) {
actionMsg.text = "Чары";
costTrans.localPosition = costPos_1;
errorMsgTrans.gameObject.SetActive(false);
actionMsgTrans.gameObject.SetActive(true);
} else {
errorMsg.text = "Не хватает монет";
costTrans.localPosition = costPos_2;
actionMsgTrans.gameObject.SetActive(false);
errorMsgTrans.gameObject.SetActive(true);
minY += .5f;
}
}
}
示例2: buyBuff
private void buyBuff (Buff buff) {
Item targetItem = null;
switch (buff.getBuffItemType()) {
case BuffItemType.ARMOR: targetItem = armorHolder.getItem(); break;
case BuffItemType.WEAPON: targetItem = weaponHolder.getItem(); break;
case BuffItemType.SHIELD: targetItem = shieldHolder.getItem(); break;
default: Debug.Log("Unknown Buff itemtype"); break;
}
if (Vars.gold >= buff.getCost() && !buff.isUsed() && targetItem != null) {
targetItem.addToBuffs(buff);
buff.setUsed(true);
Vars.gold -= buff.getCost();
UserInterface.updateGold();
}
}
示例3: showDescription
public void showDescription(Buff buff) {
this.buff = buff;
BuffType buffType = buff.getBuffType();
nameValue.text = buffType.getName();
stat_2.text = "";
stat_1.text = buffType.getEffectName().Replace("?", buff.getEffectValue().ToString());
body.localPosition = bodyPosStat_1;
description.transform.localPosition = descriptPos_1;
quality.gameObject.SetActive(false);
description.text = buff.getDescription();
costText.text = buff.getCost().ToString();
stretchBody();
setActionMsgForBuff(buff);
onScreen = true;
Update();
gameObject.SetActive(true);
}