Exemplo n.º 1
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.º 2
0
    public void UpdateWithStarted_x()
    {
        EditorSceneManager.OpenScene((Application.dataPath + "/SpringMass/MainScene.Unity"));

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

        ls.InitializeSimulation();

        ls.started = 1;
        ls.Update();
        Assert.IsFalse(Mathf.Approximately(-2f, ls.mx));  //Any change for mx
    }
Exemplo n.º 3
0
    public void InitializeSimulation()
    {
        EditorSceneManager.OpenScene((Application.dataPath + "/SpringMass/MainScene.Unity"));

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

        try
        {
            ls.InitializeSimulation();
        }
        catch (Exception e) {
            Debug.LogAssertion(e);
            Assert.IsTrue(false);
        }
    }
Exemplo n.º 4
0
    public void CallLineDotCSFunctions()
    {
        EditorSceneManager.OpenScene((Application.dataPath + "/SpringMass/MainScene.Unity"));

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

        ls.InitializeSimulation();
        try{
            ls.instance[0].GetComponent <Line>().Start();
            ls.instance[0].GetComponent <Line>().Update();
            ls.instance[9].GetComponent <Line>().Start();
            ls.instance[9].GetComponent <Line>().Update();
        }
        catch (Exception e) {
            Debug.LogAssertion(e);
            Assert.IsTrue(false);
        }
    }