コード例 #1
0
        public InfiniteTileGOGrid(GameObject parent, int regionSize)
        {
            componentGrid = new InfiniteComponentGrid(regionSize);

            if (Application.isPlaying)
            {
                foreach (Transform t in parent.transform)
                {
                    if (t.name == "tile container")
                    {
                        Object.Destroy(t.gameObject);
                    }
                }
            }
            else
            {
                foreach (Transform t in parent.transform)
                {
                    if (t.name == "tile container")
                    {
                        Object.DestroyImmediate(t.gameObject);
                    }
                }
            }

            container = new GameObject("tile container");
            container.transform.SetParent(parent.transform, false);
        }
コード例 #2
0
        public override void ResetListener()
        {
            if (components == null)
            {
                components = new InfiniteComponentGrid(Grid.REGION_SIZE);
            }

            if (containerGO == null)
            {
                containerGO = new GameObject("colliders");
                containerGO.transform.SetParent(transform, false);
            }

            base.ResetListener();
        }
コード例 #3
0
        public override void ResetListener()
        {
            if (regionRenderers == null)
            {
                regionRenderers = new List <PositionRegionRenderer> ();
            }

            if (triangles == null)
            {
                triangles = new InfiniteComponentGrid(Grid.REGION_SIZE);
            }

            if (containerGO == null)
            {
                containerGO = new GameObject("sprites");
                containerGO.transform.SetParent(transform, false);
            }

            base.ResetListener();
        }