コード例 #1
0
    void Update()
    {
        //Get all Data from the data Reader one time
        if (incrementOnce < 2)
        {
            if (incrementOnce == 1)
            {
                //Grab Data
                //Set PieChart of initial state instantly.
                allData = ballScript.get_data();
                string[] testData = (string[])allData[dataIndex];
                mData = getDataFromString(testData[1]);
                dataIndex++;
                mPieChart.Draw(mData);
            }
            incrementOnce++;
        }

        if (enterTrigger)
        {
            //Update piechart whenever enter trigger zone
            //Stop updating when reach end of array = no more data
            if (dataIndex < allData.Count)
            {
                string[] testData = (string[])allData[dataIndex];
                mData = getDataFromString(testData[1]);
                dataIndex++;
                mPieChart.Draw(mData);
            }
            enterTrigger = false;
        }
    }
コード例 #2
0
    void Update()
    {
        //Get all Data from the data Reader one time
        if (incrementOnce < 8)
        {
            if (incrementOnce == 7)
            {
                //Grab Data
                //Set PieChart of initial state instantly.
                allData = ballScript.get_data();
                string[] testData = (string[])allData[dataIndex];
                Debug.Log(testData[3]);
                mData = getDataFromString(testData[3]);
                dataIndex++;
                mPieChart.Draw(mData);
            }
            incrementOnce++;
        }

        if (enterTrigger)
        {
            if (dataIndex < allData.Count)
            {
                //Update the BumpChart Each time enter the trigger
                //Grabbing the string data an send it to method getDatafromString
                string[] testData = (string[])allData[dataIndex];
                mData = getDataFromString(testData[3]);
                dataIndex++;
                mPieChart.Draw(mData);
            }
            enterTrigger = false;
        }
    }
コード例 #3
0
    void Update()
    {
        //Get all Data from dataReader one time
        if (incrementOnce < 3)
        {
            if (incrementOnce == 2)
            {
                allData = ballScript.get_data();
                string[] testData = (string[])allData [dataIndex];
                //Debug.Log (testData [0]);

                //All this is editable
                //200 lines becomes size 2
                //850 lines becomes 8, 2 sig fig
                scale    = Mathf.Sqrt(Mathf.Sqrt(int.Parse(testData[0])));
                oneScale = Mathf.Round(scale * 10.0f) / 10.0f;
                //Debug.Log(oneScale);
                dataIndex++;
            }
            incrementOnce++;
        }

        if (transform.localScale.x != scale)
        {
            if (transform.localScale.x < oneScale)
            {
                transform.localScale += new Vector3(0.1f, 0.1f, 0.0f);
            }
            else
            {
                transform.localScale -= new Vector3(0.1f, 0.1f, 0.0f);
            }
        }
    }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        //Get all Data from dataReader one time
        if (incrementOnce < 3)
        {
            if (incrementOnce == 2)
            {
                allData = ballScript.get_data();
                string[] testData = (string[])allData [dataIndex];
                //Debug.Log (testData [0]);

                //All this is editable
                //200 lines becomes size 2
                //850 lines becomes 8, 2 sig fig
                scale    = Mathf.Sqrt(Mathf.Sqrt(int.Parse(testData [0])));
                oneScale = Mathf.Round(scale * 10.0f) / 10.0f;
                //Debug.Log(oneScale);
                dataIndex++;
                transform.localScale = new Vector3(oneScale, oneScale, 1.0f);
            }
            incrementOnce++;
        }

        if (enterTrigger)
        {
            //size

            //Grabbing Data - Resizing the ball
            if (dataIndex < allData.Count)
            {
                string[] testData = (string[])allData [dataIndex];
                //Debug.Log (testData [0]);

                //All this is editable
                //testData[2] = Number of error flags in total
                //200 lines becomes size 2
                //850 lines becomes 8, 2 sig fig
                oneScale = Mathf.Sqrt(Mathf.Sqrt(int.Parse(testData[2])));
                //oneScale = Mathf.Round (scale * 1.000f) / 1.000f;
                //Debug.Log(oneScale);
                dataIndex++;
            }
            transform.localScale = new Vector3(oneScale, oneScale, 1.0f);
            enterTrigger         = false;
        }
    }