Ejemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        if (closeAttackTypeNormalState == CloseAttackTypeNormalState.attacked)
        {
            return;
        }

        if (other.gameObject.tag == "PlayerSword01")
        {
            hpPostionScript.enemyDamagedAndImageChange(0.2f);
            hpPostionScript.enemyHpDeadCheck();

            if (hpPostionScript.deadOrLive == 1)
            {
                aniScript.deadAniOn();
                Destroy(this.gameObject, 3f);
            }
            else
            {
                closeAttackTypeNormalState = CloseAttackTypeNormalState.attacked;
                Invoke("stateChange", 0.3f);
            }
            return;
        }
        if (other.gameObject.tag == "PlayerSword02")
        {
            hpPostionScript.enemyDamagedAndImageChange(0.5f);
            hpPostionScript.enemyHpDeadCheck();

            if (hpPostionScript.deadOrLive == 1)
            {
                aniScript.deadAniOn();
                Destroy(this.gameObject, 3f);
            }
            else
            {
                closeAttackTypeNormalState = CloseAttackTypeNormalState.attacked;
                Invoke("stateChange", 0.3f);
            }
            return;
        }
        if (other.gameObject.tag == "PlayerSword03")
        {
            hpPostionScript.enemyDamagedAndImageChange(0.8f);
            hpPostionScript.enemyHpDeadCheck();

            if (hpPostionScript.deadOrLive == 1)
            {
                aniScript.deadAniOn();
                Destroy(this.gameObject, 3f);
            }
            else
            {
                closeAttackTypeNormalState = CloseAttackTypeNormalState.attacked;
                Invoke("stateChange", 0.3f);
            }
            return;
        }
    }
Ejemplo n.º 2
0
    public override TaskStatus OnUpdate()
    {
        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            closeAtkEnemy01AniScript = GetComponent <CloseAttackTypeNormalAni>();
            closeAtkEnemy01AniScript.deadAniOn();
            break;

        case "DistanceAttackEnemy01":
            disAtkEnemy01AniScript = GetComponent <DistanceAttackTypeNormalAni>();
            disAtkEnemy01AniScript.deadAniOn();
            break;

        case "Boss_01(Clone)":
            bossAniScript = GetComponent <BossAniScript>();
            bossAniScript.deadAniOn();
            break;
        }

        return(TaskStatus.Failure);
    }