Esempio n. 1
0
    void Start()
    {
        Cursor.visible           = false;
        Time.timeScale           = 1f;
        start_Time               = Time.time;
        number_Of_Red_Enemies    = Red_Enemies.Length;
        number_Of_Blue_Enemies   = Blue_Enemies.Length;
        number_Of_Yellow_Enemies = Yellow_Enemies.Length;
        number_Of_Purple_Enemies = Purple_Enemies.Length;
        number_Of_Green_Enemies  = Green_Enemies.Length;
        number_Of_Orange_Enemies = Orange_Enemies.Length;
        total_Number_Of_Enemies_Left_To_Spawn = number_Of_Red_Enemies + number_Of_Blue_Enemies + number_Of_Yellow_Enemies + number_Of_Purple_Enemies + number_Of_Green_Enemies + number_Of_Orange_Enemies;
        number_Of_Special_Enemies             = number_Of_Purple_Enemies + number_Of_Green_Enemies + number_Of_Orange_Enemies;
        total_Number_Of_Enemies             = total_Number_Of_Enemies_Left_To_Spawn;
        enemies_Remaining                   = total_Number_Of_Enemies_Left_To_Spawn;
        special_Enemy_Start_Point           = total_Number_Of_Enemies_Left_To_Spawn - enemies_Spawned_Until_Special_Enemies;
        local_UI_Manager.current_Combo.text = current_Combo_Count.ToString();
        //current_Objective = objective_GameObjects[current_Active_Objective_Index].gameObject;
        enemies_Left_On_Current_Wave = enemies_Per_Wave;

        int random_Objective = Random.Range(0, 4);

        switch (random_Objective)
        {
        case 0:
            local_Objective_Type = Objective_Type.BLOCK_COLOURED_ATTACKS;
            bonus_Objective      = "Block " + target_Number_Of_Enemies_To_Block + " attacks with the same colour shield";
            break;

        case 1:
            local_Objective_Type = Objective_Type.KILL_SLOWED_ENEMIES;
            bonus_Objective      = "Kill " + target_Number_Of_Slowed_Enemies_To_Kill + " slowed enemies";
            break;

        case 2:
            local_Objective_Type = Objective_Type.LOSE_NO_TOTEMS;
            bonus_Objective      = "Do not let any totems be destroyed";
            break;

        case 3:
            local_Objective_Type = Objective_Type.HIT_A_GROUP_OF_ENEMIES_AT_ONCE;
            bonus_Objective      = "Hit " + number_Of_Enemies_To_Hit_At_Once + " enemies at once with your AOE attack";
            break;
        }

        local_UI_Manager.Bonus_Objective_Text.text = bonus_Objective;

        if (!tutorial_Level)
        {
            StartCoroutine("Delay_Start_Of_Level");
        }

        else
        {
            local_UI_Manager.Display_Current_Level("Level " + SceneManager.GetActiveScene().buildIndex);
            StartCoroutine("Remove_Tutorial_Heading");
        }



        // StartCoroutine("Change_Between_Objectives");

        if (number_Of_Purple_Enemies <= 0)
        {
            purple_Enemies_All_Spawned = true;
        }
        if (number_Of_Green_Enemies <= 0)
        {
            green_Enemies_All_Spawned = true;
        }
        if (number_Of_Orange_Enemies <= 0)
        {
            orange_Enemies_All_Spawned = true;
        }
    }