-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from Unity-Technologies/labeling-improvements
New Labeling and Label Config UI
- Loading branch information
Showing
66 changed files
with
3,205 additions
and
223 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
com.unity.perception/Editor/AssetPreparation/AssetPreparationTools.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
com.unity.perception/Editor/AssetPreparation/AssetPreparationTools.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.