Inheritance: MonoBehaviour
    //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    //If the player presses left click a timer is started then every 15 seconds the message is replaced with a new one
    //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    void Update()
    {
        if (Input.GetButtonDown("Fire1") || tutorialStage >= 1)
        {
            timer += Time.deltaTime;

            tutorialStage     = 1;
            tutorialText.text = "Shoot the Skeletons using the fire1 button";
            Trigger1.SetActive(false);

            if (timer >= 15)
            {
                tutorialText.text = "Skeletons will deal 10 damage to you, When your health is 0, you die!";
            }

            if (timer >= 30)
            {
                tutorialText.text = "Red boxes restore 10hp until you're at 100 again (5% chance per kill) \n" + "Blue boxes give you double XP for 20 seconds (2% chance per kill) \n" +
                                    "These Boxes will be dropped by enemies when they die";
                Trigger2.SetActive(false);
            }

            if (timer >= 45)
            {
                tutorialText.text = "Thers is also a 2% chance per kill for an enemy to drop a nuke, which will kill all curently spawned enemies, giving you a moment to recover";
            }

            if (timer >= 60)
            {
                tutorialText.text = "If you wish to quit the tutorial, press ESC and click main menu. You're welcome to stay in the tutorial for as long as you want";
            }
        }
    }
    void IntroUpdate()
    {
        if (ActiveTimer)
        {
            Timer -= Time.deltaTime;
        }
        if (runningAway)
        {
            RunawayTimer -= Time.deltaTime;
        }

        if (RunawayTimer <= 0.0f && runningAway == true)
        {
            if (EventState == -5)
            {
                Escape5();
            }
            if (EventState == -4)
            {
                Escape4();
            }
            if (EventState == -3)
            {
                Escape3();
            }
            if (EventState == -2)
            {
                Escape2();
            }
            if (EventState == -1)
            {
                Escape1();
            }
        }

        if (Timer <= 0.0f && Start == false)
        {
            Timer = Timer1;
            Guard1_con.PlaySound(Dialogs[0], true);

            if (grabbed == false)
            {
                SCP_UI.instance.ShowTutorial("tutograb");
            }
            Start = true;
        }

        if (grabbed == false && Item == null)
        {
            SCP_UI.instance.ShowTutorial("tutoinv1");
            grabbed = true;
        }



        if (Timer <= 0.0f && StopTimer == false && Start == true)
        {
            if (EventState == -13)
            {
                EVRefuse3();
            }
            if (EventState == -12)
            {
                EVRefuse2();
            }
            if (EventState == -11)
            {
                EVRefuse1();
            }


            if (EventState == 3)
            {
                Scene3();
                StopTimer = true;
            }
            if (EventState == 2)
            {
                Scene2();
            }
            if (EventState == 1)
            {
                Scene1_5();
            }

            if (EventState == 0)
            {
                Scene1();
            }
        }



        if (ActiveTimer2)
        {
            TimerSecondary -= Time.deltaTime;
        }
        if (TimerSecondary <= 0.0f && StopTimer2 == false)
        {
            if (EventState2 == 2)
            {
                AsyncScene_2();
            }
            if (EventState2 == 1)
            {
                AsyncScene_1();
            }
        }



        if (Check1 == true)
        {
            if (Trigger1.GetComponent <BoxTrigger>().GetState())
            {
                Check1      = false;
                ActiveTimer = true;
                Scene1_6();
            }
        }

        if (Check3 == true)
        {
            if (Trigger3.GetComponent <BoxTrigger>().GetState())
            {
                if (!back1)
                {
                    Guard1_con.PlaySound(Dialogs[5], true);
                    back1 = true;
                }
                Guard1_con.ResumePath();
                Guard1_con.StopRota();

                Guard1_con.AnimTrigger(1, false);

                Guard1_con.StopLookAt();
                Guard2_con.ResumePath();

                LastState = EventState;

                Check3      = false;
                Check2      = true;
                ActiveTimer = true;
                runningAway = false;
                EventState  = 3;
            }
        }

        if (Check2 == true)
        {
            if (!Trigger2.GetComponent <BoxTrigger>().GetState() && EventState != -1)
            {
                Guard1_con.StopSound();
                Guard2_con.StopSound();
                EventState = LastState;
                if (!back1)
                {
                    RunawayTimer = 6;
                    Guard1_con.PlaySound(Dialogs[2], true, true);
                }

                if (Conver != -1)
                {
                    StopCoroutine(co);
                    Conver = -1;
                }

                Guard1_con.SetLookAt(playerHead);
                ActiveTimer  = false;
                ActiveTimer2 = false;
                runningAway  = true;

                Guard1_con.SetRota(Player.transform);
                Guard2_con.SetLookAt(playerHead);
                Guard2_con.PausePath();
                Guard1_con.PausePath();

                Check2 = false;
                Check3 = true;
            }
        }

        if (Check4 == true)
        {
            if (Trigger4.GetComponent <BoxTrigger>().GetState())
            {
                Guard1_con.StopPursuit();
                Guard1_con.PlaySound(Gunshot);
                Player.GetComponent <Player_Control>().Death(0);
                GameController.instance.deathmsg = Localization.GetString("deathStrings", "death_intro");
                Check4      = false;
                Check3      = false;
                Check2      = false;
                runningAway = false;
                Guard1_con.AnimTrigger(-1, true);
            }
        }
    }