public void TearDown() { TagHelper.RemoveTag("Test"); behaviour.OnDisable(); TagCache.ClearAll(); }
public void ClearAllTest() { Vector3[] ga = TagCache.GetVector3sByTag("Test"); Vector3 toA = testObjectA.transform.position; Vector3 toB = testObjectB.transform.position; Vector3 toC = testObjectC.transform.position; Assert.AreEqual(2, ga.Length); Assert.AreEqual(true, ga.Contains(toA)); Assert.AreEqual(true, ga.Contains(toB)); Assert.AreEqual(false, ga.Contains(toC)); Assert.AreEqual(testObjectC.transform.position, TagCache.GetVector3sByTag("Dummy")[0]); testObjectA.transform.position = new Vector3(10, 123, 5); testObjectB.transform.position = new Vector3(13, 13, 1); testObjectC.transform.position = new Vector3(-10, 3, 0); TagCache.ClearAll(); Vector3[] gaAfter = TagCache.GetVector3sByTag("Test"); Assert.AreEqual(0, gaAfter.Length); Assert.AreEqual(false, gaAfter.Contains(toA)); Assert.AreEqual(false, gaAfter.Contains(toB)); Assert.AreEqual(false, gaAfter.Contains(testObjectA.transform.position)); Assert.AreEqual(false, gaAfter.Contains(testObjectB.transform.position)); Assert.AreEqual(false, gaAfter.Contains(testObjectC.transform.position)); }
public void SetUp() { TagCache.ClearAll(); TagHelper.AddTag("Test"); TagHelper.AddTag("Dummy"); go = new GameObject(); go.AddComponent <TagCache>(); testObjectA = new GameObject(); testObjectA.tag = "Test"; testObjectA.transform.position = new Vector3(-1, 1, 0); TagCache.Register(testObjectA); testObjectB = new GameObject(); testObjectB.tag = "Test"; testObjectB.transform.position = new Vector3(1, -1, 10); TagCache.Register(testObjectB); testObjectC = new GameObject(); testObjectC.tag = "Dummy"; testObjectC.transform.position = new Vector3(3, 0, 5); TagCache.Register(testObjectC); }
public void TearDown() { TagCache.ClearAll(); TagHelper.RemoveTag("Test"); TagHelper.RemoveTag("Dummy"); }