Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (EEGData.GetEEGData()[1] != 0)
     {
         Vector3 currentPosition = cube.transform.position;
         Vector3 newPosition     = new Vector3(currentPosition.x, EEGData.GetRelativeFrequency(EEGData.EEG_BANDS.ALPHA) * maxHeight, currentPosition.z);
         cube.transform.position = Vector3.Lerp(currentPosition, newPosition, Time.deltaTime);
     }
 }
    // Update is called once per frame
    void Update()
    {
        float relAlpha = 0f;

        try {
            relAlpha = EEGData.GetRelativeFrequency(EEGData.EEG_BANDS.ALPHA);
            if (relAlpha >= alphaThreshold && currentColour < 1.0f)
            {
                currentColour += stepSize;
            }
            else if (currentColour > 0f)
            {
                currentColour -= stepSize;
            }
        } catch {
        }
        RenderSettings.skybox.SetColor("_Tint", Color.Lerp(NIGHT_COLOUR, DAY_COLOUR, currentColour));
        DynamicGI.UpdateEnvironment();
    }
Esempio n. 3
0
    private float GetRelativeAlpha()
    {
        float relAlpha = EEGData.GetRelativeFrequency(EEGData.EEG_BANDS.ALPHA);

        return(relAlpha > alphaThreshold ? relAlpha : ((1f - relAlpha / alphaThreshold) * -1f));
    }