-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssetVariantsMenu.cs
32 lines (26 loc) · 1007 Bytes
/
AssetVariantsMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using UnityEngine;
using UnityEditor;
public class AssetVariantsMenu {
[MenuItem("Assets/Create Scene Variants", true)]
static bool CreateSceneVariantsValidation(){
return Selection.activeObject.GetType() == typeof(SceneAsset);
}
[MenuItem("Assets/Create Scene Variants", false, 10000)]
static void CreateSceneVariants(){
Object[] selectedScenes = Selection.GetFiltered(typeof(SceneAsset), SelectionMode.Assets);
foreach(SceneAsset scene in selectedScenes){
AssetVariants.CreateSceneVariant(scene, "sd");
}
}
[MenuItem("Assets/Create Prefab Variants", true)]
static bool CreatePrefabVariantsValidation(){
return Selection.activeObject.GetType() == typeof(GameObject);
}
[MenuItem("Assets/Create Prefab Variants", false, 10010)]
static void CreatePrefabVariants(){
Object[] selectedPrefabs = Selection.GetFiltered(typeof(GameObject), SelectionMode.Assets);
foreach (GameObject prefab in selectedPrefabs){
AssetVariants.CreatePrefabVariant(prefab, "sd");
}
}
}