UnityMol  0.9.6-875
UnityMol viewer / In developement
TestPlotter.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 
4 public class TestPlotter : MonoBehaviour {
5 
6  // Use this for initialization
7  void Start () {
8 
9  // Create a new graph named "MouseX", with a range of 0 to 2000, colour green at position 100,100
10  PlotManager.Instance.PlotCreate("MouseX", 0, 2000, Color.green, new Vector2(100,100));
11 
12  // Create a new child "MouseY" graph. Colour is red and parent is "MouseX"
13  PlotManager.Instance.PlotCreate("MouseY", Color.red, "MouseX");
14  }
15 
16  // Update is called once per frame
17  void Update () {
18 
19  // Add data to graphs
20  PlotManager.Instance.PlotAdd("MouseX", Input.mousePosition.x);
21  PlotManager.Instance.PlotAdd("MouseY", Input.mousePosition.y);
22  }
23 
24 
25 }
void PlotAdd(String plotName, float value)
Add a value to plot graph
Definition: PlotManager.cs:53
void PlotCreate(String plotName, float min, float max, Color plotColor, Vector2 pos)
Instantiate a new new plot graph
Definition: PlotManager.cs:64
static PlotManager Instance
Instance of object
Definition: PlotManager.cs:18
void Start()
Definition: TestPlotter.cs:7
void Update()
Definition: TestPlotter.cs:17