当前位置: 首页>>代码示例>>C#>>正文


C# PlayerHealth.RpcTakeDamage方法代码示例

本文整理汇总了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;
    }
开发者ID:Smlep,项目名称:Illumnia,代码行数:27,代码来源:TrollAttack.cs

示例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);
        }
    }
开发者ID:Smlep,项目名称:Illumnia,代码行数:19,代码来源:CrocoAttack.cs

示例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);
        }
    }
开发者ID:Smlep,项目名称:Illumnia,代码行数:19,代码来源:SqueletteAttack.cs

示例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);
        }
    }
开发者ID:Smlep,项目名称:Illumnia,代码行数:24,代码来源:TrollAttack.cs

示例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;
    }
开发者ID:Smlep,项目名称:Illumnia,代码行数:25,代码来源:RedDemonAttack.cs


注:本文中的PlayerHealth.RpcTakeDamage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。