Example #1
0
    void Awake()
    {
        mGraph = gameObject.GetComponent <NGraph>();
        if (mGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }
        mGraph.setRanges(-10, 10, -8, 8);

        List <Vector2> data = new List <Vector2>();

        data.Add(new Vector2(-10, -3));
        data.Add(new Vector2(-8, 6));
        data.Add(new Vector2(-6, 2));
        data.Add(new Vector2(-4, -1));
        data.Add(new Vector2(-3, -7));
        data.Add(new Vector2(-2, -4));
        data.Add(new Vector2(-0, 3));

        mSeries1               = mGraph.addDataSeries <NGraphDataSeriesXy>("Simple Plot 1", Color.green);
        mSeries1.PlotStyle     = NGraphDataSeriesXy.Style.Line;
        mSeries1.PlotThickness = 3f;
        mSeries1.Data          = data;

        mSeries1               = mGraph.addDataSeries <NGraphDataSeriesXy>("Simple Plot 2", Color.red);
        mSeries1.PlotStyle     = NGraphDataSeriesXy.Style.Bar;
        mSeries1.PlotThickness = 10f;
        mSeries1.Data          = data;
    }
Example #2
0
    public void RangePressed()
    {
        float res = float.Parse(InputResolution.text);

        mEquationPlot1.Resolution = res;

        float xMax = float.Parse(XMax.text);
        float xMin = float.Parse(XMin.text);
        float yMax = float.Parse(YMax.text);
        float yMin = float.Parse(YMin.text);

        mGraph.setRanges(xMin, xMax, yMin, yMax);
        mEquationPlot1.Reveal = 2.0f;
    }
Example #3
0
    void Awake()
    {
        mGraph = gameObject.GetComponent <NGraph>();
        if (mGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }
        mGraph.setRanges(-10, 0, -8, 8);

        List <Vector2> data = new List <Vector2>();

        mSeries1            = mGraph.addDataSeries <NGraphDataSeriesXyLiveTransient>("Transient", Color.green);
        mSeries1.Data       = data;
        mSeries1.UpdateRate = 0.005f;

        //testing
        ubdRigidbody   = UBD.GetComponent <Rigidbody>();
        ubdTransform   = UBD.GetComponent <Transform>();
        VelocityVector = ubdTransform.position;
    }
Example #4
0
    private void Awake()
    {
        droneGraph = gameObject.GetComponent <NGraph>();
        if (droneGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }

        //(-x, x, -y , y)
        droneGraph.setRanges(-2, 3, -2, 2);

        List <Vector2> velData = new List <Vector2>();

        linearVelocity            = droneGraph.addDataSeries <NGraphDataSeriesXyLiveTransient>("Transient", Color.cyan);
        linearVelocity.Data       = velData;
        linearVelocity.UpdateRate = 0.005f;

        droneRigidbody = drone.GetComponent <Rigidbody>();
        droneTransform = drone.GetComponent <Transform>();
        velocityVector = droneTransform.position;
    }
    void Awake()
    {
        mGraph = gameObject.GetComponent <NGraph>();
        if (mGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }
        mGraph.setRanges(-10, 0, -8, 8);

        List <Vector2> data1 = new List <Vector2>();
        List <Vector2> data2 = new List <Vector2>();

        mSeries1 = mGraph.addDataSeries <NGraphDataSeriesXyLiveTransient>("Transient", Color.yellow);
        mSeries1.PlotThickness = 0.5f;
        mSeries1.Data          = data1;
        mSeries1.UpdateRate    = 0.05f;

        mSeries2            = mGraph.addDataSeries <NGraphDataSeriesXyLiveTransient>("Transient", Color.green);
        mSeries2.Data       = data2;
        mSeries2.UpdateRate = 0.05f;
    }