IEnumerator MorpheusTransition()
    {
        float stretch = Shader.GetGlobalFloat("_GlobalStretch");

        yield return(this.xuTween((float t) =>
        {
            Shader.SetGlobalFloat("_LevelAmt", t);
        }, 7f));

        portalOfAnswerMat.gameObject.GetComponent <MeshFilter>().sharedMesh.bounds = new Bounds(Vector3.zero, Vector3.one * 400f);

        this.xuTween((float t) =>
        {
            portalOfAnswerMat.material.SetFloat("_growth", t);
            foreach (var audio in envAudios)
            {
                audio.pitch = 1f - 0.75f * t;
            }
            Time.timeScale = 1f - 0.5f * t;
        }, 15f);

        iceCrack.PlayDelayed(2f);

        yield return(new WaitForSeconds(8f));

        yield return(this.xuTween((float t) =>
        {
            float eT = Easing.Cubic.In(t);
            portalOfAnswerMat.material.SetFloat("_holeDiameter", 0.314f * eT);
            Shader.SetGlobalFloat("_GlobalStretch", stretch + 1f * t);
        }, 10f));

        bool  setFog   = false;
        float holeDiam = 0.314f;

        yield return(this.xuTween((float t) =>
        {
            if (t > 0.04 && !setFog)
            {
                RenderSettings.fogColor = Color.black;
                setFog = true;
            }
            Vector3 pos = CCPlayer.main.transform.position;
            pos.y -= (4f + 3f * t) * 2f * Time.deltaTime;
            CCPlayer.main.transform.position = pos;

            Shader.SetGlobalFloat("_GlobalStretch", stretch + 1f * t + 1f);
            holeDiam += 2f * Time.deltaTime / (10f + 1000 * t);
            portalOfAnswerMat.material.SetFloat("_holeDiameter", holeDiam);
            RenderSettings.fogDensity = 0.003f + 0.1f * t;
        }, 7f));

        portalOfAnswerMat.gameObject.SetActive(false);
        Time.timeScale = 1f;
        CCSceneUtils.instance.StartCoroutine(CCSceneUtils.DoFadeSceneLoadCoroutine("UnderWorldScene", "CrowdScene"));

        yield return(0);
    }
Пример #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(instance);
            instance = this;
        }
#if !UNITY_EDITOR
        SceneManager.LoadScene(startScene, LoadSceneMode.Additive);
#endif
    }
    IEnumerator EndScene()
    {
        Landing.Play();
        CCPlayer.main.useGravity = false;
        //fade in the beep sound
        FlatlineBeep.Play();
        float startingWindVol = Wind.volume;

        this.xuTween((float t ) => {
            FlatlineBeep.volume = 0.5f * t;
            Wind.volume         = Mathf.Lerp(startingWindVol, 0, t);
        }, 4f);
        yield return(new WaitForSeconds(3f));

        finalRope.gameObject.SetActive(true);
        Vector3 ropeEndPos = CCPlayer.main.head.transform.position + 2f * CCPlayer.main.head.forward.withY(0);

        finalRope.position = ropeEndPos.withY(CCPlayer.main.head.position.y - 0.75f);
        finalRope.rotation = Quaternion.LookRotation(CCPlayer.main.head.transform.forward.withY(0).normalized);
        RopeDrop.Play();

        yield return(new WaitForSeconds(7f));

        // wait until they grabbed the object atleast once
        StationaryGrabbableObject g = finalRopeEnd.GetComponent <StationaryGrabbableObject>();

        while (g.grabber[0] == null && g.grabber[1] == null)
        {
            yield return(0f);
        }
        while (Vector3.SqrMagnitude(finalRopeEnd.position - CCPlayer.main.head.position) > 0.25f)
        {
            yield return(0);
        }

        Vector3 startingVoxelPos = CCPlayer.main.head.position.withY(CCPlayer.main.head.position.y - 1f);

        finalVoxel.gameObject.SetActive(true);
        ShaderEnvProps.instance.RecordGlobalPulse(CCPlayer.main.head.position);

        SuckInSound.pitch = 0.33f;
        SuckInSound.Play();
        this.xuTween((float t) => {
            float cubicT = Easing.Cubic.In(t);
            finalVoxel.transform.position = startingVoxelPos.withY(startingVoxelPos.y + cubicT * 2f) + 0.3f * Vector3.right * Mathf.Sin(4f * Time.fixedTime);
        }, 4f);
        yield return(new WaitForSeconds(0.3f));

        ShaderEnvProps.instance.RecordGlobalPulse(CCPlayer.main.head.position);

        yield return(new WaitForSeconds(0.8f));

        ShaderEnvProps.instance.RecordGlobalPulse(CCPlayer.main.head.position);
        yield return(new WaitForSeconds(1.9f));

        this.xuTween((float t) => {
            float quinticT            = Easing.Quintic.In(t);
            RenderSettings.fogColor   = quinticT * Color.white;
            RenderSettings.fogDensity = 0.003f + quinticT;
        }, 1f);
        yield return(new WaitForSeconds(1f));

        CCSceneUtils.instance.StartCoroutine(CCSceneUtils.DoFadeSceneLoadCoroutine("ShadowManipScene", "UnderWorldScene"));
    }
Пример #4
0
 private void OnDestroy()
 {
     instance = null;
 }