本文整理汇总了C#中Buff.getBuffItemType方法的典型用法代码示例。如果您正苦于以下问题:C# Buff.getBuffItemType方法的具体用法?C# Buff.getBuffItemType怎么用?C# Buff.getBuffItemType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Buff
的用法示例。
在下文中一共展示了Buff.getBuffItemType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: 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;
}
}
}