Exemplo n.º 1
0
    public void ApplyForceX()
    {
        EditorSceneManager.OpenScene((Application.dataPath + "/SpringMass/MainScene.Unity"));

        GameObject  LM = GameObject.Find("LineMaster");
        CreateLines ls = LM.GetComponent <CreateLines>();

        ls.InitializeSimulation();
        ls.velX = 1;

        ls.started = 1;
        ls.Update();
        ls.Update();
        ls.Update();

        Assert.IsFalse(
            Mathf.Approximately(1.0f, ls.velX));              //Any change for velX
    }
Exemplo n.º 2
0
    public void PausingWorks()
    {
        EditorSceneManager.OpenScene((Application.dataPath + "/SpringMass/MainScene.Unity"));

        GameObject  LM = GameObject.Find("LineMaster");
        CreateLines ls = LM.GetComponent <CreateLines>();

        ls.started = 1;
        ls.pause   = 0;
        ls.InitializeSimulation();

        ls.Update();
        ls.Update();
        ls.Update();
        float testTime = ls.time;

        ls.pause = 1;
        ls.Update();
        ls.Update();
        ls.Update();
        Assert.IsTrue(Mathf.Approximately(ls.time, testTime));

//		Assert.IsFalse(
        //		Mathf.Approximately(0.0f, ls.velX )); //Any change for velX
    }
Exemplo n.º 3
0
    public void UpdateWithoutStarted_x()
    {
        GameObject lines = new GameObject();

        lines.AddComponent <CreateLines>();

        CreateLines ls = lines.GetComponent <CreateLines>();

        //ls.InitializeSimulation();
        ls.Update();

        Debug.Log(ls.mx);
        Assert.IsTrue(
            Mathf.Approximately(-2.0f, ls.mx));              //No change for mx
    }