コード例 #1
0
    public override void SetTile(Vector3Int position, GenericTile tile, Matrix4x4 transformMatrix, Color color)
    {
        ObjectTile objectTile = tile as ObjectTile;

        if (objectTile)
        {
            //hack to expand bounds when placing items in editor
            base.InternalSetTile(position, tile);
            base.InternalSetTile(position, null);

            objectTile.SpawnObject(position, tilemap, transformMatrix);
        }
    }
コード例 #2
0
        public override void SetTile(Vector3Int position, GenericTile tile, Matrix4x4 transformMatrix)
        {
            ObjectTile objectTile = tile as ObjectTile;

            if (objectTile)
            {
                if (!objectTile.IsItem)
                {
                    tilemap.SetTile(position, null);
                }
                objectTile.SpawnObject(position, tilemap, transformMatrix);
            }
            else
            {
                base.SetTile(position, tile, transformMatrix);
            }
        }