-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
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,39 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace studio.raspberry.vrchat.ma_suimin_system | ||
{ | ||
public static class ContextMenu | ||
{ | ||
const string baseMenuPath = "GameObject/RBS-SuiminSystem/"; | ||
const string prefabPathBase = "Packages/studio.raspberry.vrchat.ma-suimin-system/Runtime/Prefabs/"; | ||
const string japanesePrefabName = "RBS_Suimin(日本語).prefab"; | ||
const string englishPrefabName = "RBS_Suimin(English).prefab"; | ||
|
||
[MenuItem(baseMenuPath + "日本語版のセットアップ(Japanese)")] | ||
public static void ApplyToAvatar_Japanese(MenuCommand command) | ||
{ | ||
GameObject obj = UnityEditor.PrefabUtility.InstantiatePrefab(AssetDatabase.LoadAssetAtPath<GameObject>(prefabPathBase + japanesePrefabName)) as GameObject; | ||
if (obj != null) | ||
{ | ||
Transform objTransform = obj.transform; | ||
objTransform.SetParent(Selection.activeTransform, false); | ||
UnityEditor.EditorUtility.SetDirty(obj); | ||
UnityEditor.EditorUtility.SetDirty(objTransform); | ||
} | ||
} | ||
|
||
[MenuItem(baseMenuPath + "Setup english version(英語)")] | ||
public static void ApplyToAvatar_English(MenuCommand command) | ||
{ | ||
GameObject obj = UnityEditor.PrefabUtility.InstantiatePrefab(AssetDatabase.LoadAssetAtPath<GameObject>(prefabPathBase + englishPrefabName)) as GameObject; | ||
if (obj != null) | ||
{ | ||
Transform objTransform = obj.transform; | ||
objTransform.SetParent(Selection.activeTransform, false); | ||
UnityEditor.EditorUtility.SetDirty(obj); | ||
UnityEditor.EditorUtility.SetDirty(objTransform); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
# RBS SuiminSystem 2 | ||
## ToDo: Write readme |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.