// Start is called before the first frame update
 void Start()
 {
     characterManager = GetComponent <CharacterManager>();
     ATraitSelected  += TraitSelected;
     AStartScenario  += StartCurrentScenario;
     GenerateScenarioQueue();
     currentScenario = scenarioQueue.Peek();
 }
    /* MAGNIFICENT LIST OF BUGS FOR JAKE (LOVE YOU JAKE)
     * WHen spamming space + left click, can still f**k up the typing robot (Maybe fixed?) - yeah haven't been able to replicate
     * Also seem to end up on first scene again when doing that - seems to be fixed. I had added it within the loop and I think it was causing issues
     * also need to disable buttons on characters who are exhausted or dead
     * also need ending scene
     * also jeez this is a lot
     */


    private void GenerateScenarioQueue()
    {
        scenarioQueue.Enqueue(firstScenario);

        if (_DebugBool)
        {
            scenarioQueue.Enqueue(lastScenario);
            return;
        }
        else
        {
            while (scenarioQueue.Count < amountOfScenarios - 1)
            {
                //This was for if only 1 scenario was in the scenario list
                if (scenarioList.Count == 1)
                {
                    scenarioQueue.Enqueue(scenarioList[0]);
                    return;
                }

                ScenarioSO scenario = scenarioList[UnityEngine.Random.Range(0, scenarioList.Count)];
                if (scenarioQueue != null)
                {
                    // This was supposed to create a rest room for the mid game but caused too many issues
                    if (!scenarioQueue.Contains(scenario))
                    {
                        scenarioQueue.Enqueue(scenario);
                    }
                    //{
                    //    if (scenarioQueue.Count == (amountOfScenarios * 0.5f) + 1)
                    //        scenarioQueue.Enqueue(restRoom);
                    //    else
                    //}
                }
                else
                {
                    scenarioQueue.Enqueue(scenario);
                }
            }
        }

        scenarioQueue.Enqueue(lastScenario);
    }
    public void LoadNextScenario()
    {
        scenarioQueue.Dequeue();

        if (scenarioQueue.Count > 0)
        {
            currentScenario = scenarioQueue.Peek();

            if (currentScenario == lastScenario)
            {
                SetContinueButton(false);
                canUseTrait = false;
                StartCurrentScenario();
                endGameButton.SetActive(true);
                return;
            }

            StartCurrentScenario();
        }
    }