コード例 #1
0
    protected HostileHitbox FindHostileHitBox(string hitBoxName)
    {
        HostileHitbox hitBoxFound = null;

        foreach (HostileHitbox hostileHitBox in hitBoxesToManage)
        {
            if (hostileHitBox.gameObject.name == hitBoxName)
            {
                hitBoxFound = hostileHitBox;
                break;
            }
        }
        return(hitBoxFound);
    }
コード例 #2
0
    public IEnumerator SpearChargeHitBoxAnimation()
    {
        yield return(new WaitForSeconds(1.8f));

        HostileHitbox spearHitBox = hitBoxesToManage[0];

        spearHitBox.hitBoxCollider.enabled = true;
        spearHitBox.hitBoxDamage           = 30f;
        yield return(new WaitForSeconds(1.8f));

        spearHitBox.hitBoxCollider.enabled = false;
        spearHitBox.hitBoxDamage           = 0f;
        yield break;
    }
コード例 #3
0
    public IEnumerator HeadSlamHitBoxAnimation()
    {
        HostileHitbox mouthGuard = FindHostileHitBox("MouthGuard");
        HostileHitbox neckHitBox = FindHostileHitBox("NeckHitBox");

        mouthGuard.hitBoxCollider.enabled = true;
        mouthGuard.hitBoxDamage           = 50f;
        neckHitBox.hitBoxCollider.enabled = true;
        neckHitBox.hitBoxDamage           = 50f;
        yield return(new WaitForSeconds(1.6f));

        mouthGuard.hitBoxCollider.enabled = false;
        mouthGuard.hitBoxDamage           = 0;
        neckHitBox.hitBoxCollider.enabled = false;
        neckHitBox.hitBoxDamage           = 0;
        yield break;
    }