Пример #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;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        mGraph = gameObject.GetComponent <NGraph>();
        if (mGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }

        // Setup the graph
        mGraph.setRangeX(-5, 5);
        mGraph.setRangeY(-15, 15);

        mEquationPlot1            = mGraph.addDataSeries <NGraphDataSeriesXyEquation>("Simple Equation", Color.blue);
        mEquationPlot1.Resolution = 0.05f;
        mEquationPlot1.Equation   = "(x + 3) * (x + 1) * (x - 2)";

        ErrorLabel.text = "";

        Equation.text         = mEquationPlot1.Equation;
        InputResolution.text  = mEquationPlot1.Resolution.ToString();
        XMin.text             = mGraph.XRange.x.ToString();
        XMax.text             = mGraph.XRange.y.ToString();
        YMin.text             = mGraph.YRange.x.ToString();
        YMax.text             = mGraph.YRange.y.ToString();
        mEquationPlot1.Reveal = 2.0f;
    }
    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;
    }
Пример #4
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;
    }
Пример #5
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;
    }