<commit_before>﻿using Tilemaps.Scripts.Tiles;
using Tilemaps.Editor.Utils;
using Tilemaps.Scripts.Utils;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System;
using Tilemaps.Scripts.Behaviours.Objects;
using UnityEngine.Tilemaps;
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;




public class Prefab2Tile : EditorWindow
{
	[MenuItem("Tools/Prefab2Tile")]
	public static void Apply()
	{
		//Moving old tiles
		FileUtil.DeleteFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects_Backup");
		FileUtil.MoveFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects", Application.dataPath + "/Tilemaps/Tiles/Objects_Backup");
		FileUtil.DeleteFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects");
		string path = Application.dataPath + "/Prefabs/Objects/";
		int counter = 0;
		string[] scan = Directory.GetFiles (path, "*.prefab", SearchOption.AllDirectories);
		foreach (String file in scan) {
			counter++;
			int t = scan.Length;
			EditorUtility.DisplayProgressBar(t.ToString() + "/" + scan.Length + " Generating Tiles", "Tile: " + counter, (float)counter / (float)scan.Length);
//			Debug.Log ("Longpath data: " + file);

			//Get the filename without extention and path
			string name = Path.GetFileNameWithoutExtension (file);		
//			Debug.Log ("Creating tile for prefab: " + name);

			//Generating the path needed to hook onto for selecting the game object
			string smallPath = file.Substring(file.IndexOf("Assets") + 0);
//			Debug.Log ("smallpath data: " + smallPath);

			//Generating the path needed to chose the right tile output sub-folder<commit_msg>Making prefab2tile compatible with @Krille90 move of object prefabs to tilemap. Getting rid of any guid erros by commenting out the backup function<commit_after>﻿using Tilemaps.Scripts.Tiles;
using Tilemaps.Editor.Utils;
using Tilemaps.Scripts.Utils;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System;
using Tilemaps.Scripts.Behaviours.Objects;
using UnityEngine.Tilemaps;
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;




public class Prefab2Tile : EditorWindow
{
	[MenuItem("Tools/Prefab2Tile")]
	public static void Apply()
	{
		//Moving old tiles
		FileUtil.DeleteFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects_Backup");
//		FileUtil.MoveFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects", Application.dataPath + "/Tilemaps/Tiles/Objects_Backup");
		FileUtil.DeleteFileOrDirectory(Application.dataPath + "/Tilemaps/Tiles/Objects");
		string path = Application.dataPath + "Resources/Prefabs/Objects/";
		int counter = 0;
		string[] scan = Directory.GetFiles (path, "*.prefab", SearchOption.AllDirectories);
		foreach (String file in scan) {
			counter++;
			int t = scan.Length;
			EditorUtility.DisplayProgressBar(t.ToString() + "/" + scan.Length + " Generating Tiles", "Tile: " + counter, (float)counter / (float)scan.Length);
//			Debug.Log ("Longpath data: " + file);

			//Get the filename without extention and path
			string name = Path.GetFileNameWithoutExtension (file);		
//			Debug.Log ("Creating tile for prefab: " + name);

			//Generating the path needed to hook onto for selecting the game object
			string smallPath = file.Substring(file.IndexOf("Assets") + 0);
//			Debug.Log ("smallpath data: " + smallPath);

			//Generating the path needed to chose the right tile output sub-folder
{'fraction_non_alphanumeric': 0.11631127111603434, 'fraction_numerical': 0.0030462475768485184, 'mean_word_length': 4.825806451612904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3619967', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1062, 'n_words': 289}