コード例 #1
0
    private IEnumerator Evocation()
    {
        anim.TriggerAnim("ability");
        yield return(new WaitForSeconds(2f));

        for (int i = 0; i < spawnPoints.Length; i++)
        {
            Instantiate(enemyToSpawn, spawnPoints[i].position, spawnPoints[i].rotation);
        }
    }
コード例 #2
0
    public IEnumerator dieCo()
    {
        animManager.TriggerAnim("die");
        yield return(new WaitForSeconds(3f));

        gameObject.SetActive(false);
    }
コード例 #3
0
    public void goToNextPhase()
    {
        if (currentPhase != bossPhases.end)
        {
            anim.TriggerAnim("hurt");
            currentPhase++;


            switch (currentPhase)
            {
            case bossPhases.phase1: ability.activePhase1(); break;

            case bossPhases.phase2: ability.activePhase2(); break;

            case bossPhases.phase3: ability.activePhase3(); break;

            case bossPhases.end:
                StartCoroutine(endBattle()); break;
            }
        }
    }
コード例 #4
0
    public void goToNextPhase()
    {
        if (currentPhase != phases.end)
        {
            currentPhase++;
            anim.TriggerAnim("hurt");
            switch (currentPhase)
            {
            case phases.phase1: anim.animationPhase(1); break;

            case phases.phase2: anim.animationPhase(2); break;

            case phases.phase3: anim.animationPhase(3); break;

            case phases.end: StartCoroutine(endBattle()); break;
            }
        }
        else
        {
            StartCoroutine(endBattle());
        }
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        if (allert)
        {
            if (!battle)
            {
                battle = true;
                anim.TriggerAnim("intro");
            }

            distanceToPlayer = Vector3.Distance(transform.position, PlayerController.instance.transform.position);
            if (distanceToPlayer <= followRange)
            {
                if (distanceToPlayer > attackrange)
                {
                    speed = Random.Range(0.05f, 0.15f);

                    anim.animationMove(true);
                    transform.position = Vector3.MoveTowards(transform.position, PlayerController.instance.plyerHand.transform.position, speed);
                    //isAttacking = false;
                }
                else
                {
                    if (canAttack)
                    {
                        StartCoroutine(inflictdamage());
                    }
                }
            }
            else
            {
                dontMove();
            }

            transform.LookAt(PlayerController.instance.playerModelChild.transform.position, Vector3.up);
            transform.rotation = Quaternion.Euler(0f, transform.rotation.eulerAngles.y + rotationgrade, 0f);
        }
    }