Exemplo n.º 1
0
    /// <summary>
    /// Mostly clearing state, and ensuring everything is back to normal
    /// </summary>
    public override void EnterState(SceneManager context, int idx = 0)
    {
        hasLookedConstellation = false;
        VRInput.Instance.ForceReticleColor(new Color(1,1,1,0.5f) );
        advancedTitle.enabled = false;
        advancedIcon.enabled = false;
        ctaTimer = 0;
        switch(idx){

            case -1:
                currentSection = Section.Part1;
                currentTarget = part1Spawn;

                break;

            case 0:
            default:
                currentSection = Section.Part1;
                currentTarget = part1Spawn;
                Blackout.Instance.TargetBlackoutValue = 0;
                break;

            case 1:
                currentSection = Section.Part2;
                currentTarget = part2Spawn;
                Blackout.Instance.TargetBlackoutValue = 0;
                break;

            case 2:
                currentSection = Section.Part3;
                currentTarget = part3Spawn;
                Blackout.Instance.TargetBlackoutValue = 0;
                break;

            case 3:
                currentSection = Section.Part4;
                currentTarget = part4Spawn;
                Blackout.Instance.TargetBlackoutValue = 0;
                break;

            case 4:
                currentSection = Section.Part5;
                currentTarget = part5Spawn;
                Blackout.Instance.TargetBlackoutValue = 0;
                break;

        }
        spawnPoint = orderedList[currentTarget];
        previousAmbientTrack1 = ambientTrack1 = orderedList[currentTarget].AmbientTrack1;
        previousAmbientTrack2 = ambientTrack2 = orderedList[currentTarget].AmbientTrack2;
        SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data,ambientTrack1.targetVolume );
        SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data,ambientTrack2.targetVolume );

        base.EnterState(context);
        if(idx ==-1){
            StartCoroutine(Splash());
        }
        time = currentTime = previousTime = orderedList[currentTarget].TimeOfDay;
        lighting.SetTime(time);
        UpdateTarget(true);
        UpdateSigns(true);
        owlObject.SetActive(false);
        owlBlink = owlAnimation["Blink"];
        owlBlink.layer = 5;
        //owlBlink.blendMode =AnimationBlendMode.Additive;
        owlHoot = owlAnimation["Hoot"];
        owlHoot.layer = 5;
        //owlHoot.blendMode =AnimationBlendMode.Additive;

        owlLook = owlAnimation["Idle_Look"];
        owlLook.layer = 1;
        owlLook2 = owlAnimation["Idle_Look_2"];
        owlLook2.layer = 1;

        Color ctaCol = arrow.material.color;
        ctaCol.a = 0;
        arrow.material.color = ctaCol;

        ctaCol = ctaText.material.color;
        ctaCol.a = 0;
        ctaText.material.color = ctaCol;

        ctaCol = ctaBack.material.color;
        ctaCol.a = 0;
        ctaBack.material.color = ctaCol;
    }
Exemplo n.º 2
0
    public override void DoUpdate(SceneManager context)
    {
        ///Detect which section we are in, selectively disable some parts of the lookdown menu where appropriate
        if (currentTarget < part2Spawn)
        {
            currentSection = Section.Part1;
            nextButton.SetActive(true);
        }
        else if (currentTarget < part3Spawn)
        {
            currentSection = Section.Part2;
            nextButton.SetActive(true);
        }
        else if (currentTarget < part4Spawn)
        {
            currentSection = Section.Part3;
            nextButton.SetActive(true);
        }
        else if (currentTarget < part5Spawn)
        {
            currentSection = Section.Part4;
            nextButton.SetActive(true);
        }
        else
        {
            currentSection = Section.Part5;
            nextButton.SetActive(false);
        }

        ///check the menu buttons
        if (menu.IsClicked)
        {
            SceneManager.Instance.StateTransition(SceneManager.Instance.menuScene, Color.black);
            Debug.Log("menu");
        }
        else if (restart.IsClicked)
        {
            SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, (int)currentSection);
        }
        else if (next.IsClicked)
        {
            SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, (int)currentSection + 1);
        }
        else
        {
            ////Check to see if we are trying to move to a new node
            if (currentTarget > 0)
            {
                int previousTarget = currentTarget - 1;
                if (orderedList[previousTarget].IsClicked)
                {
                    PlayerMover.Instance.SetTargetPosition(orderedList[previousTarget].transform.position, orderedList[previousTarget]);
                    if (PlayerMover.Instance.CurrentTarget == orderedList[previousTarget])
                    {
                        currentTime   = orderedList[previousTarget].TimeOfDay;
                        ambientTrack1 = orderedList[previousTarget].AmbientTrack1;
                        ambientTrack2 = orderedList[previousTarget].AmbientTrack2;

                        previousTime          = orderedList[currentTarget].TimeOfDay;
                        previousAmbientTrack1 = orderedList[currentTarget].AmbientTrack1;
                        previousAmbientTrack2 = orderedList[currentTarget].AmbientTrack2;

                        currentTarget = previousTarget;
                        UpdateTarget(false);
                    }
                }
            }
            if (currentTarget < orderedList.Length - 1)
            {
                int nextTarget = currentTarget + 1;
                if (orderedList[nextTarget].IsClicked)
                {
                    PlayerMover.Instance.SetTargetPosition(orderedList[nextTarget].transform.position, orderedList[nextTarget]);
                    if (PlayerMover.Instance.CurrentTarget == orderedList[nextTarget])
                    {
                        currentTime   = orderedList[nextTarget].TimeOfDay;
                        ambientTrack1 = orderedList[nextTarget].AmbientTrack1;
                        ambientTrack2 = orderedList[nextTarget].AmbientTrack2;

                        previousTime          = orderedList[currentTarget].TimeOfDay;
                        previousAmbientTrack1 = orderedList[currentTarget].AmbientTrack1;
                        previousAmbientTrack2 = orderedList[currentTarget].AmbientTrack2;

                        currentTarget = nextTarget;
                        UpdateTarget(false);
                    }
                }
            }

            ///draw these
            Constellations();

            ///Display the reticle if we look down, and everywhere except the last node, unless you are looking backward (ugh...)
            if ((VRInput.Instance.Pitch) < -30)
            {
                VRInput.Instance.ReticleColor = new Color(1, 1, 1, 0.5f);
            }
            else
            {
                if (currentTarget == orderedList.Length - 1)
                {
                    if (Mathf.Abs(Mathf.DeltaAngle(VRInput.Instance.Yaw, OrientationYaw + orderedList[currentTarget].DefaultOrientation - 90)) > 90)
                    {
                        VRInput.Instance.ReticleColor = new Color(1, 1, 1, 0.5f);
                    }
                    else
                    {
                        VRInput.Instance.ReticleColor = new Color(1, 1, 1, 0f);
                    }
                }
                else
                {
                    VRInput.Instance.ReticleColor = new Color(1, 1, 1, 0.5f);
                }
            }

            ///draw these, too
            UpdateSigns();
            UpdateFlare();


            /// If we're moving between nodes, adjust volume of the ambient audio tracks between the current node and target node.  If the tracks arent the same (e.g. are different clips), we fade one out, and then the other in
            time = PlayerMover.Instance.SmoothedBlend * currentTime + (1 - PlayerMover.Instance.SmoothedBlend) * previousTime;
            if (SoundManager.Instance != null)
            {
                if (ambientTrack1.data == previousAmbientTrack1.data)
                {
                    SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data, ambientTrack1.targetVolume * PlayerMover.Instance.SmoothedBlend + previousAmbientTrack1.targetVolume * (1 - PlayerMover.Instance.SmoothedBlend));
                }
                else
                {
                    if (PlayerMover.Instance.SmoothedBlend < 0.5f)
                    {
                        SoundManager.Instance.SetAmbientTrack(0, previousAmbientTrack1.data, previousAmbientTrack1.targetVolume * 2 * (0.5f - PlayerMover.Instance.SmoothedBlend));
                    }
                    else
                    {
                        SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data, ambientTrack1.targetVolume * 2 * (PlayerMover.Instance.SmoothedBlend - 0.5f));
                    }
                }
                if (ambientTrack2.data == previousAmbientTrack2.data)
                {
                    SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data, ambientTrack2.targetVolume * PlayerMover.Instance.SmoothedBlend + previousAmbientTrack2.targetVolume * (1 - PlayerMover.Instance.SmoothedBlend));
                }
                else
                {
                    if (PlayerMover.Instance.SmoothedBlend < 0.5f)
                    {
                        SoundManager.Instance.SetAmbientTrack(1, previousAmbientTrack2.data, previousAmbientTrack2.targetVolume * 2 * (0.5f - PlayerMover.Instance.SmoothedBlend));
                    }
                    else
                    {
                        SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data, ambientTrack2.targetVolume * 2 * (PlayerMover.Instance.SmoothedBlend - 0.5f));
                    }
                }
            }

            /// fade in the lightbeam if we are at the first or second node, otherwise fade it out
            Color lightCol = lightBeam.material.color;
            if (currentTarget <= 1)
            {
                if (lightCol.a < 1)
                {
                    lightCol.a = Mathf.Clamp01(lightCol.a + Time.deltaTime);
                    lightBeam.material.color = lightCol;
                }
            }
            else
            {
                if (lightCol.a > 0)
                {
                    lightCol.a = Mathf.Clamp01(lightCol.a - Time.deltaTime);
                    lightBeam.material.color = lightCol;
                }
            }

            //// if we are at the first node, and the player hasn't moved in a while, fade in a tutorial message to guide them along
            if (currentTarget == 0)
            {
                ctaTimer += Time.deltaTime;
                if (ctaTimer > 30)
                {
                    Color ctaCol = arrow.material.color;
                    ctaCol.a             = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    arrow.material.color = ctaCol;

                    arrow.transform.localPosition = arrowLocalPos + new Vector3(0, 0.6f * amplitude * Mathf.Sin(frequency * Time.time), 0);

                    ctaCol   = ctaText.material.color;
                    ctaCol.a = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    ctaText.material.color = ctaCol;

                    ctaCol   = ctaBack.material.color;
                    ctaCol.a = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    ctaBack.material.color = ctaCol;
                }
            }
            else
            {
                ctaTimer = 0;
                Color ctaCol = arrow.material.color;
                ctaCol.a             = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                arrow.material.color = ctaCol;

                ctaCol   = ctaText.material.color;
                ctaCol.a = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                ctaText.material.color = ctaCol;

                ctaCol   = ctaBack.material.color;
                ctaCol.a = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                ctaBack.material.color = ctaCol;
            }


            /// just like we blended audio, also blend the lighting from a to b.  lighting takes care of this on it's own
            lighting.SetTime(time);


            /// Owl logic, if we are at the owl place, and it hasn't screeched, and we are looking at the fire, and we aren't transitioning to another node, make the owl appear behind the player and screech - we also want this to keep happening over and over
            /// a bunch more owl logic, too, for all kinds of requests - randomized animation selection, hooting, etc
            if (currentTarget == owlNode && !owlHasScreeched && owlGazeTarget.IsTarget && !PlayerMover.Instance.Moving)
            {
                owlObject.SetActive(true);
                owlAnimation.Play("Idle");
                owlHasScreeched = true;
                owlScreech.Play();
                owlHoot.time    = 0;
                owlHoot.weight  = 1;
                owlHoot.speed   = 1f;
                owlHoot.enabled = true;
            }
            else if (currentTarget == owlNode && owlHasScreeched && owlGazeTarget.IsTargetThisFrame && !PlayerMover.Instance.Moving)
            {
                owlScreech.Play();
                owlHoot.time    = 0;
                owlHoot.weight  = 1;
                owlHoot.speed   = 1f;
                owlHoot.enabled = true;
            }
            if (owlHasScreeched)
            {
                if (Time.time > owlBlinkTimer)
                {
                    if (owlBlink.enabled == false)
                    {
                        //Debug.Log("blink");
                        owlBlink.time    = 0;
                        owlBlink.weight  = 1;
                        owlBlink.speed   = 1.5f;
                        owlBlink.enabled = true;
                        owlBlinkTimer    = Time.time + 0.5f + 9 * Random.value;
                    }
                }
                if (Time.time > owlLookTimer)
                {
                    owlLookTimer = Time.time + 3f + 10 * Random.value;
                    if (owlHoot.enabled == false && owlLook.enabled == false && owlLook2.enabled == false)
                    {
                        float rando = Random.value;
                        if (!justHooted)
                        {
                            justHooted      = true;
                            owlHoot.time    = 0;
                            owlHoot.weight  = 1;
                            owlHoot.speed   = 1f;
                            owlHoot.enabled = true;
                            owlScreech.Play();
                        }
                        else if (rando > 0.5f)
                        {
                            justHooted      = false;
                            owlLook.time    = 0;
                            owlLook.weight  = 1;
                            owlLook.speed   = 1f;
                            owlLook.enabled = true;
                        }
                        else
                        {
                            justHooted       = false;
                            owlLook2.time    = 0;
                            owlLook2.weight  = 1;
                            owlLook2.speed   = 1f;
                            owlLook2.enabled = true;
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
    public override void DoUpdate(SceneManager context)
    {
        ///Detect which section we are in, selectively disable some parts of the lookdown menu where appropriate
        if(currentTarget < part2Spawn){
            currentSection = Section.Part1;
            nextButton.SetActive(true);
        }
        else if(currentTarget < part3Spawn){
            currentSection = Section.Part2;
            nextButton.SetActive(true);
        }
        else if(currentTarget < part4Spawn){
            currentSection = Section.Part3;
            nextButton.SetActive(true);
        }
        else if(currentTarget < part5Spawn){
            currentSection = Section.Part4;
            nextButton.SetActive(true);
        }
        else{
            currentSection = Section.Part5;
            nextButton.SetActive(false);
        }

        ///check the menu buttons
        if(menu.IsClicked){
            SceneManager.Instance.StateTransition(SceneManager.Instance.menuScene, Color.black);
            Debug.Log("menu");
        }
        else if(restart.IsClicked){

            SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene,Color.black, (int)currentSection);
        }
        else if(next.IsClicked){
            SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene,Color.black, (int)currentSection+1);
        }
        else {
            ////Check to see if we are trying to move to a new node
            if(currentTarget > 0){
                int previousTarget = currentTarget-1;
                if(orderedList[previousTarget].IsClicked){

                    PlayerMover.Instance.SetTargetPosition(orderedList[previousTarget].transform.position, orderedList[previousTarget]);
                    if(PlayerMover.Instance.CurrentTarget == orderedList[previousTarget]){

                        currentTime = orderedList[previousTarget].TimeOfDay;
                        ambientTrack1 = orderedList[previousTarget].AmbientTrack1;
                        ambientTrack2 = orderedList[previousTarget].AmbientTrack2;

                        previousTime = orderedList[currentTarget].TimeOfDay;
                        previousAmbientTrack1 = orderedList[currentTarget].AmbientTrack1;
                        previousAmbientTrack2 = orderedList[currentTarget].AmbientTrack2;

                        currentTarget = previousTarget;
                        UpdateTarget(false);
                    }
                }
            }
            if(currentTarget < orderedList.Length-1){
                int nextTarget = currentTarget+1;
                if(orderedList[nextTarget].IsClicked){
                    PlayerMover.Instance.SetTargetPosition(orderedList[nextTarget].transform.position, orderedList[nextTarget]);
                    if(PlayerMover.Instance.CurrentTarget == orderedList[nextTarget]){
                        currentTime = orderedList[nextTarget].TimeOfDay;
                        ambientTrack1 = orderedList[nextTarget].AmbientTrack1;
                        ambientTrack2 = orderedList[nextTarget].AmbientTrack2;

                        previousTime = orderedList[currentTarget].TimeOfDay;
                        previousAmbientTrack1 = orderedList[currentTarget].AmbientTrack1;
                        previousAmbientTrack2 = orderedList[currentTarget].AmbientTrack2;

                        currentTarget = nextTarget;
                        UpdateTarget(false);
                    }

                }

            }

            ///draw these
            Constellations();

            ///Display the reticle if we look down, and everywhere except the last node, unless you are looking backward (ugh...)
            if((VRInput.Instance.Pitch) < -30){
                VRInput.Instance.ReticleColor = new Color(1,1,1,0.5f);
            }
            else{
                if (currentTarget== orderedList.Length-1){
                    if( Mathf.Abs(Mathf.DeltaAngle(VRInput.Instance.Yaw, OrientationYaw + orderedList[currentTarget].DefaultOrientation - 90)) > 90){
                        VRInput.Instance.ReticleColor = new Color(1,1,1,0.5f);
                    }
                    else{
                        VRInput.Instance.ReticleColor = new Color(1,1,1,0f);
                    }

                }
                else{
                    VRInput.Instance.ReticleColor = new Color(1,1,1,0.5f);
                }
            }

            ///draw these, too
            UpdateSigns();
            UpdateFlare();

            /// If we're moving between nodes, adjust volume of the ambient audio tracks between the current node and target node.  If the tracks arent the same (e.g. are different clips), we fade one out, and then the other in
            time = PlayerMover.Instance.SmoothedBlend * currentTime + (1-PlayerMover.Instance.SmoothedBlend) * previousTime;
            if(SoundManager.Instance != null){
                if(ambientTrack1.data == previousAmbientTrack1.data){
                    SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data,ambientTrack1.targetVolume *  PlayerMover.Instance.SmoothedBlend + previousAmbientTrack1.targetVolume *  (1-PlayerMover.Instance.SmoothedBlend) );
                }
                else{
                    if(PlayerMover.Instance.SmoothedBlend < 0.5f){
                        SoundManager.Instance.SetAmbientTrack(0, previousAmbientTrack1.data,previousAmbientTrack1.targetVolume *  2*(0.5f-PlayerMover.Instance.SmoothedBlend) );
                    }
                    else{
                        SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data,ambientTrack1.targetVolume *  2*(PlayerMover.Instance.SmoothedBlend-0.5f) );
                    }

                }
                if(ambientTrack2.data == previousAmbientTrack2.data){
                    SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data,ambientTrack2.targetVolume *  PlayerMover.Instance.SmoothedBlend + previousAmbientTrack2.targetVolume *  (1-PlayerMover.Instance.SmoothedBlend) );
                }
                else{
                    if(PlayerMover.Instance.SmoothedBlend < 0.5f){
                        SoundManager.Instance.SetAmbientTrack(1, previousAmbientTrack2.data,previousAmbientTrack2.targetVolume *  2*(0.5f-PlayerMover.Instance.SmoothedBlend) );
                    }
                    else{
                        SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data,ambientTrack2.targetVolume *  2*(PlayerMover.Instance.SmoothedBlend-0.5f) );

                    }
                }
            }

            /// fade in the lightbeam if we are at the first or second node, otherwise fade it out
            Color lightCol = lightBeam.material.color;
            if(currentTarget <= 1){
                if(lightCol.a < 1){
                    lightCol.a = Mathf.Clamp01(lightCol.a + Time.deltaTime);
                    lightBeam.material.color = lightCol;
                }
            }
            else{
                if(lightCol.a > 0){
                    lightCol.a = Mathf.Clamp01(lightCol.a - Time.deltaTime);
                    lightBeam.material.color = lightCol;
                }
            }

            //// if we are at the first node, and the player hasn't moved in a while, fade in a tutorial message to guide them along
            if(currentTarget == 0){
                ctaTimer += Time.deltaTime;
                if(ctaTimer > 30){
                    Color ctaCol = arrow.material.color;
                    ctaCol.a = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    arrow.material.color = ctaCol;

                    arrow.transform.localPosition = arrowLocalPos + new Vector3(0,0.6f*amplitude*Mathf.Sin(frequency*Time.time),0);

                    ctaCol = ctaText.material.color;
                    ctaCol.a = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    ctaText.material.color = ctaCol;

                    ctaCol = ctaBack.material.color;
                    ctaCol.a = Mathf.Clamp01(ctaCol.a + Time.deltaTime);
                    ctaBack.material.color = ctaCol;
                }
            }
            else{
                ctaTimer = 0;
                Color ctaCol = arrow.material.color;
                ctaCol.a = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                arrow.material.color = ctaCol;

                ctaCol = ctaText.material.color;
                ctaCol.a = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                ctaText.material.color = ctaCol;

                ctaCol = ctaBack.material.color;
                ctaCol.a = Mathf.Clamp01(ctaCol.a - Time.deltaTime);
                ctaBack.material.color = ctaCol;
            }

            /// just like we blended audio, also blend the lighting from a to b.  lighting takes care of this on it's own
            lighting.SetTime(time);

            /// Owl logic, if we are at the owl place, and it hasn't screeched, and we are looking at the fire, and we aren't transitioning to another node, make the owl appear behind the player and screech - we also want this to keep happening over and over
            /// a bunch more owl logic, too, for all kinds of requests - randomized animation selection, hooting, etc
            if(currentTarget == owlNode && !owlHasScreeched && owlGazeTarget.IsTarget && !PlayerMover.Instance.Moving){
                owlObject.SetActive(true);
                owlAnimation.Play("Idle");
                owlHasScreeched = true;
                owlScreech.Play();
                owlHoot.time = 0;
                owlHoot.weight = 1;
                owlHoot.speed = 1f;
                owlHoot.enabled = true;
            }
            else if(currentTarget == owlNode && owlHasScreeched && owlGazeTarget.IsTargetThisFrame && !PlayerMover.Instance.Moving){
                owlScreech.Play();
                owlHoot.time = 0;
                owlHoot.weight = 1;
                owlHoot.speed = 1f;
                owlHoot.enabled = true;
            }
            if(owlHasScreeched){
                if(Time.time > owlBlinkTimer){
                    if(owlBlink.enabled == false){
                        //Debug.Log("blink");
                        owlBlink.time = 0;
                        owlBlink.weight = 1;
                        owlBlink.speed = 1.5f;
                        owlBlink.enabled = true;
                        owlBlinkTimer = Time.time + 0.5f + 9*Random.value;
                    }
                }
                if(Time.time > owlLookTimer){
                    owlLookTimer = Time.time + 3f + 10*Random.value;
                    if(owlHoot.enabled == false && owlLook.enabled == false && owlLook2.enabled == false){
                        float rando = Random.value;
                        if(!justHooted){
                            justHooted =true;
                            owlHoot.time = 0;
                            owlHoot.weight = 1;
                            owlHoot.speed = 1f;
                            owlHoot.enabled = true;
                            owlScreech.Play();
                        }
                        else if(rando > 0.5f){
                            justHooted = false;
                            owlLook.time = 0;
                            owlLook.weight = 1;
                            owlLook.speed = 1f;
                            owlLook.enabled = true;
                        }
                        else{
                            justHooted = false;
                            owlLook2.time = 0;
                            owlLook2.weight = 1;
                            owlLook2.speed = 1f;
                            owlLook2.enabled = true;
                        }
                    }

                }
            }
        }
    }
Exemplo n.º 4
0
    /// <summary>
/// Mostly clearing state, and ensuring everything is back to normal
/// </summary>
    public override void EnterState(SceneManager context, int idx = 0)
    {
        hasLookedConstellation = false;
        VRInput.Instance.ForceReticleColor(new Color(1, 1, 1, 0.5f));
        advancedTitle.enabled = false;
        advancedIcon.enabled  = false;
        ctaTimer = 0;
        switch (idx)
        {
        case -1:
            currentSection = Section.Part1;
            currentTarget  = part1Spawn;

            break;

        case 0:
        default:
            currentSection = Section.Part1;
            currentTarget  = part1Spawn;
            Blackout.Instance.TargetBlackoutValue = 0;
            break;

        case 1:
            currentSection = Section.Part2;
            currentTarget  = part2Spawn;
            Blackout.Instance.TargetBlackoutValue = 0;
            break;

        case 2:
            currentSection = Section.Part3;
            currentTarget  = part3Spawn;
            Blackout.Instance.TargetBlackoutValue = 0;
            break;

        case 3:
            currentSection = Section.Part4;
            currentTarget  = part4Spawn;
            Blackout.Instance.TargetBlackoutValue = 0;
            break;

        case 4:
            currentSection = Section.Part5;
            currentTarget  = part5Spawn;
            Blackout.Instance.TargetBlackoutValue = 0;
            break;
        }
        spawnPoint            = orderedList[currentTarget];
        previousAmbientTrack1 = ambientTrack1 = orderedList[currentTarget].AmbientTrack1;
        previousAmbientTrack2 = ambientTrack2 = orderedList[currentTarget].AmbientTrack2;
        SoundManager.Instance.SetAmbientTrack(0, ambientTrack1.data, ambientTrack1.targetVolume);
        SoundManager.Instance.SetAmbientTrack(1, ambientTrack2.data, ambientTrack2.targetVolume);

        base.EnterState(context);
        if (idx == -1)
        {
            StartCoroutine(Splash());
        }
        time = currentTime = previousTime = orderedList[currentTarget].TimeOfDay;
        lighting.SetTime(time);
        UpdateTarget(true);
        UpdateSigns(true);
        owlObject.SetActive(false);
        owlBlink       = owlAnimation["Blink"];
        owlBlink.layer = 5;
        //owlBlink.blendMode =AnimationBlendMode.Additive;
        owlHoot       = owlAnimation["Hoot"];
        owlHoot.layer = 5;
        //owlHoot.blendMode =AnimationBlendMode.Additive;

        owlLook        = owlAnimation["Idle_Look"];
        owlLook.layer  = 1;
        owlLook2       = owlAnimation["Idle_Look_2"];
        owlLook2.layer = 1;

        Color ctaCol = arrow.material.color;

        ctaCol.a             = 0;
        arrow.material.color = ctaCol;

        ctaCol   = ctaText.material.color;
        ctaCol.a = 0;
        ctaText.material.color = ctaCol;

        ctaCol   = ctaBack.material.color;
        ctaCol.a = 0;
        ctaBack.material.color = ctaCol;
    }