コード例 #1
0
        public IEnumerator DestroyTiles(List <Vector2> list)
        {
            try {
                List <string> tileListNames = new List <string> ();
                foreach (Vector2 v in list)
                {
                    string s = GOTileObj.TileNamePrototype(v, zoomLevel);
                    tileListNames.Add(s);
                }

                List <GOTile> toDestroy = new List <GOTile> ();
                foreach (GOTile tile in tiles)
                {
                    if (tile != null && !tileListNames.Contains(tile.name) && tile.goTile.status == GOTileObj.GOTileStatus.Done)
                    {
                        Debug.Log(tile.goTile.status.ToString());
                        toDestroy.Add(tile);
                    }
                }
                for (int i = 0; i < toDestroy.Count; i++)
                {
                    GOTile tile = toDestroy [i];
                    tiles.Remove(tile);
                    GameObject.Destroy(tile.gameObject, i);
                }
            } catch (Exception ex) {
                Debug.LogWarning(ex);
            }
            yield return(null);
        }
コード例 #2
0
        bool isSmartTileAlreadyCreated(Vector2 tileCoords, int Zoom)
        {
            string name = GOTileObj.TileNamePrototype(tileCoords, zoomLevel);

            return(transform.Find(name));
        }