public void WeWillGetTheCorrectRigidbodyAfterAnInstantiation() { Rigidbody body = new Rigidbody(); go.AddComponent(body); Assert.That(comp.rigidbody, Is.Not.Null); TestComponent inst = (TestComponent)GameObject.Instantiate(comp); Assert.That(inst.rigidbody, Is.Not.Null); Assert.That(inst.rigidbody, Is.Not.SameAs(body)); }
public void WeWillGetTheCorrectRigidbodyAfterAnInstantiation() { GameObject go = new GameObject(); Rigidbody body = new Rigidbody(); go.AddComponent(body); Assert.That(go.rigidbody, Is.Not.Null); GameObject inst = (GameObject)GameObject.Instantiate(go); Assert.That(inst.rigidbody, Is.Not.Null); Assert.That(inst.rigidbody, Is.Not.SameAs(body)); }
public void WeWillGetTheRigidBodyIfItIsThere() { Assert.That(comp.rigidbody, Is.Null); Rigidbody body = new Rigidbody(); go.AddComponent(body); Assert.That(comp.rigidbody, Is.Not.Null); Assert.That(comp.rigidbody, Is.SameAs(body)); }