Example #1
0
    void Start()
    {
        IsSceneOver           = false;
        GameManager.gameScene = GameScene.Ex3;
        HUDManager.instance.SetCamera(Camera.main);
        PauseMenu.instance.SetCamera(GameCamera.UI);

        Player.IsArmed   = true;
        Player.IsMovable = true;

        Curtain.instance.ChangeColor(2f, Curtain.black, Curtain.black_clear);

        emils = new List <EnemyBossEx3>();

        if (isFinalEntered)
        {
            StartCoroutine(FinalPhase());
        }
        else if (isMainLoppEntered)
        {
            for (int i = 0; i < 9; i++)
            {
                bool    newPosition = true;
                Vector3 position    = Vector3.zero;
                while (newPosition)
                {
                    newPosition = false;
                    position    = new Vector3(Random.Range(-11f, 11f), 0f, Random.Range(-8f, 8f));
                    if ((position - Player.instance.transform.position).magnitude <= MapEx3.GRID_SIZE)
                    {
                        newPosition = true;
                    }
                    for (int j = 0; j < i; j++)
                    {
                        if ((position - emils[j].transform.position).magnitude <= MapEx3.GRID_SIZE)
                        {
                            newPosition = true;
                        }
                    }
                }
                EnemyBossEx3 emil = EnemyManager.instance.SetEnemy(emilPrefab, position);
                emils.Add(emil);
                emil.id          = i;
                emil.healthPoint = (int)BOSS_HP;
                HUDManager.instance.AddHPBar(BOSS_ID + emil.id, "????", 0f, 0.06f, 0.06f, emil.transform);
                HUDManager.instance.AutoFadeHPBar(BOSS_ID + emil.id, true);
                HUDManager.instance.ShowHPBar(BOSS_ID + emil.id);
            }
            PlatformDown();
            mainLoopCoroutine = StartCoroutine(MainLoop());
            StartCoroutine(CheckBossStates());
        }
        else
        {
            EmilGhost ghost = Instantiate(ghostPrefab, new Vector3(0f, 0f, 3f), Quaternion.identity);
            ghost.rebirthPosition = new Vector3(0f, 0f, 3f);
            ghost.rebirthTime     = 3f;
            StartCoroutine(PrePhase());
        }
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (!isStable && other.CompareTag("Enemy"))
        {
            bool         broke = false;
            EnemyBossEx3 emil  = other.GetComponent <EnemyBossEx3>();
            if (emil != null && emil.IsAbleToBreak)
            {
                broke = true;
            }
            EnemyFinalEx3 emilFinal = other.GetComponent <EnemyFinalEx3>();
            if (emilFinal != null)
            {
                broke = true;
            }

            if (broke)
            {
                if (MapEx3.instance.IsMoving)
                {
                    MoveUp();
                }
                else
                {
                    MoveDown();
                }
            }
        }
    }
Example #3
0
    IEnumerator PrePhase()
    {
        for (int i = 0; i < 5; i++)
        {
            while (EnemyProtoEx3.deathCount <= i)
            {
                yield return(new WaitForSeconds(0.5f));
            }
            HUDManager.instance.ShowMessage(Message.GetMessage(protoMessage, i));
        }
        yield return(new WaitForSeconds(3f));

        ShowSnowflake(0.4f);
        yield return(new WaitForSeconds(1f));

        ShowSnowflake(0.4f);
        yield return(new WaitForSeconds(1f));

        foreach (EnemyProtoEx3 proto in EnemyProtoEx3.protos)
        {
            EnemyBossEx3 emil = EnemyManager.instance.SetEnemy(emilPrefab, proto.transform.position);
            emils.Add(emil);
            emil.id          = proto.id;
            emil.healthPoint = (int)BOSS_HP;
            HUDManager.instance.AddHPBar(BOSS_ID + emil.id, "????", 0f, 0.06f, 0.06f, emil.transform);
            HUDManager.instance.ShowHPBar(BOSS_ID + emil.id);
            HUDManager.instance.AutoFadeHPBar(BOSS_ID + emil.id, true);
            proto.Burst();
        }
        SoundManager.instance.PlayEfx(Efx.DEATH_ENEMY, Vector3.zero);
        ShowSnowflake(1.5f);
        yield return(new WaitForSeconds(1.5f));

        PlatformDown();
        mainLoopCoroutine = StartCoroutine(MainLoop());
        StartCoroutine(CheckBossStates());
    }