本文整理汇总了C#中PlayerHealth.RpcTakeDamage方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerHealth.RpcTakeDamage方法的具体用法?C# PlayerHealth.RpcTakeDamage怎么用?C# PlayerHealth.RpcTakeDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerHealth
的用法示例。
在下文中一共展示了PlayerHealth.RpcTakeDamage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attackpeudevie
IEnumerator Attackpeudevie()
{
Anim.Play("Attack_02");
// Reset the timer.
timer = 0f;
jouelaniamtiondattaque = true;
yield return new WaitForSeconds(0.6f);
timer = 0f;
// Première partie de l'anim
if (playerHealth.currentHealth > 0&&enemyHealth.currentHealth>0)
{
// ... damage the player.
playerHealth = target.GetComponent<PlayerHealth>();
playerHealth.RpcTakeDamage(attackDamage/3);
}
yield return new WaitForSeconds(1.4f);
timer = 0f;
// Seconde partie de l'anim
if (playerHealth.currentHealth > 0&&enemyHealth.currentHealth>0)
{
// ... damage the player.
playerHealth = target.GetComponent<PlayerHealth>();
playerHealth.RpcTakeDamage(attackDamage / 3);
}
jouelaniamtiondattaque = false;
}
示例2: Attack
float timer; // Timer for counting up to the next attack.
#endregion Fields
#region Methods
void Attack(GameObject target)
{
anim.SetTrigger("Attack");
// Reset the timer.
timer = 0f;
playerHealth = target.GetComponent<PlayerHealth>();
// If the player has health to lose...
if (playerHealth.currentHealth > 0)
{
// ... damage the player.
playerHealth.RpcTakeDamage(attackDamage);
}
}
示例3: Attack
float timer; // Timer for counting up to the next attack.
#endregion Fields
#region Methods
void Attack()
{
Anim.Play("Attack1h1");
// Reset the timer.
timer = 0f;
playerHealth = target.GetComponent<PlayerHealth>();
// If the player has health to lose...
if (playerHealth.currentHealth > 0)
{
// ... damage the player.
playerHealth.RpcTakeDamage(attackDamage);
}
}
示例4: Attackforte
float timer; // Timer for counting up to the next attack.
#endregion Fields
#region Methods
IEnumerator Attackforte()
{
Anim.Play("Attack_01");
// Reset the timer.
timer = 0f;
jouelaniamtiondattaque = true;
yield return new WaitForSeconds(1f);
timer = 0f;
jouelaniamtiondattaque = false;
// If the player has health to lose...
if (playerHealth.currentHealth > 0&&enemyHealth.currentHealth>0)
{
playerHealth = target.GetComponent<PlayerHealth>();
// ... damage the player.
playerHealth.RpcTakeDamage(attackDamage);
}
}
示例5: Attacksimple
float timerforspawn; // Timer entre l'invocation de monstres
#endregion Fields
#region Methods
IEnumerator Attacksimple(GameObject target)
{
Anim.Play("DemPunch");
// Reset the timer.
timer = 0f;
jouelaniamtiondattaque = true;
yield return new WaitForSeconds(0.7f);
timer = 0f;
// Première partie de l'anim
playerHealth = target.GetComponent<PlayerHealth>();
if (playerHealth.currentHealth > 0 && enemyHealth.currentHealth > 0)
{
// ... damage the player.
playerHealth.RpcTakeDamage(attackDamage);
}
yield return new WaitForSeconds(0.3f);
timer = 0f;
jouelaniamtiondattaque = false;
}