Exemplo n.º 1
0
    private void StartPhase4()
    {
        MirrorCrack.SetActive(true);
        CurrentPhase        = Phase.PHASE4;
        phase4Attack        = Phase4Attack.Idle;
        phase4SpawnPosition = Phase4CalculateSpawnPosition();

        Player.GetComponentInChildren <TMPro.TextMeshPro>().text = "Hero";
        var bossName = BossInstance.GetComponentInChildren <TMPro.TextMeshPro>();

        bossName.text = "Shadow";
        var labelPosition = bossName.GetComponent <StopRotation>();

        labelPosition.baseEulerRotation = new Vector3(0, 180, 0);
        labelPosition.offset            = new Vector3(
            -labelPosition.offset.x, labelPosition.offset.y, labelPosition.offset.z);

        BossInstance.SetActive(true);
        bossScript = BossInstance.GetComponent <MonsterLife>();
        bossScript.FadeIn(phase4FadeIn);
        bossScript.MakeBoy();

        GlassFadeOutDuration = GlassFadeOutDuration / 3;
        GlassFadeOutPassed   = 0;
    }
Exemplo n.º 2
0
    private void UpdatePhase4()
    {
        GlassFadeOutPassed += Time.deltaTime;
        GlassSprite.color   = new Color(
            GlassSprite.color.r, GlassSprite.color.g, GlassSprite.color.b,
            Mathf.Lerp(1, 0, GlassFadeOutPassed / GlassFadeOutDuration));

        if (BossInstance == null)
        {
            StartDead();
            CurrentEnemy.SetCurrentEnemyName(" ");
            return;
        }
        if (ArenaEnemySpawner.boysList.Count == 0)
        {
            CurrentEnemy.SetCurrentEnemyName("Shadow");
        }
        switch (phase4Attack)
        {
        case Phase4Attack.Idle:
            idleWaitTime -= Time.deltaTime;
            if (idleWaitTime <= 0)
            {
                phase4Attack     = Phase4Attack.Spawn;
                phase4FadeInLeft = phase4FadeIn;
                Phase4Spawn();
            }
            break;

        case Phase4Attack.Spawn:
            bossScript.FadeIn(phase4FadeIn);
            phase4FadeInLeft -= Time.deltaTime;
            if (phase4FadeInLeft + AfterBossFadeInExtraTime <= 0)
            {
                phase4FadeInLeft = phase4FadeIn;
                phase4Attack     = Phase4Attack.Attack;
            }
            break;

        case Phase4Attack.Attack:
            idleWaitTime = Phase4AfterAttackIdleTime;
            Random360Burst(BurstBulletAmount);
            phase4Attack = Phase4Attack.Idle;
            break;

        default:
            break;
        }
    }