Beispiel #1
0
        public override bool StartUp(Vector3Int position, ITilemap tilemap, GameObject go)
        {
            framewait = new WaitForSeconds(1 / (float)frameDelta);

            if (Application.isPlaying)
            {
                go = Instantiate(prefab);
            }

            Tilemap map = tilemap.GetComponent <Tilemap>();

            go.transform.position = map.CellToWorld(position) + Vector3.up * 0.5f * map.cellSize.y + Vector3.right * 0.5f * map.cellSize.x;

            if (Application.isPlaying)
            {
                go.transform.parent = map.transform;
            }
            else
            {
                return(base.StartUp(position, tilemap, null));
            }

            map.RefreshTile(position); //Refresh the tile so that the sprite is null

            return(true);              // base.StartUp(position, tilemap, null);
        }