예제 #1
0
        public void GetGameObjectsTest()
        {
            Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length);

            GameObject[] ga = TagCache.GetGameObjectsByTag("Test");
            Assert.AreEqual(true, ga.Contains(testObjectA));
            Assert.AreEqual(true, ga.Contains(testObjectB));
            Assert.AreEqual(false, ga.Contains(testObjectC));

            Assert.AreSame(testObjectC, TagCache.GetGameObjectsByTag("Dummy")[0]);
        }
예제 #2
0
        public void DeregisterTest()
        {
            Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectA));
            Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectB));
            Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length);

            TagCache.DeRegister(testObjectA);
            TagCache.DeRegister(testObjectB);

            Assert.AreEqual(new GameObject[] { }, TagCache.GetGameObjectsByTag("Test"));
            Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Dummy").Contains(testObjectC));
            Assert.AreEqual(1, TagCache.GetGameObjectsByTag("Dummy").Length);
        }
예제 #3
0
 public void RegisterTest()
 {
     Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectA));
     Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectB));
     Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length);
 }