示例#1
0
        protected override void addTile(int x, int y, int id)
        {
            int listTileId = id - 1;

            if (listTileId > tiles.Count - 1)
            {
                Debug.LogError("The tile id " + id + " is too far, last id is " + (tiles.Count) + ".");
                return;
            }

            TiledTileData tileData = tiles[id - 1];

            if (tileData == null)
            {
                Debug.Log("Tile " + id + " is nulll !?!?");
            }
            else if (tileData.prefab == null)
            {
                statistics.addWarning("Tile " + tileData.id + " missing, used times");
            }
            else
            {
                //Debug.Log("fake on rajoute " + tileData.prefab.name + " (" + (id-1) + ")");

                Vector3    position = new Vector3(x, y);
                GameObject original = tileData.prefab;
                GameObject go       = (GameObject)Object.Instantiate(original);
                go.name = original.name;
                go.transform.position = position;
                go.transform.parent   = parent;
            }
        }
示例#2
0
        void makeWarningForMissingTile(int overallId, int idInTileset)
        {
            int index = 0;

            while (lastIdForTileset[index++] < overallId)
            {
                ;
            }

            string tilesetName = tilesetNames[index - 1];

            statistics.addWarning(string.Format("Tile ID ({0}) in tileset ({1}) is missing. Used time", idInTileset, tilesetName));
        }