forked from spr1ngd/UnityCodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPieGraphExample.cs
More file actions
38 lines (32 loc) · 892 Bytes
/
Copy pathPieGraphExample.cs
File metadata and controls
38 lines (32 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*=========================================
* Author: springDong
* Description: pie graph example.
==========================================*/
using UnityEngine;
using System.Collections.Generic;
using SpringGUI;
public class PieGraphExample : MonoBehaviour
{
public PieGraph PieGraph = null;
private void Start()
{
// method 1:
PieGraph.Inject(new Pies(new List<PieData>()
{
new PieData(26 ,Color.white)
}));
// method 2:
PieGraph.Inject(new List<PieData>()
{
new PieData(22,Color.magenta),
new PieData(15 ,Color.red),
});
// method 3:
PieGraph.Inject(
new List<float>() { 12 , 10 } ,
new List<Color>() { Color.blue , Color.black });
// method 4:
PieGraph.Inject(new List<float>() { 8 , 7 });
}
}