Пример #1
0
    public void BeginNewStage(BossStage stage)
    {
        currentAttackCycle.Clear();
        currentStageData = GetStageData(stage);

        if (currentStageData != null)
        {
            currentStageData.SetUpData();

            foreach (AttackPatternData attackData in currentStageData.AttackPatternData)
            {
                attackData.AttackPattern.playerTransform = playerTransform;
                if (attackData.AttackPattern as PheremoneBlast)
                {
                    if (!pheremoneBlast.gameObject.activeSelf)
                    {
                        pheremoneBlast.gameObject.SetActive(true);
                    }
                    pheremoneBlast.SetUpAbilityData(attackData);


                    currentAttackCycle.Add(pheremoneBlast);
                }
                else if (attackData.AttackPattern as SendSoldiers)
                {
                    if (!sendSoldiers.gameObject.activeSelf)
                    {
                        sendSoldiers.gameObject.SetActive(true);
                    }
                    sendSoldiers.SetUpAbilityData(attackData);
                    currentAttackCycle.Add(sendSoldiers);
                }
                else if (attackData.AttackPattern as AttackDrones)
                {
                    if (!attackDrones.gameObject.activeSelf)
                    {
                        attackDrones.gameObject.SetActive(true);
                    }
                    attackDrones.SetUpAbilityData(attackData);
                    currentAttackCycle.Add(attackDrones);
                }
            }

            if (currentStageData.MaxCycleTime > 0)
            {
                foreach (BaseAttackPattern attackPattern in currentAttackCycle)
                {
                    attackPattern.AttackEnded += NextAttackPattern;
                }
                StartNewCycleStage();
            }
            else
            {
                StartNewStage();
            }
        }
    }
Пример #2
0
    public void BeginStageFinal()
    {
        currentAttackCycle.Clear();
        currentStageData = GetStageData(BossStage.Final);

        if (currentStageData != null)
        {
            currentStageData.SetUpData();

            foreach (AttackPatternData attackData in currentStageData.AttackPatternData)
            {
                attackData.AttackPattern.playerTransform = playerTransform;
                if (attackData.AttackPattern as PheremoneBlast)
                {
                    if (!pheremoneBlast.gameObject.activeSelf)
                    {
                        pheremoneBlast.gameObject.SetActive(true);
                    }
                    pheremoneBlast.SetUpAbilityData(attackData);
                    currentAttackCycle.Add(pheremoneBlast);
                }
                else if (attackData.AttackPattern as SendSoldiers)
                {
                    if (!sendSoldiers.gameObject.activeSelf)
                    {
                        sendSoldiers.gameObject.SetActive(true);
                    }
                    sendSoldiers.SetUpAbilityData(attackData);
                    currentAttackCycle.Add(sendSoldiers);
                }
                else if (attackData.AttackPattern as AttackDrones)
                {
                    if (!attackDrones.gameObject.activeSelf)
                    {
                        attackDrones.gameObject.SetActive(true);
                    }
                    attackDrones.SetUpAbilityData(attackData);

                    currentAttackCycle.Add(attackDrones);
                }
            }

            StartNewStage();
        }
    }