Ejemplo n.º 1
0
    private IEnumerator CompleteLevelAsync()
    {
        GameManager.currentLevel = (int)(this.levelNumber + 1);

        // Move the measure to the center of the screen
        float moveTime    = LevelManager.Constants.measureCenterTime;
        float currentTime = 0f;

        Vector3 measureStart = this.measureTransform.position;
        Vector3 measureEnd   = new Vector3(0, 0, -9);

        Vector3 measureScaleStart = this.measureTransform.localScale;
        Vector3 measureScaleEnd   = measureScaleStart * 1.5f;

        this.DimChildren(this.gameObject);

        float t;

        while (currentTime <= moveTime)
        {
            t = currentTime / moveTime;
            t = t * t * t * (t * (6f * t - 15f) + 10f);

            this.measureTransform.position   = Vector3.Lerp(measureStart, measureEnd, t);
            this.measureTransform.localScale = Vector3.Lerp(measureScaleStart, measureScaleEnd, t);

            yield return(new WaitForEndOfFrame());

            currentTime += Time.deltaTime;
        }
        this.measureTransform.position = measureEnd;

        // Play the final measure
        AudioClip clip = this.measureClip;

        this.backgroundAudioSource.clip   = clip;
        this.backgroundAudioSource.volume = 1f;
        this.backgroundAudioSource.Play();

        yield return(new WaitForSeconds(clip.length + 0.2f));

        this.SuperdimChildren(this.gameObject);

        // @DEPRECATED
        //DontDestroyOnLoad (this.measureTransform.gameObject);
        //GameManager.SetMeasure (this.measureTransform.gameObject, this.measureTransform);
        //SceneManager.LoadScene("LevelSelection");

        LevelSelection.LevelCompleted(this.levelNumber, this.measureTransform, this);
    }
Ejemplo n.º 2
0
    private IEnumerator CompleteLevel()
    {
        print("entered");
        StartCoroutine(FadeInLevelComplete(flytime * 1.4f));
        yield return(superdogController.FlySuperdogAway(flytime));

        GameObject measureObject = CurrentStepObject.GetComponentInChildren <SpriteRenderer>().gameObject;

        StartCoroutine(Transition.Translate(measureObject.transform, 6f * Vector3.back, 0.6f));
        yield return(Transition.TransitionBrightness(gameObject, measureObject, 0.6f, Bright, Dark));

        yield return(Audio.PlayMeasure());

        LevelSelection.LevelCompleted(this.levelNumber, measureObject.transform);
    }
Ejemplo n.º 3
0
    private IEnumerator CompleteLevelAsync()
    {
        yield return(CloseTutorial());

        this.CleanUpNotes();
        GameManager.currentLevel = (int)(this.levelNumber + 1);

        // Move the measure to the center of the screen
        float moveTime    = LevelManager.Constants.measureCenterTime;
        float currentTime = 0f;

        Vector3 measureStart = this.measureTransform.position;
        Vector3 measureEnd   = new Vector3(0, 0, -8);

        if (MeasureSR)
        {
            MeasureSR.sortingOrder = 30;
        }

        Vector3 measureScaleStart = this.measureTransform.localScale;
        Vector3 measureScaleEnd   = measureScaleStart * 1.5f;

        this.DimChildren(this.gameObject);

        float t;

        while (currentTime <= moveTime)
        {
            t = currentTime / moveTime;
            t = t * t * t * (t * (6f * t - 15f) + 10f);

            this.measureTransform.position   = Vector3.Lerp(measureStart, measureEnd, t);
            this.measureTransform.localScale = Vector3.Lerp(measureScaleStart, measureScaleEnd, t);

            yield return(new WaitForEndOfFrame());

            currentTime += Time.deltaTime;
        }
        this.measureTransform.position = measureEnd;

        // Play the final measure
        AudioClip clip = this.measureClip;

        this.backgroundAudioSource.clip   = clip;
        this.backgroundAudioSource.volume = 1f;
        this.backgroundAudioSource.Play();

        for (int i = 0; i < glow.Length; i++)
        {
            glow[i].GetComponent <Glow>().StartGlow();
        }

        yield return(new WaitForSeconds(clip.length + 0.2f));

        this.SuperdimChildren(this.gameObject);

        // Conditional for demo popup
        if (this.levelNumber == 12)
        {
            this.ShowDemoPopup();
        }
        else
        {
            LevelSelection.LevelCompleted(this.levelNumber, this.measureTransform);
        }
    }