Ejemplo n.º 1
0
    void SetupPieChart()
    {
        mPieChart = gameObject.AddComponent("PieChartMesh") as PieChartMesh;
        if (mPieChart != null)
        {
            mPieChart.Init(mData, 100, 0, 100, null);

            if (DataSaver.Instance.highScores != null)
            {
                mData = new float[4];
                foreach (var score in DataSaver.Instance.highScores)
                {
                    mData[0] = score.RedWins;
                    mData[1] = score.BlueWins;
                    mData[2] = score.GreenWins;
                    mData[3] = score.PinkWins;
                }
            }
            else
            {
                defaultValues = new float[4] { 0, 0, 0, 0 };
                mData = defaultValues;
            }
            mPieChart.Draw(mData);
        }
    }
Ejemplo n.º 2
0
    public void InitPieChart(Team team, int number)
    {
        mPieChart = gameObject.AddComponent <PieChartMesh>();

        float[] datas = new float[number];

        if (number == 4)
        {
            datas[0] = team.t_serve_score;
            datas[1] = team.t_attack_score;
            datas[2] = team.t_block_score;
            datas[3] = team.t_enemy_fail;
        }
        else if (number == 6)
        {
            datas[0] = team.t_serve_fail;
            datas[1] = team.t_attack_fail;
            datas[2] = team.t_block_fail;
            datas[3] = team.t_team_fail;
            datas[4] = team.t_duel_fail;
            datas[5] = team.t_defend_fail;
        }

        if (mPieChart != null)
        {
            mPieChart.Init(datas, 100, 0, 100, null);
            mPieChart.Draw(datas);
        }
    }
Ejemplo n.º 3
0
    void SetupPieChart()
    {
        mPieChart = gameObject.AddComponent("PieChartMesh") as PieChartMesh;
        if (mPieChart != null)
        {
            mPieChart.Init(mData, 100, 0, 100, null);

            if (DataSaver.Instance.highScores != null)
            {
                mData = new float[4];
                foreach (var score in DataSaver.Instance.highScores)
                {
                    mData[0] = score.RedWins;
                    mData[1] = score.BlueWins;
                    mData[2] = score.GreenWins;
                    mData[3] = score.PinkWins;
                }
            }
            else
            {
                defaultValues = new float[4] {
                    0, 0, 0, 0
                };
                mData = defaultValues;
            }
            mPieChart.Draw(mData);
        }
    }
 void Start()
 {
     mPieChart = gameObject.AddComponent <PieChartMesh>() as PieChartMesh;
     if (mPieChart != null)
     {
         mPieChart.Init(mData, 100, 0, 100, null);
         mData = GenerateRandomValues(4);
         mPieChart.Draw(mData);
     }
 }
Ejemplo n.º 5
0
 void Start()
 {
     mPieChart = gameObject.AddComponent("PieChartMesh") as PieChartMesh;
     if (mPieChart != null)
     {
         mPieChart.Init(mData, 100, 0, 100, null);
         mData = GenerateRandomValues(4);
         mPieChart.Draw(mData);
     }
 }
    //=====================

    void Start()
    {
        //Get Data from dataReader
        ballScript = GameObject.Find("leftwall").GetComponent <dataReader> ();
        //========
        mPieChart = gameObject.AddComponent("PieChartMesh") as PieChartMesh;
        if (mPieChart != null)
        {
            mPieChart.Init(mData, 10, 0, 10, null);
            mData = initialArray();
            mPieChart.Draw(mData);
        }

        //SetTrigger as false so it doesn't update at the start
        enterTrigger = false;
    }
    void Start()
    {
        randomBuffer = Random.state;
        Random.InitState(10);

        materials = new Material[segments];
        for (int i = 0; i < segments; i++)
        {
            materials[i]       = new Material(mainMaterial);
            materials[i].color = new Color32((byte)Random.Range(0, 256), (byte)Random.Range(0, 256), (byte)Random.Range(0, 256), (byte)255);
            //Debug.LogError(materials[i].color);
        }

        mPieChart = gameObject.AddComponent <PieChartMesh>() as PieChartMesh;
        if (mPieChart != null)
        {
            mPieChart.Init(mData, 100, 0, 100, materials, delay);
            mData = GenerateRandomValues(segments);
            mPieChart.Draw(mData);
        }
        Random.state = randomBuffer;
    }
Ejemplo n.º 8
0
 // Use this for initialization
 void FixedUpdate()
 {
     pie.Init(mData, 100, mRotationAngle, mRadius);
     pie.Draw();
 }