Example #1
0
        public IEnumerator CreateOnlyHullBlockersForBigScenes()
        {
            var go = new GameObject();

            var blockerHandler = new BlockerHandler();

            blockerHandler.SetupBlockers(new HashSet <Vector2Int>(Utils.GetBottomLeftZoneArray(Vector2Int.zero, new Vector2Int(10, 10))), 100, go.transform);

            Assert.AreEqual(36, go.transform.childCount, "Blockers count is unexpected. Remember that blockers only should spawn surrounding the scene, not inside. The spawning code might be broken.");

            blockerHandler.CleanBlockers();
            yield break;
        }
Example #2
0
        public IEnumerator ReleaseBlockersOnUnload()
        {
            var go = new GameObject();

            var blockerHandler = new BlockerHandler();

            blockerHandler.SetupBlockers(new HashSet <Vector2Int>(Utils.GetBottomLeftZoneArray(Vector2Int.zero, new Vector2Int(10, 10))), 100, go.transform);
            yield return(null);

            blockerHandler.CleanBlockers();
            yield return(null);

            Assert.AreEqual(0, go.transform.childCount, "Blockers couldn't be released properly!");
        }