예제 #1
0
 private void Timer_Quiz()
 {
     if (start_quiz_timer)
     {
         if (quiz_timer <= time_per_answer)
         {
             UI_timer.GetComponent <Image>().fillAmount = (time_per_answer - quiz_timer) / time_per_answer;
             UI_timer_txt.GetComponent <Text>().text    = Mathf.CeilToInt(Mathf.Clamp(time_per_answer - quiz_timer, 0, time_per_answer)).ToString();
             quiz_timer += Time.deltaTime;
         }
         else
         {
             UI_timer.GetComponent <Image>().fillAmount = 0;
             UI_timer_txt.GetComponent <Text>().text    = "0";
             for (int i = 0; i < UI_btns_a.Length; i++)
             {
                 UI_btns_a[i].GetComponent <Button>().onClick.RemoveAllListeners();
             }
             UI_txt_q.GetComponent <Text>().text = GlobalData.SAVEDQUIZQUESTIONS[d][questions_picked[current_question]].OL;
             StartCoroutine(ActionAfterTimer.Set(2, delegate {
                 UI_txt_q.transform.parent.gameObject.SetActive(false);
                 for (int i = 0; i < UI_btns_a.Length; i++)
                 {
                     UI_btns_a[i].SetActive(false);
                 }
                 QuizAnim_Lose();
             }));
             start_quiz_timer = false;
         }
     }
 }
예제 #2
0
 private void QuizAnim_Appear()
 {
     StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
         UI_txt_q.transform.parent.gameObject.SetActive(true);
     }));
     for (int i = 0; i < UI_btns_a.Length; i++)
     {
         int btn_index = i;
         StartCoroutine(ActionAfterTimer.Set(0.75f + btn_index * 0.15f, delegate {
             UI_btns_a[btn_index].GetComponent <Image>().sprite = answer_possible;
             if (activebuttons[btn_index])
             {
                 UI_btns_a[btn_index].SetActive(true);
             }
             else
             {
                 UI_btns_a[btn_index].SetActive(false);
             }
             if (btn_index == UI_btns_a.Length - 1)
             {
                 start_quiz_timer = true;
                 UI_timer.SetActive(start_quiz_timer);
                 UI_timer_txt.SetActive(start_quiz_timer);
                 quiz_timer = 0;
             }
         }));
     }
 }
예제 #3
0
    // Update is called once per frame
    void Update()
    {
        if (!exploded)
        {
            if (timetoreach <= 0.5f)
            {
                timetoreach += Time.deltaTime;
                //this.transform.position =  Vector3.Lerp(startMarker, endMarker, timetoreach/0.5f);
                Debug.Log("Give range " + this.status.attack_range + " damage " + this.status.damage);

                Collider2D [] enemiescolider = Physics2D.OverlapCircleAll(this.transform.position, this.status.attack_range, 1 << LayerMask.NameToLayer("Enemy"));
                Debug.Log("enemiescollider " + enemiescolider.Length);
                for (int i = 0; i < enemiescolider.Length; i++)
                {
                    enemiescolider[i].gameObject.GetComponent <EnemyControl>().TakeDamage(this.status.damage, 5);
                }
                exploded = true;


                StartCoroutine(ActionAfterTimer.Set(1f, delegate {
                    Destroy(this.transform.gameObject);
                }));
            }
            else
            {
                Destroy(this.transform.gameObject);
            }
        }
    }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     if (activetime <= this.status.attack_duration)
     {
         if (!has_attacked)
         {
             Debug.Log("stopper attack range " + this.status.attack_range);
             Collider2D [] enemiescolider = Physics2D.OverlapCircleAll(this.transform.position, this.status.attack_range, 1 << LayerMask.NameToLayer("Enemy"));
             for (int i = 0; i < enemiescolider.Length; i++)
             {
                 Debug.Log("stopping enemy " + reducedenemyspeedlevel);
                 enemiescolider[i].gameObject.GetComponent <EnemyControl>().Stop(status.damage, GlobalData.Tower4percentslowdown[reducedenemyspeedlevel]);
             }
             if (enemiescolider.Length > 0)
             {
                 StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                     Destroy(this.gameObject);
                     has_attacked = true;
                 }));
             }
         }
         activetime += Time.deltaTime;
     }
     else
     {
         Destroy(this.transform.gameObject);
     }
 }
예제 #5
0
    public void InitLevel()
    {
        tutorialenemy = false;

        string dif = "";

        if (GlobalData.current_difficulty == 0)
        {
            dif = "Fácil";
        }
        else if (GlobalData.current_difficulty == 1)
        {
            dif = "Médio";
        }
        else
        {
            dif = "Difícil";
        }

        //var lvlDifi = GameObject.Find ("InGame").transform.Find ("TD").transform.Find ("LevelText").gameObject.GetComponent<Text> ().text;

        GameObject.Find("InGame").transform.Find("TD").transform.Find("LevelText").gameObject.GetComponent <Text>().text = string.Format("Nível {0} - {1} ", GlobalData.current_level, dif);

        //lvlDifi = string.Format("Nível {0}  -    Dificuldade {1} ",GlobalData.current_level,dif);

        //GameObject.Find("InGame").transform.Find("TD").transform.Find("LevelText").gameObject.GetComponent<Text>().text="Nível "+GlobalData.current_level;


        Time.timeScale = 1;


        GlobalData.LoadLevelMaps(GlobalData.current_difficulty, GlobalData.current_level);
        LoadMap();
        CSVLoadEnemyWaves();
        EnemyWaves();
        Camera.main.GetComponent <CameraControl>().Init(GlobalData.map.GetLength(0),
                                                        GlobalData.difficulty_ymap_size[GlobalData.current_difficulty],
                                                        main_tower_pos);
        PlayerData.level_state = 0;
        UI_InGame = GameObject.Find("Canvas").transform.Find("InGame").gameObject;
        UI_InGame.transform.Find("TD").gameObject.SetActive(true);
        UI_InGame.transform.Find("TD").Find("energy_bar").GetComponent <TDEnergyBar>().Init();

        UI_Tutorial = UI_InGame.transform.Find("Tutorial").gameObject;
        UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").gameObject.SetActive(true);
        UI_Tutorial.transform.Find("Arrows").GetChild(0).gameObject.SetActive(true);
        UI_Tutorial.SetActive(false);
        ingame_tutorial_refs.Clear();
        GlobalData.tutorial_state      = 0;
        GlobalData.enemyatacktower_tut = false;
        baloontutstatestate            = -1;

        StartCoroutine(ActionAfterTimer.Set(7, delegate {
            Debug.Log("changing");
            SoundControl.PlayMusic(GlobalData.Music_Paths[2], true);
            can_start_enemy_waves = true;
        }));
    }
예제 #6
0
    public void TakeDamage(int damage, int fromid)
    {
        if (!ishiding)
        {
            int weakness_multiplies = GlobalData.weakness_enemies[status.type].Contains(fromid)? 2 : 1;

            status.health -= damage;
            SetAnimStatus(2);

            if (status.health <= 0)
            {
                SoundControl.PlaySFX(GlobalData.SFX_Paths[status.type == 0 ? 2 : 4], false, true, true);
                if (status.type == 0)
                {
                    isdead = true;
                    Stop();
                    //TODO Start Defeated Animation
                    SetAnimStatus(3);
                    PlayerData.energy_queue.Add(this.status.energy_bonus);
                    PlayerData.current_score += this.status.energy_bonus;
                }
                else
                {
                    //TODO START Destroyed Animation
                    Stop();
                    SetAnimStatus(3);


                    //Give energy
                    GameObject EnergyParticle = (GameObject)Instantiate(Resources.Load("Prefabs/EnergyParticle"));
                    EnergyParticle.transform.position = this.transform.position;
                    //EnergyParticle.GetComponent<energyparticle>().Init(this.status.energy_bonus);

                    StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                        PlayerData.energy_queue.Add(this.status.energy_bonus);
                        PlayerData.current_score += this.status.energy_bonus;
                        Destroy(this.gameObject);
                    }));
                }
            }
            else
            {
                StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {         //after being hit go back to walking
                    SetAnimStatus(0);
                }));
            }
        }
        //JoaoBarFollow
        EnemyBar.GetComponent <ObjectEnergyBar>().curr_health   = status.health;
        EnemyBar.GetComponent <ObjectEnergyBar>().update_energy = true;
        //JoaoBarFollow
    }
예제 #7
0
    /*void OnGUI(){
     *      if(GUI.Button(new Rect(Screen.width/2, 0, 50, 50), "+map")){
     *              GameObject m = (GameObject)Instantiate(this.gameObject);
     *              m.transform.parent = this.transform.parent;
     *              m.transform.localPosition = new Vector3(0, 0, 20);
     *      }
     * }*/

    void Start()
    {
        int count = 2;

        #if UNITY_IOS && !UNITY_EDITOR
        count = 2;
        #elif UNITY_ANDROID && !UNITY_EDITOR
        count = 1;
        #endif
        for (int i = 0; i < count; i++)
        {
            StartCoroutine(ActionAfterTimer.Set(i, delegate {
                NewMap();
            }));
        }
    }
예제 #8
0
    void Start()
    {
        UI_Tutorial = GameObject.Find("Canvas").transform.Find("InGame").transform.Find("Tutorial").gameObject;

        Debug.Log(this.status.type);
        if (this.status.type == 0)
        {
            GameObject.Find("Canvas").transform.Find("InGame").transform.Find("DarkServerAlert").gameObject.SetActive(true);
            StartCoroutine(ActionAfterTimer.Set(3, delegate {
                GameObject.Find("Canvas").transform.Find("InGame").transform.Find("DarkServerAlert").gameObject.SetActive(false);
            }));
        }

        //JoaoEnemyArrow
        EnemyArrow = this.transform.Find("Arrow").gameObject;
        //JoaoEnemyArrow
    }
예제 #9
0
 void Hiding()
 {
     can_do_action = false;
     ishiding      = !ishiding;
     GetComponent <Collider2D>().enabled = !GetComponent <Collider2D>().enabled;
     if (anim.GetInteger("status") == 0)
     {
         SetAnimStatus(1);
         //GetComponent<SpriteRenderer>().enabled = !GetComponent<SpriteRenderer>().enabled;
     }
     else if (anim.GetInteger("status") == 1 && anim.GetCurrentAnimatorStateInfo(0).IsName("New Layer.4_underground"))
     {
         SetAnimStatus(4);
         StartCoroutine(ActionAfterTimer.Set(0.25f, delegate {
             SetAnimStatus(0);
         }));
     }
 }
예제 #10
0
    void Targetting()
    {
        Collider2D tower = Physics2D.OverlapCircle(transform.position, 2, 1 << LayerMask.NameToLayer("Tower"));

        if (tower != null)
        {
            can_do_action = false;
            Debug.Log("  KILLER RAY TO THE TOWER! KEKEK");
            GameObject weapon = (GameObject)Instantiate(Resources.Load("Prefabs/Weapons/1"));
            weapon.transform.parent   = this.transform;
            weapon.transform.position = this.transform.position;
            weapon.GetComponent <Weapon1Control>().Init(new WeaponStatus(tower.gameObject, status.attack_str), this.transform.position);
            SetAnimStatus(1);
            StartCoroutine(ActionAfterTimer.Set(0.25f, delegate {
                SetAnimStatus(0);
            }));
            //	weapon.transform.GetComponentInChildren<Weapon1Control>().Init();
        }
    }
예제 #11
0
    private void Tutorial_Setup(int tutorial_id)
    {
        TutObjects = UI_Tutorial.transform.Find("TutorialObjects").gameObject.transform.Find("INES_Tutorial").GetComponent <Animator>();
        TutBaloon  = UI_Tutorial.transform.Find("TutorialObjects").gameObject.transform.Find("Baloon").GetComponent <Animator>();
        Debug.Log("Tutorial_Setup" + tutorial_id);
        if (tutorial_id == 0)
        {
            if (this.transform.Find("Enemies").childCount > 0)
            {
                ingame_tutorial_refs.Add(this.transform.Find("Enemies").GetChild(0).gameObject);
                UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), true);

                UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Cuidado! Não deixes os agentes do dark server chegar ao teu computador";
                GlobalData.current_tutorial = tutorial_id;
                on_tutorial = true;
                StartCoroutine(ActionAfterTimer.Set(1, delegate {
                    PlayerData.level_state = 2;
                }));

                UI_Tutorial.SetActive(true);
                TutObjects.SetInteger("state", 1);
                TutBaloon.SetInteger("state", 1);

                StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                    TutBaloon.SetInteger("state", 0);
                }));

                StartCoroutine(ActionAfterTimer.Set(5, delegate {
                    EndTutorial();
                }));
            }
        }
        else if (tutorial_id == 1)
        {
            ingame_tutorial_refs.Add(this.transform.Find("Towers").Find("0").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), true);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Constroi defesas nestas bases de construção";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
            //UI_Tutorial.SetActive(true);
        }
        else if (tutorial_id == 2)
        {
            UI_InGame.transform.Find("TD").Find("TowerSpotsGUIs").gameObject.SetActive(true);
            ingame_tutorial_refs.Add(UI_InGame.transform.Find("TD").Find("energy_bar").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Construir consome energia! Cuidado para não chegares ao zero!";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            //UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
            StartCoroutine(ActionAfterTimer.Set(5, delegate {
                EndTutorial();
            }));
        }
        else if (tutorial_id == 3)
        {
            ingame_tutorial_refs.Add(UI_InGame.transform.Find("TD").Find("TowerSpotsGUIs").Find("tbtns").Find("btn_Tower1").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Toca num botão de uma defesa para construir";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
        }
        else if (tutorial_id == 4)
        {
            ingame_tutorial_refs.Add(this.transform.Find("Towers").Find("0").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), true);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Tocar numa defesa tens a opção para reparar, melhorar e remover";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
        }
        else if (tutorial_id == 5)
        {
            this.transform.Find("Towers").Find("0").GetComponent <TowerSpotControl>().OpenMenu();
            ingame_tutorial_refs.Add(UI_InGame.transform.Find("TD").Find("TowerSpotsGUIs").Find("tbtns").Find("btn_Repair").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Aqui reparas a defesa!";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
        }
        else if (tutorial_id == 6)
        {
            this.transform.Find("Towers").Find("0").GetComponent <TowerSpotControl>().OpenMenu();

            ingame_tutorial_refs.Add(UI_InGame.transform.Find("TD").Find("TowerSpotsGUIs").Find("tbtns").Find("btn_Upgrade").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Neste botão fazes uma melhoria à defesa";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
        }
        else if (tutorial_id == 7)
        {
            this.transform.Find("Towers").Find("0").GetComponent <TowerSpotControl>().OpenMenu();

            ingame_tutorial_refs.Add(UI_InGame.transform.Find("TD").Find("TowerSpotsGUIs").Find("tbtns").Find("btn_Delete").gameObject);
            UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Este botão auto-destroi a tua Torre de defesa";
            GlobalData.current_tutorial = tutorial_id;
            on_tutorial            = true;
            PlayerData.level_state = 2;
            UI_Tutorial.SetActive(true);
            TutBaloon.SetInteger("state", 1);
            StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                TutBaloon.SetInteger("state", 0);
            }));
        }
        else if (tutorial_id == 8)
        {
            //UI_Tutorial.SetActive(false);
            //GlobalData.current_tutorial=tutorial_id;
            GlobalData.TutCanBuildFree = true;
            UI_Tutorial.transform.Find("Arrows").GetChild(0).gameObject.SetActive(false);
            UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").gameObject.SetActive(false);
            TutObjects.SetInteger("state", 2);
            if (this.transform.Find("Enemies").Find("0") != null)
            {
                //Todo Center camera in dark server, red lights and 3 secondslowdown
                //Vector3 DarkServerPos=this.transform.FindChild("Enemies").gameObject.transform.FindChild("0").gameObject.transform.FindChild("Enemy").transform.position;
                //Camera.main.transform.position= new Vector3 (DarkServerPos.x,DarkServerPos.y,-10);
                //

                TutObjects.SetInteger("state", 0);
                TutBaloon.SetInteger("state", 1);
                StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                    TutBaloon.SetInteger("state", 0);
                }));
                UI_Tutorial.transform.Find("Arrows").GetChild(0).gameObject.SetActive(true);
                UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").gameObject.SetActive(true);
                ingame_tutorial_refs.Add(this.transform.Find("Enemies").Find("0").gameObject);
                UI_Tutorial.transform.Find("Arrows").GetChild(0).GetComponent <Tutorial_Arrow>().Init(ingame_tutorial_refs[0], new Vector2(1, 0), true);
                UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").GetChild(0).GetComponent <Text>().text = "Destroi o Dark Server antes que ele te destrua...";

                on_tutorial = true;
                //UI_Tutorial.transform.FindChild("DarkServerAlert").gameObject.SetActive(true);
                UI_Tutorial.SetActive(true);
                StartCoroutine(ActionAfterTimer.Set(3, delegate {
                    //UI_Tutorial.transform.FindChild("DarkServerAlert").gameObject.SetActive(false);
                    TutObjects.SetInteger("state", 3);
                    ingame_tutorial_refs.Clear();
                    PlayerData.level_state = 0;
                    UI_Tutorial.transform.Find("Arrows").GetChild(0).gameObject.SetActive(false);
                    UI_Tutorial.transform.Find("TutorialObjects").transform.Find("Baloon").gameObject.SetActive(false);
                    UI_Tutorial.SetActive(false);

                    /*StartCoroutine(ActionAfterTimer.Set(0.5f, delegate {
                     *      UI_Tutorial.SetActive(false);
                     *      UI_Tutorial.transform.FindChild("Arrows").GetChild(0).gameObject.SetActive(true);
                     *      UI_Tutorial.transform.FindChild("TutorialObjects").transform.FindChild("Baloon").gameObject.SetActive(true);
                     * }));*/
                }));
            }
        }
    }
예제 #12
0
    private void QuizAnim_Picked(int btn_id_picked, int aid)
    {
        start_quiz_timer = false;
        quiz_timer       = 0;
        for (int i = 0; i < UI_btns_a.Length; i++)
        {
            int btn_index = i;
            UI_btns_a[btn_index].GetComponent <Button>().onClick.RemoveAllListeners();
            if (btn_index != btn_id_picked)
            {
                StartCoroutine(ActionAfterTimer.Set(0.25f + btn_index * 0.25f, delegate {
                    UI_btns_a[btn_index].SetActive(false);
                }));
            }
            else
            {
                UI_btns_a[btn_index].GetComponent <Image>().sprite = aid == 0? answer_right : answer_wrong;
            }
        }

        StartCoroutine(ActionAfterTimer.Set(1f, delegate {         //SETTING WRONG OR CORRECT ANSWER
            if (aid == 0)
            {
                correct_questions++;


                int motivrange = Random.Range(0, 3);

                UI_txt_q.GetComponent <Text>().text = GlobalData.SAVEDQUIZQUESTIONS[d][questions_picked[current_question]].OW;



                //StartCoroutine(ActionAfterTimer.Set(2, delegate {
                //UI_txt_q.GetComponent<Text>().text = CorrectAnswer_Motivtext[motivrange];

                StartCoroutine(ActionAfterTimer.Set(1f, delegate {                         //RESETTING GUI and GOING INTO THE NEXT QUESTION
                    UI_txt_q.transform.parent.gameObject.SetActive(false);
                    if (btn_id_picked != -1)
                    {
                        UI_btns_a[btn_id_picked].SetActive(false);
                    }
                    current_question++;
                    SetGUI();
                }));
                //}));
            }
            else
            {
                int motivrange = Random.Range(0, 3);


                UI_txt_q.GetComponent <Text>().text = GlobalData.SAVEDQUIZQUESTIONS[d][questions_picked[current_question]].OL;


                //StartCoroutine(ActionAfterTimer.Set(2, delegate {
                //	UI_txt_q.GetComponent<Text>().text = WrongAnswer_Motivtext[motivrange];

                StartCoroutine(ActionAfterTimer.Set(1f, delegate {
                    UI_txt_q.transform.parent.gameObject.SetActive(false);
                    if (btn_id_picked != -1)
                    {
                        UI_btns_a[btn_id_picked].SetActive(false);
                    }
                    //current_question++;
                    //SetGUI ();
                    QuizAnim_Lose();
                }));
                //}));
            }
        }));
    }