void Start() { GameObject ringGO = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ringGO, this.gameObject); WMG_Ring_Graph graph = ringGO.GetComponent <WMG_Ring_Graph> (); graph.Init(); // always initialize first (ensures Start() method on the graph gets called first) graph.pieMode = true; graph.pieModePaddingDegrees = 1; // the degree spacing between each slice graph.pieModeDegreeOffset = 90; // the degree rotational offset of the entire graph graph.innerRadiusPercentage = 0.75f; // the percentage of the graph that is empty graph.autoUpdateBandAlphaReverse = true; // reverses the order of how the bandcolors are updated graph.labelStartCenteredOnBand = true; graph.animateData = false; // graph.useComputeShader = true; // makes for smoother anti-aliased edges on the slices, and better perfomance (but doesn't work on all platforms) graph.values.Clear(); graph.values.Add(275); graph.values.Add(240); graph.values.Add(210); graph.values.Add(200); graph.values.Add(160); graph.values.Add(130); graph.values.Add(100); graph.values.Add(50); changeSpriteSize(graph.gameObject, 700, 600); graph.WMG_Ring_Click += MyCoolRingClickFunction; graph.WMG_Ring_MouseEnter += MyCoolRingHoverFunction; }
public void CreateRingChart(List <string> arr) { GameObject ringGO = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ringGO, this.gameObject); WMG_Ring_Graph graph = ringGO.GetComponent <WMG_Ring_Graph>(); graph.Init(); // always initialize first (ensures Start() method on the graph gets called first) graph.pieMode = true; graph.pieModePaddingDegrees = 1; // the degree spacing between each slice graph.pieModeDegreeOffset = 90; // the degree rotational offset of the entire graph graph.innerRadiusPercentage = 0.75f; // the percentage of the graph that is empty graph.autoUpdateBandAlphaReverse = true; // reverses the order of how the bandcolors are updated graph.labelStartCenteredOnBand = true; graph.animateData = false; graph.values.Clear(); for (int i = 0; i < arr.Count; i++) { string [] result = arr[i].Split(','); graph.values.Add(float.Parse(result[1])); graph.labels.Add(result[0]); } //changeSpriteSize(graph.gameObject, 600, 500); //resize graph.WMG_Ring_Click += MyCoolRingClickFunction; graph.WMG_Ring_MouseEnter += MyCoolRingHoverFunction; //ringGO.GetComponent<RectTransform>().localPosition = new Vector3(-230, 0 ,0); }
/* * private void Start() * { * CreateRingChart(); * } */ public void CreateRingChart() { GameObject ringGO = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ringGO, this.gameObject); WMG_Ring_Graph graph = ringGO.GetComponent <WMG_Ring_Graph>(); graph.Init(); // always initialize first (ensures Start() method on the graph gets called first) graph.pieMode = true; graph.pieModePaddingDegrees = 1; // the degree spacing between each slice graph.pieModeDegreeOffset = 90; // the degree rotational offset of the entire graph graph.innerRadiusPercentage = 0.75f; // the percentage of the graph that is empty graph.autoUpdateBandAlphaReverse = true; // reverses the order of how the bandcolors are updated graph.labelStartCenteredOnBand = true; graph.animateData = false; graph.values.Clear(); graph.values.Add(100); graph.values.Add(150); graph.values.Add(50); graph.values.Add(10); graph.labels.Add("Perfect"); graph.labels.Add("Good"); graph.labels.Add("Cool"); graph.labels.Add("Miss"); changeSpriteSize(graph.gameObject, 700, 600); graph.WMG_Ring_Click += MyCoolRingClickFunction; graph.WMG_Ring_MouseEnter += MyCoolRingHoverFunction; }
public void initialize(WMG_Ring_Graph graph) { ringSprite = WMG_Util.createSprite(getTexture(ring)); bandSprite = WMG_Util.createSprite(getTexture(band)); setTexture(ring, ringSprite); setTexture(band, bandSprite); this.graph = graph; changeSpriteParent(label, graph.ringLabelsParent); }
public void initialize(WMG_Ring_Graph graph) { ringSprite = WMG_Util.createSprite(getTexture(ring)); bandSprite = WMG_Util.createSprite(getTexture(band)); ringTexSize = ringSprite.texture.width; bandTexSize = bandSprite.texture.width; ringColors = new Color[ringTexSize * ringTexSize]; bandColors = new Color[bandTexSize * bandTexSize]; setTexture(ring, ringSprite); setTexture(band, bandSprite); this.graph = graph; changeSpriteParent(label, graph.ringLabelsParent); }
public void initialize(WMG_Ring_Graph graph) { this.graph = graph; texSize = graph.textureResolution; ringSprite = WMG_Util.createSprite(texSize, texSize); bandSprite = WMG_Util.createSprite(texSize, texSize); setTexture(ring, ringSprite); setTexture(band, bandSprite); changeSpriteParent(label, graph.ringLabelsParent); graph.addRingClickEvent(interactibleObj); graph.addRingMouseEnterEvent(interactibleObj); ringIndex = graph.rings.Count; }
public void OnEnable() { graph = (WMG_Ring_Graph)target; fields = GetProperties(graph); }
void Start() { GameObject ring1go = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ring1go, this.gameObject); changeSpritePositionTo(ring1go, new Vector3(-230, 175)); WMG_Ring_Graph ring1 = ring1go.GetComponent <WMG_Ring_Graph>(); ring1.Init(); ring1.values.Add(180); ring1.values.Add(335); ring1.leftRightPadding = new Vector2(60, 60); ring1.topBotPadding = new Vector2(50, 0); ring1.innerRadiusPercentage = 0.3f; ring1.ringPointWidthFactor = 20; changeSpriteSize(ring1go, 420, 350); ringGraphs.Add(ring1); GameObject ring2go = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ring2go, this.gameObject); changeSpritePositionTo(ring2go, new Vector3(200, 115)); WMG_Ring_Graph ring2 = ring2go.GetComponent <WMG_Ring_Graph>(); ring2.Init(); ring2.degrees = 180; ring2.leftRightPadding = new Vector2(60, 60); ring2.topBotPadding = new Vector2(50, -120); ring2.innerRadiusPercentage = 0.3f; ring2.ringPointWidthFactor = 20; changeSpriteSize(ring2go, 420, 230); ringGraphs.Add(ring2); GameObject ring3go = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ring3go, this.gameObject); changeSpritePositionTo(ring3go, new Vector3(-230, -180)); WMG_Ring_Graph ring3 = ring3go.GetComponent <WMG_Ring_Graph>(); ring3.Init(); ring3.degrees = 0; ring3.leftRightPadding = new Vector2(60, 60); ring3.topBotPadding = new Vector2(50, 50); ring3.innerRadiusPercentage = 0.3f; ring3.ringPointWidthFactor = 20; changeSpriteSize(ring3go, 370, 350); ringGraphs.Add(ring3); GameObject ring4go = GameObject.Instantiate(ringGraphPrefab) as GameObject; changeSpriteParent(ring4go, this.gameObject); changeSpritePositionTo(ring4go, new Vector3(200, -180)); WMG_Ring_Graph ring4 = ring4go.GetComponent <WMG_Ring_Graph>(); ring4.degrees = 0; ring4.Init(); ring4.leftRightPadding = new Vector2(60, 60); ring4.topBotPadding = new Vector2(50, 50); ring4.innerRadiusPercentage = 0.3f; ring4.ringPointWidthFactor = 20; ring4.bandMode = false; changeSpriteSize(ring4go, 370, 350); ringGraphs.Add(ring4); }