nextStage() публичный Метод

public nextStage ( ) : void
Результат void
Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (gameObject.activeSelf)
        {
            if ((Time.time - startTime) >= duration)
            {
                gameObject.SetActive(false);
                menu.nextStage();
            }

            // Tunnel rotation
            tunnelContainer.transform.Rotate(0, 0.02f, 0);

            // AlphaLat to Movement
            alpha = (float)FTSInterface.getAlpha();

            float currentPosZ = ball.transform.position[2];
            // Ensure 0=middle of the range and scale by alphaLIM
            float targetPosZ = (MINZPOS + MAXZPOS) / 2 + -alpha / Config.alphaLimit * (MAXZPOS - MINZPOS);
            // limit range of Z pos
            targetPosZ = Mathf.Min(Mathf.Max(targetPosZ, MINZPOS), MAXZPOS);

            float targetRotX = turningRate * (targetPosZ - currentPosZ) / (2f * Mathf.PI * 0.5f);

            Vector3 targetPosition = new Vector3(0, 0, targetPosZ);
            ball.transform.position = Vector3.SmoothDamp(ball.transform.position, targetPosition, ref velocity, smoothTime);
            ball.transform.Rotate(targetRotX, 0, 0);

            // Badness to Ball Color
            float b = (float)FTSInterface.getBadness();
            // smooth badness to make it visible for longer
            if (Config.badnessFilter > 0)
            {
                badness = Config.badnessFilter * b + (1 - Config.badnessFilter) * badness;
            }
            else
            {
                badness = b;
            }
            float badColor = Mathf.Max(0, badness - Config.badnessThreshold);          // > .5 = bad
            badColor = Mathf.Min(badColor, Config.badnessLimit) / Config.badnessLimit; // 3 is max badness, linear between

            ballRenderMan.material.SetFloat("_Blend", badColor);
            //skinnedMeshRenderMan.SetBlendShapeWeight (0, value * 100f);

            // Channel quality to tunnel Color
            float c1 = FTSInterface.getQualityCh1();
            float c2 = FTSInterface.getQualityCh2();

            float cmax = Mathf.Max(c1, c2) / Config.qualityLimit;

            for (int i = 0; i < tunnelRenderMen.Length; ++i)
            {
                tunnelRenderMen[i].material.SetFloat("_Blend", badColor);                  // BODGE: channel quality doesn't go here.
            }
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (gameObject.activeSelf)
        {
            float pulse = 0.5f + amplitude * (Mathf.PingPong(Time.time, frequency) / frequency);
            fixationCross.localScale = new Vector3(pulse, pulse, 0f);

            if ((Time.time - startTime) >= duration)
            {
                gameObject.SetActive(false);
                menu.nextStage();
            }
        }
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        if (gameObject.activeSelf && FTSInterface.systemIsReady())
        {
            if ((Time.time - startTime) >= duration)
            {
                gameObject.SetActive(false);

                // Log session score and reset for performance sake
                // menu.logScore((float)alphaLatAvg);
                // alphaLatAvg = 0;
                // avgSamples = 1;

                menu.nextStage();
            }

            TrnSampEvent.text = FTSInterface.getCurrentSampleNumber() + "/" + FTSInterface.getCurrentEventsNumber() + " (samp/evt)";

            // Tunnel rotation
            tunnelContainer.transform.Rotate(0, 0.02f, 0);

            // AlphaLat to Movement
            alpha = (float)FTSInterface.getAlpha();

            float currentPosZ = ball.transform.position[2];
            // Ensure 0=middle of the range and scale by alphaLIM
            float targetPosZ = (MINZPOS + MAXZPOS) / 2 + -alpha / Config.alphaLimit * (MAXZPOS - MINZPOS);
            // limit range of Z pos
            targetPosZ = Mathf.Min(Mathf.Max(targetPosZ, MINZPOS), MAXZPOS);

            float targetRotX = turningRate * (targetPosZ - currentPosZ) / (2f * Mathf.PI * 0.5f);

            Vector3 targetPosition = new Vector3(0, 0, targetPosZ);
            ball.transform.position = Vector3.SmoothDamp(ball.transform.position, targetPosition, ref velocity, smoothTime);
            ball.transform.Rotate(targetRotX, 0, 0);

            /*
             * // AlphaLat Rolling average to Ball Color
             * alphaLatAvg = (alphaLatAvg * avgSamples + alpha) / (avgSamples + 1);
             * avgSamples += 1;
             * //Debug.Log (alphaLatAvg);
             *
             * float targetBlend = 0.5f + (alpha - alphaLatAvg)/Config.alphaLimit;
             * float ballBlend = Mathf.Min(Mathf.Max(targetBlend,0f),1f);
             *
             * ballRenderMan.material.SetFloat ("_Blend", ballBlend);
             * //skinnedMeshRenderMan.SetBlendShapeWeight (0, value * 100f);
             */

            // Badness to Tunnel color
            float b = (float)FTSInterface.getBadness();
            // smooth badness to make it visible for longer
            if (Config.badnessFilter > 0)
            {
                badness = Config.badnessFilter * b + (1 - Config.badnessFilter) * badness;
            }
            else
            {
                badness = b;
            }
            float badColor = Mathf.Max(0, badness - Config.badnessThreshold);          // > .5 = bad
            badColor = Mathf.Min(badColor, Config.badnessLimit) / Config.badnessLimit; // 3 is max badness, linear between

            for (int i = 0; i < tunnelRenderMans.Length; ++i)
            {
                tunnelRenderMans[i].material.SetFloat("_Blend", badColor);
            }
        }
    }