Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Enemy_Time >= Time.time || !CanDoOtherAbility)
        {
            return;
        }
        int phase = Random.Range(0, System.Enum.GetValues(typeof(Boss_Phases)).Length);

        CanDoOtherAbility = false;
        switch (phase)
        {
        case 0:
            phases = Boss_Phases.Spawn;
            break;

        case 1:
            phases = Boss_Phases.Lava;
            break;

        case 2:
            phases = Boss_Phases.Projectiles;
            break;
        }
        DoAbility(phases);
    }
Exemplo n.º 2
0
    private void DoAbility(Boss_Phases phases)
    {
        switch (phases)
        {
        case Boss_Phases.Spawn:
            abilitys[1].enabled = true;
            break;

        case Boss_Phases.Lava:
            abilitys[0].enabled = true;
            break;

        case Boss_Phases.Projectiles:
            abilitys[2].enabled = true;
            break;
        }
        StartCoroutine(Ability(phases));
    }
Exemplo n.º 3
0
    private void Call_Phase(Boss_Phases phases)
    {
        switch (phases)
        {
        case Boss_Phases.Lava:
            abilitys[0].enabled = false;
            RiseLava();
            break;

        case Boss_Phases.Projectiles:
            abilitys[2].enabled = false;
            EmitParticle();
            break;

        case Boss_Phases.Spawn:
            abilitys[1].enabled = false;
            Spawn_Enemy();
            break;
        }
    }
Exemplo n.º 4
0
    private void OnEnable()
    {
        Enemy_Time = Time.time;
        Debug.Log("Starting");
        particle = GameObject.Find("Boss_Particle").GetComponent <ParticleSystem>();
        Debug.Log(particle);
        int phase = Random.Range(0, System.Enum.GetValues(typeof(Boss_Phases)).Length);

        spawn = new Spawns();
        tiles = GameObject.Find("Platforms");
        Debug.Log("Huh");
        tiles.SetActive(false);
        spawn.AddSpawn(GameObject.Find("Spawn1").GetComponent <SpriteRenderer>());
        spawn.AddSpawn(GameObject.Find("Spawn2").GetComponent <SpriteRenderer>());
        spawn.AddSpawn(GameObject.Find("Spawn3").GetComponent <SpriteRenderer>());
        spawn.AddSpawn(GameObject.Find("Spawn4").GetComponent <SpriteRenderer>());
        spawn.AddSpawn(GameObject.Find("Spawn5").GetComponent <SpriteRenderer>());
        abilitys    = new TextMeshPro[3];
        abilitys[0] = GameObject.Find("Lavas").GetComponent <TextMeshPro>();
        abilitys[1] = GameObject.Find("Spawn").GetComponent <TextMeshPro>();
        abilitys[2] = GameObject.Find("Projectiles").GetComponent <TextMeshPro>();

        switch (phase)
        {
        case 0:
            phases = Boss_Phases.Spawn;
            break;

        case 1:
            phases = Boss_Phases.Lava;
            break;

        case 2:
            phases = Boss_Phases.Projectiles;
            break;
        }
        DoAbility(phases);
    }
Exemplo n.º 5
0
    IEnumerator Ability(Boss_Phases phases)
    {
        switch (phases)
        {
        case Boss_Phases.Spawn:
            yield return(new WaitForSeconds(1));

            Call_Phase(phases);
            break;

        case Boss_Phases.Lava:
            yield return(new WaitForSeconds(1));

            Call_Phase(phases);
            break;

        case Boss_Phases.Projectiles:
            yield return(new WaitForSeconds(1));

            Call_Phase(phases);
            break;
        }
        ;
    }