本文整理汇总了C#中AttackType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AttackType.ToString方法的具体用法?C# AttackType.ToString怎么用?C# AttackType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttackType
的用法示例。
在下文中一共展示了AttackType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getHit
public override void getHit(double damage, AttackType attackType)
{
enemyIsHit = true;
if(attackType == AttackType.Fire){
damage = damage - (int)((damage * .75f));
}
health = health - (int)damage;
Debug.Log (attackType.ToString());
if (health < 0) {
health = 0;
}
}
示例2: GetAttackEffect
public static ParticleSystem GetAttackEffect(TowerType towerType, AttackType attackType)
{
try
{
var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() +
EffectType.Attack);
return new ParticleSystem(effectData);
}
catch //ncrunch: no coverage start, MockContentLoader will have the above lines always pass
{
return FallbackEffects.AttackEffect();
} //ncrunch: no coverage end
}
示例3: GetProjectileEffect
public static ParticleSystem GetProjectileEffect(TowerType towerType, AttackType attackType)
{
try
{
var effectData = ContentLoader.Load<ParticleSystemData>(towerType + attackType.ToString() +
EffectType.Projectile);
var effect = new ParticleSystem(effectData);
foreach (var emitter in effect.AttachedEmitters)
emitter.EmitterData.DoParticlesTrackEmitter = true;
return effect;
}
catch //ncrunch: no coverage start
{
return FallbackEffects.ProjectileEffect();
} //ncrunch: no coverage end
}
示例4: species
public static string species(float size, float weirdChance = 0, float dietChance = 0,
AttackType attType = AttackType.Null, DefenceType defType = DefenceType.Null,
MovementType movType = MovementType.Null, Targets targets = Targets.Null, float speed = 1, int complexity = 0)
{
//TODO: Come up with a name-generating system.
string result = "";
DietType Diet;
if(weirdChance == 0){
weirdChance = Random.value;
}
if(dietChance == 0){
dietChance = Random.value;
}
result += "Fish ";
if(dietChance >= .85){
result += DietType.Omnivore.ToString();
Diet = DietType.Omnivore;
}
else if(dietChance >= .65){
result += DietType.Carnivore.ToString();
Diet = DietType.Carnivore;
}
else{
result += DietType.Herbivore.ToString();
Diet = DietType.Herbivore;
}
result += " ";
if(weirdChance >= 0.9f){
if(Random.value >= 0.5){
//Debug.Log("Flounder");
result += (Random.Range(1f, 1.7f)*size + " ");
result += (Random.Range(0.3f, 0.6f)*size + " ");
result += (Random.Range(1f, 1.7f)*size + " ");
}
else{
//Debug.Log ("Sunfish");
result += (Random.Range(0.3f, 0.6f)*size + " ");
result += (Random.Range(1.6f, 4.5f)*size + " ");
result += (Random.Range(0.8f, 1.7f)*size + " ");
}
}
else{
result += (Random.Range(0.8f, 1.2f)*size + " ");
result += (Random.Range(0.8f, 1.2f)*size + " ");
result += (Random.Range(0.8f, 1.2f)*size + " ");
}
if(attType==AttackType.Null){
attType = determineAttack(Diet);
}
result += attType.ToString() + " ";
if(defType==DefenceType.Null){
defType = determineDefence(Diet);
}
result += defType.ToString() + " ";
if(movType==MovementType.Null){
movType = determineMovement();
}
result += movType.ToString() + " ";
if(targets==Targets.Null){
targets = determineTargets(size, Diet, attType);
}
result += targets.ToString() + " ";
//TODO:Generate Speed
result += (speed);
result += addMods(complexity);
return result;
}