Beispiel #1
0
    public void TestThrusterMinStrength()
    {
        ThrusterModel t = new ThrusterModel();

        t.setStrength(0);
        Assert.AreEqual(10, t.GetForce());
    }
Beispiel #2
0
    public void TestThrusterTestForce()
    {
        ThrusterModel t = new ThrusterModel();

        t.setStrength(20);
        t.setPower(50f);
        Assert.AreEqual(1000, t.GetForce());
    }
Beispiel #3
0
 // Update is called once per frame
 void FixedUpdate()
 {
     //If the thruster is switched on
     if (truster.isOn())
     {
         //Apply force in the direction the thrusters facing at position(Fire the thruster)
         rbody.AddForceAtPosition((-transform.forward) * truster.GetForce(), transform.position);
         //
         truster.setOn(false);
     }
 }