本文整理汇总了C#中Stats.ApplyDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Stats.ApplyDamage方法的具体用法?C# Stats.ApplyDamage怎么用?C# Stats.ApplyDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats.ApplyDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallDamageTo
public bool CallDamageTo(Stats stat, Vector3 hitPos, Vector3 hitNorm) {
return stat.ApplyDamage(this, hitPos, hitNorm);
}
示例2: ItemEvent
public void ItemEvent(Stats pStats)
{
playerStats = pStats;
#region Damage or Heal
if(isHeal)
playerStats.AdjustHealth(healAmount);
if(isDamage)
playerStats.ApplyDamage(damageAmount);
#endregion
#region Health Containers
if(addHealthContainers)
{
for(int i = 0; i < healthToAdd; i++)
{
playerStats.AddHealth();
}
}
if(subHealthContainers)
{
for(int i = 0; i < healthToSub; i++)
{
playerStats.SubHealth();
}
}
#endregion
#region Shields
if(addShields)
{
for(int i = 0; i < shieldsToAdd; i++)
{
playerStats.AddShield();
}
}
if(subShields)
{
for(int i = 0; i < shieldsToSub; i++)
{
playerStats.SubShield();
}
}
#endregion
#region MovementSpeed
if(addMovementSpeed)
{
for(int i = 0; i < movementSpeedToAdd; i++)
{
playerStats.AddMovementSpeed();
}
}
if(subMovementSpeed)
{
for(int i = 0; i < movementSpeedToSub; i++)
{
playerStats.SubMovementSpeed();
}
}
#endregion
#region Damage
if(addDamage)
{
for(int i = 0; i < damageToAdd; i++)
{
playerStats.AddDamage();
}
}
if(subDamage)
{
for(int i = 0; i < damageToSub; i++)
{
playerStats.SubDamage();
}
}
#endregion
#region ProjectileSpeed
if(addProjectileSpeed)
{
for(int i = 0; i < projectileSpeedToAdd; i++)
{
playerStats.AddProjectileSpeed();
}
}
if(subProjectileSpeed)
{
for(int i = 0; i < projectileSpeedtoSub; i++)
{
playerStats.SubProjectileSpeed();
}
}
//.........这里部分代码省略.........
示例3: Attack
IEnumerator Attack()
{
if(!inAttackDelay)
{
//animations[attackAnimation].speed = 1*attackSpeed;
//animations.CrossFade(attackAnimation);
if(hasMelee)
StartCoroutine(CheckAttackHit());
else
{
pStats = myTarget.GetComponent(typeof(Stats)) as Stats;
pStats.ApplyDamage(dmgAmount);
}
StartCoroutine(AttackDelay(attackDelay));
behave = AIBehavior.pursue;
}
behave = AIBehavior.idle;
yield return null;
}