Пример #1
0
    public override void OnStart()
    {
        startTime             = Time.time;
        thisGameObjName.Value = this.gameObject.name;

        if (targetTag == null)
        {
            targetTag = "Player";
        }
        targetTransform = GameObject.FindGameObjectWithTag(targetTag).transform;
        target.Value    = targetTransform;

        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            enemyHpPosionScript         = GetComponent <EnemyHpPostionScript>();
            closeAttackEnemyaniScript01 = GetComponent <CloseAttackTypeNormalAni>();
            closeAttackEnemyaniScript01.enemyPattern = CloseAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "DistanceAttackEnemy01":
            enemyHpPosionScript            = GetComponent <EnemyHpPostionScript>();
            distanceAttackEnemyaniScript01 = GetComponent <DistanceAttackTypeNormalAni>();
            distanceAttackEnemyaniScript01.enemyPattern = DistanceAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "Boss_01(Clone)":
            boss01HpPostionScript = GetComponent <Boss01HpPostionScript>();
            bossAniScript         = GetComponent <BossAniScript>();
            //closeAttackEnemyaniScript01.enemyPattern = CloseAttackEnemyType01AtkPattern.patternIdle;
            break;
        }
    }
    public override TaskStatus OnUpdate()
    {
        if (Vector3.Distance(transform.position, target.Value.position) <= checkDistance)
        {
            return(TaskStatus.Failure);
        }

        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            closeAttackEnemyAni = GetComponent <CloseAttackTypeNormalAni>();
            closeAttackEnemyAni.aniSet("Rest");
            break;

        case "DistanceAttackEnemy01":
            distanceAttackAni = GetComponent <DistanceAttackTypeNormalAni>();
            distanceAttackAni.aniSet("Rest");
            break;

        case "Boss_01(Clone)":
            bossAni = GetComponent <BossAniScript>();
            break;
        }

        return(TaskStatus.Success);
    }
Пример #3
0
    public override void OnStart()
    {
        aniScript         = GetComponent <CloseAttackTypeNormalAni>();
        hpPostionScript   = GetComponent <EnemyHpPostionScript>();
        colliderConScript = GetComponent <CloseAttackTypeNormalColliderCon>();

        closeAttackTypeNormalColliderCon = GetComponent <CloseAttackTypeNormalColliderCon>();
    }
 public override void OnStart()
 {
     if (Vector3.Distance(transform.position, target.Value.position) > isFarOrCloseDistance)
     {
         numOfPattern.Value = 2;
     }
     startTime         = Time.time;
     aniScript         = GetComponent <CloseAttackTypeNormalAni>();
     hpPostionScript   = GetComponent <EnemyHpPostionScript>();
     colliderConScript = GetComponent <CloseAttackTypeNormalColliderCon>();
 }
    private void Start()
    {
        isStun   = false;
        isAttack = false;
        trap01   = false;

        aniScript          = GetComponent <CloseAttackTypeNormalAni>();
        hpPostionScript    = GetComponent <EnemyHpPostionScript>();
        weaponColConScript = GetComponent <WeaponColliderCon>();
        IsAttackedState    = CloseAttackEnemy01IsAttacked.idle;

        camShackManagerScript = GameObject.Find("PlayerCamManager").GetComponent <PlayerCamManager>();
        timeManagerScript     = GameObject.Find("TimeManager").GetComponent <TimeManager>();
    }
Пример #6
0
    private void Start()
    {
        enemyTransform  = GetComponent <Transform>();
        playerTransform = GameObject.FindGameObjectWithTag("Player").transform;
        aniScript       = GetComponent <CloseAttackTypeNormalAni>();
        hpPostionScript = GetComponent <EnemyHpPostionScript>();

        enemyPattern = CloseAttackTypeNormalPattern.patternZero;
        closeAttackTypeNormalState = CloseAttackTypeNormalState.idle;

        trap01 = false;
        weaponCollider.enabled = false;
        enemyDistanceCheck     = false;
        StartCoroutine("WaitForPlayer");
    }
Пример #7
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);
    }
    public override void OnStart()
    {
        startTime             = Time.time;
        thisGameObjName.Value = this.gameObject.name;

        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            closeAttackEnemyaniScript01 = GetComponent <CloseAttackTypeNormalAni>();
            closeAttackEnemyaniScript01.enemyPattern = CloseAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "DistanceAttackEnemy01":
            distanceAttackEnemyaniScript01 = GetComponent <DistanceAttackTypeNormalAni>();
            distanceAttackEnemyaniScript01.enemyPattern = DistanceAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "Boss_01(Clone)":
            bossAniScript = GetComponent <BossAniScript>();
            //closeAttackEnemyaniScript01.enemyPattern = CloseAttackEnemyType01AtkPattern.patternIdle;
            break;
        }
    }
Пример #9
0
    public override TaskStatus OnUpdate()
    {
        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            if (Vector3.Distance(transform.position, target.Value.position) <= isFarOrCloseDistance)
            {
                numOfPattern.Value = 1;
            }
            if (Vector3.Distance(transform.position, target.Value.position) > isFarOrCloseDistance)
            {
                numOfPattern.Value = 2;
            }

            closeAttackEnemyAniScript01 = GetComponent <CloseAttackTypeNormalAni>();
            closeAttackEnemyAniScript01.enemyPattern = CloseAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "DistanceAttackEnemy01":
            //  따라가기
            if (Vector3.Distance(transform.position, target.Value.position) > isFarOrCloseDistance + 3)
            {
                numOfPattern.Value = 1;
            }
            //   공격
            if (Vector3.Distance(transform.position, target.Value.position) <= isFarOrCloseDistance + 3)
            {
                numOfPattern.Value = 2;
            }

            distanceAttackEnemyAniScript01.enemyPattern = DistanceAttackEnemyType01AtkPattern.patternIdle;
            break;

        case "Boss_01(Clone)":

            if (Vector3.Distance(transform.position, target.Value.position) < 7f)
            {
                ifClosePatternChoiceBoss01();
            }
            else
            {
                ifFarPatternChoiceBoss01();
            }

            switch (numOfPattern.Value)
            {
            case 2:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern02;
                break;

            case 3:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern03;
                break;

            case 4:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern04;
                break;

            case 5:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern05;
                break;

            case 6:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern06;
                break;

            case 7:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern07;
                break;

            case 8:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern08;
                break;

            case 9:
                bossAniScript01.bossPatternStorageToCheckLastOneState = BossPatternStorageToCheckLastOne.pattern09;
                break;
            }
            break;
        }

        return(TaskStatus.Success);
    }
Пример #10
0
    public override void OnStart()
    {
        hpPostionScript = GetComponent <EnemyHpPostionScript>();

        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            closeAttackEnemyAniScript01 = GetComponent <CloseAttackTypeNormalAni>();
            break;

        case "DistanceAttackEnemy01":
            distanceAttackEnemyAniScript01 = GetComponent <DistanceAttackTypeNormalAni>();
            break;

        case "Boss_01(Clone)":
            bossAniScript01 = GetComponent <BossAniScript>();
            for (int i = 1; i < 10; i++)
            {
                float num = 0;
                switch (i)
                {
                case 1:
                    num = 8f;
                    break;

                case 2:
                    num = 3f;
                    break;

                case 3:
                    num = 2f;
                    break;

                case 4:
                    num = 2f;
                    break;

                case 5:
                    num = 2f;
                    break;

                case 6:
                    num = 2f;
                    break;

                case 7:
                    num = 1.5f;
                    break;

                case 8:
                    num = 1.6f;
                    break;

                case 9:
                    num = 2f;
                    break;
                }

                bossAttackDistancePattern[i] = num;
            }
            break;
        }
    }
    public override void OnStart()
    {
        velo = Vector3.zero;

        startTime  = Time.time;
        randomTime = Random.Range(minRandomTime, maxRandomTime);

        switch (thisGameObjName.Value)
        {
        case "CloseAttackEnemy01":
            hpPostionScript = GetComponent <EnemyHpPostionScript>();
            closeAttackTypeNormalColliderCon = GetComponent <CloseAttackTypeNormalColliderCon>();
            closeAttackEnemyaniScript        = GetComponent <CloseAttackTypeNormalAni>();
            closeAttackEnemyaniScript.aniSet("Reset_Ani");
            break;

        case "DistanceAttackEnemy01":
            distanceAttackEnemyaniScript = GetComponent <DistanceAttackTypeNormalAni>();
            distanceAttackEnemyaniScript.aniSet("Reset_Ani");
            break;

        case "Boss_01(Clone)":
            boss01ColliderCon       = GetComponent <Boss01ColliderCon>();
            bossAniScript01         = GetComponent <BossAniScript>();
            weaponColliderConScript = GetComponent <WeaponColliderCon>();

            weaponColliderConScript.weaponColliderOff();

            for (int i = 1; i < 10; i++)
            {
                float num = 0;
                switch (i)
                {
                case 1:
                    num = 8f;
                    break;

                case 2:
                    num = 3f;
                    break;

                case 3:
                    num = 2f;
                    break;

                case 4:
                    num = 2f;
                    break;

                case 5:
                    num = 2f;
                    break;

                case 6:
                    num = 2f;
                    break;

                case 7:
                    num = 1.5f;
                    break;

                case 8:
                    num = 1.6f;
                    break;

                case 9:
                    num = 2f;
                    break;
                }

                bossAttackDistancePattern[i] = num;
            }
            break;
        }
    }