Пример #1
0
    public override void Update()
    {
        base.Update();

        if (GameManager.sSingleton.IsBossMakeEntrance())
        {
            return;
        }

        if (delayBeforeAttack != 0)
        {
            mTimer += Time.deltaTime;
            if (mTimer < delayBeforeAttack)
            {
                return;
            }
        }

        if (currActionNum < attackTransList.Count)
        {
            // Handle movement.
            if (mEnemyMovement.enabled == true && currActionNum < mEnemyMovement.movementList.Count && !mEnemyMovement.movementList[currActionNum].isCoroutine)
            {
                mMovementCo = mEnemyMovement.MoveToWayPoint(currActionNum);
                StartCoroutine(mMovementCo);
            }

            List <AttackPattern> currAtkSequence = mFullAtkList[currActionNum];
            for (int i = 0; i < currAtkSequence.Count; i++)
            {
                AttackPattern currAtkType = currAtkSequence[i];
                if (i == 0)
                {
                    currAtkType.StartAttack(UpdateAttack);
                }
                else
                {
                    currAtkType.StartAttack(() => { });
                }
            }

            float hpToMinus         = currAtkSequence[0].hpPercentSkipAtk / 100 * totalHitPoint;
            float hpThresholdToSkip = totalHitPoint - hpToMinus;

            if (currHitPoint <= hpThresholdToSkip)
            {
                for (int i = 0; i < currAtkSequence.Count; i++)
                {
                    currAtkSequence[i].StopCoroutine();
                }
                UpdateAttack();

                BulletManager.sSingleton.TransformEnemyBulsIntoScorePU();
//                BulletManager.sSingleton.DisableEnemyBullets(false);
            }
        }
    }