Skip to content

Commit

Permalink
Merge pull request #121 from Unity-Technologies/labeling-improvements
Browse files Browse the repository at this point in the history
New Labeling and Label Config UI
  • Loading branch information
mkamalza authored Dec 2, 2020
2 parents 8cd8868 + e209f10 commit f3fffb0
Show file tree
Hide file tree
Showing 66 changed files with 3,205 additions and 223 deletions.
8 changes: 8 additions & 0 deletions com.unity.perception/Editor/AssetPreparation.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.IO;
using UnityEngine;

namespace UnityEditor.Perception.AssetPreparation
{
static class AssetPreparationMenuItems
{
/// <summary>
/// Function for creating prefabs from multiple models with one click. Created prefabs will be placed in the same folder as their corresponding model.
/// </summary>
[MenuItem("Assets/Perception/Create Prefabs from Selected Models")]
static void CreatePrefabsFromSelectedModels()
{
foreach (var selection in Selection.gameObjects)
{
var path = AssetDatabase.GetAssetPath(selection);
var tmpGameObject = Object.Instantiate(selection);
var destinationPath = Path.GetDirectoryName(path) + "/" + selection.name + ".prefab";
PrefabUtility.SaveAsPrefabAsset(tmpGameObject, destinationPath);
Object.DestroyImmediate(tmpGameObject);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f3fffb0

Please sign in to comment.