本文整理汇总了C#中Hero.setHP方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.setHP方法的具体用法?C# Hero.setHP怎么用?C# Hero.setHP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.setHP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
Hero MyHero = new Hero();
MyHero.setHP(30);
MyHero.setMaxHP(30);
MyHero.setAtk(0);
MyHero.setType(HERO_TYPE.CSE);
Material mat;
if (MyHero.getType() == HERO_TYPE.CSE)
{
mat = (Material)Resources.Load("../Material/" + MyHero.getType() + "HeroMaterial.prefab");
gameObject.GetComponent<Renderer>().material = mat;
}
else if (MyHero.getType() == HERO_TYPE.CITE)
{
mat = (Material)Resources.Load("../Material/" + MyHero.getType() + "HeroMaterial.prefab");
gameObject.GetComponent<Renderer>().material = mat;
}
else if (MyHero.getType() == HERO_TYPE.EE)
{
mat = (Material)Resources.Load("../Material/" + MyHero.getType() + "HeroMaterial.prefab");
gameObject.GetComponent<Renderer>().material = mat;
}
else
{
mat = (Material)Resources.Load("../Material/" + MyHero.getType() + "HeroMaterial.prefab");
gameObject.GetComponent<Renderer>().material = mat;
}
}
示例2: start
internal void start()
{
UI myUI = new UI();
Month currentMonth = Month.November;
Month prevMonth = currentMonth - 1;
Month month = (Month)17;
Hero h = new Hero();
Weapon w = new Weapon();
// Weapon w2 = new Weapon();
Shield s = new Shield();
Monster m = new Monster();
myUI.showText(month.ToString());
// w2.setName("Human slayer");
// w2.setDamage(20);
m.setName("Troll");
// m.setWeapon(w2);
m.setWeapon(w);
// setName Shieldille
s.setName("Troll blocker");
s.setDefence(5);
w.SetName("The Mighty Troll Killer Sword");
w.SetDamage(10);
h.setName("Joona");
h.setHP(24);
h.setWeapon(w);
h.setShield(s);
// setShield
w.SetDamage(0);
w.SetName("This ain't no weapon!");
}