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); }
private void OnDisable() { TagCache.DeRegister(gameObject); }