// Start is called before the first frame update
    void Start()
    {
        i = 0;
        if (LevelSystem.DDA == true)
        {
            DDA = true;

            emotionStorePrevSize = EmotionStore.excitements.Count;
            focusStorePrevSize   = EmotionStore.focus.Count;

            INSIGHT = BrainFramework.GetComponent <BrainFramework>();
            INSIGHT.On("READY", Ready);
            INSIGHT.On("STREAM", Stream);
        }
        else
        {
            DDA = false;
        }

        difficulty = LevelSystem.currentDifficulty;

        excitement          = 0;
        excitementText.text = "Excitement: " + excitement.ToString();

        focus          = 0;
        focusText.text = "focus: " + focus.ToString();

        levelText.text = "Level: " + SceneManager.GetActiveScene().name;

        if (!DDA)
        {
            Canvas canvas = GameObject.Find("Canvas").GetComponent <Canvas>();
            canvas.gameObject.SetActive(false);
        }
    }
Example #2
0
    void Start()
    {
        // ---------- BRAIN FRAMEWORK-----------
        // 1. Connect to EPOC Script
        EPOC = BrainFramework.GetComponent <BrainFramework>();
        // 2. Subscribe to Events
        EPOC.On("READY", Ready);
        EPOC.On("STREAM", Stream);
        // ------------------------------------

        // Prepare Ball
        Ball = GetComponent <Rigidbody>();
    }
    // Use this for initialization
    void Start()
    {
        // 01. CONNECT

        EPOC = new BrainFramework("INSERT_YOUR_HEADSET_ID");

        string client_id     = "INSERT_YOUR_CLIENT_ID";
        string client_secret = "INSERT_YOUR_CLIENT_SECRET";

        EPOC.Connect(client_id, client_secret);

        EPOC.On("Ready", Ready);
        EPOC.On("Stream", Stream);

        Ball = BallObject.GetComponent <Rigidbody>();
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        // 01. CONNECT

        // e.g. EPOCPLUS-0000000
        EPOC = new BrainFramework("INSERT_YOUR_HEADSET_ID");

        // FROM YOUR EMOTIV ACCOUNT
        string client_id     = "INSERT_YOUR_CLIENT_ID";
        string client_secret = "INSERT_YOUR_CLIENT_SECRET";

        EPOC.Connect(client_id, client_secret);

        // SETUP EVENTS
        EPOC.On("Ready", Ready);
        EPOC.On("Stream", Stream);
    }
    void Start()
    {
        INSIGHT = BrainFramework.GetComponent <BrainFramework>();
        INSIGHT.On("READY", Ready);
        INSIGHT.On("STREAM", Stream);
        //darkness = true;
        //Check difficulty modifiers decided from prev level
        if (LevelSystem.darkness)
        {
            darkness = true;
            //LevelSystem.darkness = false;
        }
        if (LevelSystem.lockMovement)
        {
            lockMovement = true;
            //LevelSystem.lockMovement = false;
        }
        if (LevelSystem.removePiece)
        {
            removePiece = true;
            //LevelSystem.removePiece = false;
        }

        timer = 10f;

        //if (SceneManager.GetActiveScene().name == "SlidePuzzleEasy2")
        //{
        if (darkness)
        {
            RenderSettings.ambientMode           = UnityEngine.Rendering.AmbientMode.Flat;
            RenderSettings.defaultReflectionMode = UnityEngine.Rendering.DefaultReflectionMode.Custom;
            mainLight.enabled      = false;
            goalPieceLight.enabled = true;
            PostProcessVolume ppv = FindObjectOfType <PostProcessVolume>();
            ppv.enabled = false;
            Shader s1 = Shader.Find("Unlit/Color");
            floor.GetComponent <Renderer>().material.shader = s1;
        }
        //}

        if (removePiece)
        {
            GameObject   horObst      = GameObject.Find("Horizontal");
            GameObject   verObst      = GameObject.Find("Vertical");
            GameObject[] horObstacles = new GameObject[horObst.transform.childCount];
            GameObject[] verObstacles = new GameObject[verObst.transform.childCount];
            //Debug.Log(horObst.transform.GetChild(0));
            //Debug.Log(verObst.name);

            for (int i = 0; i < horObst.transform.childCount; i++)
            {
                //Debug.Log(horObst.transform.GetChild(i));
                horObstacles[i] = horObst.transform.GetChild(i).gameObject;
            }

            for (int i = 0; i < verObst.transform.childCount; i++)
            {
                verObstacles[i] = verObst.transform.GetChild(i).gameObject;
            }

            if (Random.Range(0f, 1f) >= 0.5)
            {
                //Debug.Log("DESTROYING HOR");
                Destroy(horObstacles[Random.Range(0, horObstacles.Length)]);
            }
            else
            {
                //Debug.Log("DESTROYING VER");
                Destroy(verObstacles[Random.Range(0, verObstacles.Length)]);
            }
        }
    }