├── .gitignore ├── Assets └── 00Kamishiro │ └── EasyAnchorOverride │ ├── Editor │ ├── DataStructure.cs │ ├── Editor.cs │ ├── Manager.cs │ ├── UIHelper.cs │ └── VRCSDK.cs │ └── Kamishiro.UnityEditor.EasyAnchorSetup.asmdef ├── LICENSE ├── README.md └── README_EN.md /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | /[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | #Additional Settings 62 | /[Pp]rojectSettings/ 63 | /[Pp]ackages/ 64 | /[Aa]ssets/* 65 | !/[Aa]ssets/00Kamishiro 66 | .vscode/ -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Editor/DataStructure.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AoiKamishiro 3 | * 4 | * This code is provided under the MIT license. 5 | * 6 | */ 7 | 8 | namespace Kamishiro.UnityEditor.EasyAnchorSetup 9 | { 10 | internal static class Translate 11 | { 12 | private const string ContinueEN = "Continue"; 13 | private const string ContinueJP = "続行"; 14 | private const string CancelEN = "Cancel"; 15 | private const string CancelJP = "中止"; 16 | private const string updateAvatarJP = "Update Avatar を押してアバター一覧を更新します。"; 17 | private const string UpdateAvatarEN = "Press Update Avatar to update your avatar list."; 18 | private const string AnchorNoneJP = "AnchorOverride が None になっている項目はスキップされます。"; 19 | private const string AnchorNoneEN = "Items with AnchorOverride set to None will be skipped."; 20 | private const string NoDescriptorJP = "VRC_AvatarDesctipterが見つかりませんでした。"; 21 | private const string NoDesctiptorEN = "VRC_AvatarDesctipter was not found."; 22 | private const string ModAcceptJP = "シーンを保存し、以下のアバターのAnchorOverrideの設定を変更します。宜しいですか?"; 23 | private const string ModscceptEN = "Save the scene and change the AnchorOverride settings for your avatar below. Is that alright?"; 24 | private const string OverrideErrorJP = "AnchorOverrideがアバターの子にありません。アバター内のオブジェクトを指定してください。"; 25 | private const string OverrideErrorEN = "AnchorOverride is not in my avatar's children. Please specify an object in your avatar."; 26 | private const string OperationFinEn = "Th process is completed."; 27 | private const string OperationFinJP = "処理が完了しました。"; 28 | 29 | public static string UpdateAvatar() 30 | { 31 | return Langs.current == Langs.Language.English ? UpdateAvatarEN : updateAvatarJP; 32 | } 33 | public static string AnchorNone() 34 | { 35 | return Langs.current == Langs.Language.English ? AnchorNoneEN : AnchorNoneJP; 36 | } 37 | public static string NoDesctiptor() 38 | { 39 | return Langs.current == Langs.Language.English ? NoDesctiptorEN : NoDescriptorJP; 40 | } 41 | public static string ModAccept() 42 | { 43 | return Langs.current == Langs.Language.English ? ModscceptEN : ModAcceptJP; 44 | } 45 | public static string OverrideError() 46 | { 47 | return Langs.current == Langs.Language.English ? OverrideErrorEN : OverrideErrorJP; 48 | } 49 | public static string OperationFin() 50 | { 51 | return Langs.current == Langs.Language.English ? OperationFinEn : OperationFinJP; 52 | } 53 | public static string Continue() 54 | { 55 | return Langs.current == Langs.Language.English ? ContinueEN : ContinueJP; 56 | } 57 | public static string Cancel() 58 | { 59 | return Langs.current == Langs.Language.English ? CancelEN : CancelJP; 60 | } 61 | } 62 | internal static class URL 63 | { 64 | public const string GIUHUB_REPOS = "https://github.com/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup"; 65 | public const string GITHUB_RELEASE = "https://github.com/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup/releases"; 66 | public const string GITHUB_VERCHECK = "https://api.github.com/repos/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup/releases/latest"; 67 | public const string BOOTH_PAGE = "https://kamishirolab.booth.pm/items/2494327"; 68 | public const string VKET_PAGE ="https://www.v-market.work/ec/items/3993/detail/"; 69 | } 70 | 71 | internal static class UIText 72 | { 73 | public const string btnGithub ="Github"; 74 | public const string btnBooth ="Booth"; 75 | public const string btnVket ="Vket"; 76 | } 77 | } -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Editor/Editor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AoiKamishiro 3 | * 4 | * This code is provided under the MIT license. 5 | * 6 | */ 7 | 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using UnityEditor; 11 | using UnityEditor.SceneManagement; 12 | using UnityEngine; 13 | using UnityEngine.SceneManagement; 14 | 15 | namespace Kamishiro.UnityEditor.EasyAnchorSetup 16 | { 17 | public class MainWindow : EditorWindow 18 | { 19 | [MenuItem("Tools/Kamishiro/EasyAnchorSetup", priority = 150)] 20 | private static void OnEnable() 21 | { 22 | MainWindow window = GetWindow("EasyAnchorSetup"); 23 | window.minSize = new Vector2(400, 360); 24 | window.Show(); 25 | } 26 | 27 | private GameObject[] avatars = new GameObject[] { }; 28 | private Transform[] anchors = new Transform[] { }; 29 | private bool isFirst = true; 30 | private bool showHelp = true; 31 | private Vector2 scroll = Vector2.zero; 32 | 33 | private void OnGUI() 34 | { 35 | if (isFirst) 36 | { 37 | UpdateList(); 38 | isFirst = false; 39 | } 40 | 41 | UIHelper.ShurikenHeader("EasyAnchorSetup"); 42 | 43 | EditorGUILayout.Space(); 44 | EditorGUILayout.BeginHorizontal(); 45 | EditorGUILayout.LabelField("Language"); 46 | Langs.current = (Langs.Language)EditorGUILayout.EnumPopup(Langs.current); 47 | EditorGUILayout.EndHorizontal(); 48 | showHelp = EditorGUILayout.ToggleLeft("Show help", showHelp); 49 | 50 | if (showHelp) EditorGUILayout.HelpBox(Translate.UpdateAvatar(), MessageType.Info); 51 | if (GUILayout.Button("Update Avtars")) 52 | { 53 | UpdateList(); 54 | } 55 | EditorGUILayout.BeginHorizontal(); 56 | EditorGUILayout.LabelField("Avatars", EditorStyles.boldLabel); 57 | EditorGUILayout.LabelField("AnchorOverride", EditorStyles.boldLabel); 58 | EditorGUILayout.EndHorizontal(); 59 | 60 | scroll = EditorGUILayout.BeginScrollView(scroll); 61 | if (avatars.Length > 0) 62 | { 63 | for (int i = 0; i < avatars.Length; i++) 64 | { 65 | EditorGUILayout.BeginHorizontal(); 66 | try 67 | { 68 | DrawAvatarList(i); 69 | } 70 | catch 71 | { 72 | UpdateList(); 73 | DrawAvatarList(i); 74 | } 75 | EditorGUILayout.EndHorizontal(); 76 | } 77 | 78 | if (showHelp) EditorGUILayout.HelpBox(Translate.AnchorNone(), MessageType.Info); 79 | bool result = CheckAnchor(); 80 | EditorGUILayout.EndScrollView(); 81 | bool btnresult; 82 | EditorGUI.BeginDisabledGroup(result); 83 | btnresult = GUILayout.Button("Setup Anchor Override"); 84 | EditorGUI.EndDisabledGroup(); 85 | if (btnresult) 86 | { 87 | ConfirmDialog(); 88 | } 89 | } 90 | else 91 | { 92 | if (showHelp) EditorGUILayout.HelpBox(Translate.NoDesctiptor(), MessageType.Info); 93 | } 94 | UIHelper.ShurikenHeader("About"); 95 | EditorGUILayout.LabelField("Author: AoiKamishiro / 神城アオイ", EditorStyles.boldLabel); 96 | 97 | if (GUILayout.Button("Readme")) 98 | { 99 | UIHelper.OpenLink(URL.GIUHUB_REPOS); 100 | } 101 | Version.DisplayVersion(); 102 | EditorGUILayout.Space(); 103 | } 104 | private void DrawAvatarList(int i) 105 | { 106 | EditorGUILayout.LabelField(avatars[i].name); 107 | anchors[i] = (Transform)EditorGUILayout.ObjectField(anchors[i], typeof(Transform), true); 108 | } 109 | private GameObject[] SortGameObjects(GameObject[] gameObjects) 110 | { 111 | List rev = gameObjects.ToList(); 112 | rev.Sort((a, b) => (a.transform.GetSiblingIndex() - b.transform.GetSiblingIndex())); 113 | return rev.ToArray(); 114 | } 115 | private Transform[] GetCurrentAnchors() 116 | { 117 | Transform[] anchorOverrides = new Transform[avatars.Length]; 118 | 119 | for (int i = 0; i < avatars.Length; i++) 120 | { 121 | MeshRenderer[] mesh = avatars[i].GetComponentsInChildren(); 122 | SkinnedMeshRenderer[] skinMesh = avatars[i].GetComponentsInChildren(); 123 | Transform[] ac = new Transform[] { }; 124 | 125 | if (mesh != null && mesh.Length > 0) 126 | { 127 | for (int j = 0; j < mesh.Length; j++) 128 | { 129 | ac = ac.Concat(new Transform[] { mesh[j].probeAnchor }).ToArray(); 130 | } 131 | } 132 | if (skinMesh != null && skinMesh.Length > 0) 133 | { 134 | for (int j = 0; j < skinMesh.Length; j++) 135 | { 136 | ac = ac.Concat(new Transform[] { skinMesh[j].probeAnchor }).ToArray(); 137 | } 138 | } 139 | 140 | ac = (ac.ToList().Distinct()).ToArray(); 141 | anchorOverrides[i] = ac.Length == 1 ? ac[0] : null; 142 | } 143 | return anchorOverrides; 144 | } 145 | private void UpdateAnchors() 146 | { 147 | for (int i = 0; i < avatars.Length; i++) 148 | { 149 | if (anchors[i] != null) 150 | { 151 | MeshRenderer[] mesh = avatars[i].GetComponentsInChildren(); 152 | SkinnedMeshRenderer[] skinMesh = avatars[i].GetComponentsInChildren(); 153 | 154 | if (mesh != null && mesh.Length > 0) 155 | { 156 | for (int j = 0; j < mesh.Length; j++) 157 | { 158 | mesh[j].probeAnchor = anchors[i]; 159 | } 160 | } 161 | if (skinMesh != null && skinMesh.Length > 0) 162 | { 163 | for (int j = 0; j < skinMesh.Length; j++) 164 | { 165 | skinMesh[j].probeAnchor = anchors[i]; 166 | } 167 | } 168 | } 169 | } 170 | } 171 | private void SetSceneDirty() 172 | { 173 | for (int i = 0; i < SceneManager.sceneCount; i++) 174 | { 175 | if (SceneManager.GetSceneAt(i).isLoaded) 176 | { 177 | EditorSceneManager.MarkSceneDirty(SceneManager.GetSceneAt(i)); 178 | } 179 | } 180 | } 181 | private void SaveScene() 182 | { 183 | for (int i = 0; i < SceneManager.sceneCount; i++) 184 | { 185 | if (SceneManager.GetSceneAt(i).isLoaded) 186 | { 187 | EditorSceneManager.SaveScene(SceneManager.GetSceneAt(i)); 188 | } 189 | } 190 | } 191 | private void ConfirmDialog() 192 | { 193 | string avtrs = "\n"; 194 | for (int i = 0; i < avatars.Length; i++) 195 | { 196 | if (anchors[i] != null) 197 | { 198 | avtrs += "\n" + avatars[i].name; 199 | } 200 | } 201 | bool result = EditorUtility.DisplayDialog("Auto AnchorOverride", Translate.ModAccept() + avtrs, Translate.Continue(), Translate.Cancel()); 202 | if (result) 203 | { 204 | SaveScene(); 205 | UpdateAnchors(); 206 | SetSceneDirty(); 207 | UpdateList(); 208 | EditorUtility.DisplayDialog("Auto AnchorOverride", Translate.OperationFin(), "OK"); 209 | } 210 | } 211 | private void UpdateList() 212 | { 213 | avatars = SortGameObjects(VRCSDK.GetAllAvatars()); 214 | anchors = GetCurrentAnchors(); 215 | } 216 | private bool CheckAnchor() 217 | { 218 | bool rev = false; 219 | for (int i = 0; i < avatars.Length; i++) 220 | { 221 | if (anchors[i] != null) 222 | { 223 | if (!isInChildern(avatars[i].transform, anchors[i])) 224 | { 225 | rev = true; 226 | EditorGUILayout.HelpBox(Translate.OverrideError() + "\n" + avatars[i].name, MessageType.Error); 227 | } 228 | } 229 | } 230 | return rev; 231 | } 232 | private bool isInChildern(Transform parent, Transform child) 233 | { 234 | Transform[] tr = parent.GetComponentsInChildren(); 235 | return tr.Contains(child); 236 | } 237 | } 238 | } -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Editor/Manager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AoiKamishiro 3 | * 4 | * This code is provided under the MIT license. 5 | * 6 | */ 7 | 8 | using UnityEditor; 9 | using UnityEditor.Callbacks; 10 | using UnityEngine; 11 | using UnityEngine.Networking; 12 | 13 | namespace Kamishiro.UnityEditor.EasyAnchorSetup 14 | { 15 | internal static class Langs 16 | { 17 | public static Language current = Language.Japanese; 18 | public enum Language 19 | { 20 | Japanese, 21 | English 22 | } 23 | } 24 | 25 | public class Version 26 | { 27 | public static int versionInt; 28 | private const string version = "v1.31"; 29 | private static UnityWebRequest www; 30 | private const string localver = "akeasyanchorsetup_version_local"; 31 | private const string remotever = "akeasyanchorsetup_version_remote"; 32 | private const string needUpdate = "akeasyanchorsetup_need_update"; 33 | 34 | [DidReloadScripts(0)] 35 | private static void CheckVersion() 36 | { 37 | if (EditorApplication.isPlayingOrWillChangePlaymode) return; 38 | int.TryParse(version.Substring(1), out int verint); 39 | versionInt = verint * 100; 40 | // Check Local Version 41 | string localVersion = EditorUserSettings.GetConfigValue(localver) ?? ""; 42 | 43 | if (!localVersion.Equals(version)) 44 | { 45 | // Update Materiams 46 | //ArktoonMigrator.Migrate(); 47 | } 48 | // Set Local Version 49 | EditorUserSettings.SetConfigValue(localver, version); 50 | // Get Remote Version 51 | www = UnityWebRequest.Get(URL.GITHUB_VERCHECK); 52 | 53 | #if UNITY_2017_OR_NEWER 54 | www.SendWebRequest(); 55 | #else 56 | #pragma warning disable 0618 57 | www.Send(); 58 | #pragma warning restore 0618 59 | #endif 60 | 61 | EditorApplication.update += EditorUpdate; 62 | EditorUserSettings.SetConfigValue(needUpdate, NeedUpdate().ToString()); 63 | } 64 | 65 | 66 | private static void EditorUpdate() 67 | { 68 | while (!www.isDone) return; 69 | 70 | #if UNITY_2017_OR_NEWER 71 | if (www.isNetworkError || www.isHttpError) { 72 | Debug.Log(www.error); 73 | } else { 74 | UpdateHandler(www.downloadHandler.text); 75 | } 76 | #else 77 | #pragma warning disable 0618 78 | if (www.isError) 79 | { 80 | Debug.Log(www.error); 81 | } 82 | else 83 | { 84 | UpdateHandler(www.downloadHandler.text); 85 | } 86 | #pragma warning restore 0618 87 | #endif 88 | 89 | EditorApplication.update -= EditorUpdate; 90 | } 91 | 92 | private static void UpdateHandler(string apiResult) 93 | { 94 | GitJson git = JsonUtility.FromJson(apiResult); 95 | string version = git.tag_name; 96 | EditorUserSettings.SetConfigValue(remotever, version); 97 | } 98 | 99 | private static bool NeedUpdate() 100 | { 101 | bool needUpdate = false; 102 | bool parseLocal = double.TryParse((EditorUserSettings.GetConfigValue(localver)).Substring(1), out double localVer); 103 | bool parseRemote = double.TryParse((EditorUserSettings.GetConfigValue(remotever)).Substring(1), out double remoteVer); 104 | if (parseLocal && parseRemote && (localVer < remoteVer)) 105 | { 106 | needUpdate = true; 107 | } 108 | return needUpdate; 109 | } 110 | public static void DisplayVersion() 111 | { 112 | EditorGUILayout.LabelField("Local Version: " + EditorUserSettings.GetConfigValue(localver)); 113 | EditorGUILayout.LabelField("Remote Version: " + EditorUserSettings.GetConfigValue(remotever)); 114 | if (bool.TryParse(EditorUserSettings.GetConfigValue(needUpdate), out bool needupdate) && needupdate) 115 | { 116 | using (new EditorGUILayout.VerticalScope(GUI.skin.box)) 117 | { 118 | EditorGUILayout.LabelField("Update", EditorStyles.boldLabel); 119 | using (new EditorGUILayout.HorizontalScope()) 120 | { 121 | if (GUILayout.Button(UIText.btnGithub)) { UIHelper.OpenLink(URL.GITHUB_RELEASE); } 122 | if (GUILayout.Button(UIText.btnBooth)) { UIHelper.OpenLink(URL.BOOTH_PAGE); } 123 | if (GUILayout.Button(UIText.btnVket)) { UIHelper.OpenLink(URL.VKET_PAGE); } 124 | } 125 | } 126 | } 127 | } 128 | public class GitJson 129 | { 130 | public string tag_name; 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Editor/UIHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AoiKamishiro 3 | * 4 | * This code is provided under the MIT license. 5 | * 6 | * This program uses the following code, which is provided under the MIT License 7 | * https://github.com/synqark/Arktoon-Shaders 8 | * 9 | */ 10 | 11 | using UnityEditor; 12 | using UnityEngine; 13 | 14 | namespace Kamishiro.UnityEditor.EasyAnchorSetup 15 | { 16 | public static class UIHelper 17 | { 18 | private static readonly int HEADER_HEIGHT = 22; 19 | private static Rect DrawShuriken(string title, Vector2 contentOffset) 20 | { 21 | GUIStyle style = new GUIStyle("ShurikenModuleTitle") 22 | { 23 | margin = new RectOffset(0, 0, 8, 0), 24 | font = new GUIStyle(EditorStyles.boldLabel).font, 25 | border = new RectOffset(15, 7, 4, 4), 26 | fixedHeight = HEADER_HEIGHT, 27 | contentOffset = contentOffset 28 | }; 29 | Rect rect = GUILayoutUtility.GetRect(16f, HEADER_HEIGHT, style); 30 | GUI.Box(rect, title, style); 31 | return rect; 32 | } 33 | public static void ShurikenHeader(string title) 34 | { 35 | DrawShuriken(title, new Vector2(6f, -2f)); 36 | } 37 | public static bool ShurikenFoldout(string title, bool display) 38 | { 39 | Rect rect = DrawShuriken(title, new Vector2(20f, -2f)); 40 | Event e = Event.current; 41 | Rect toggleRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); 42 | if (e.type == EventType.Repaint) 43 | { 44 | EditorStyles.foldout.Draw(toggleRect, false, false, display, false); 45 | } 46 | if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition)) 47 | { 48 | display = !display; 49 | e.Use(); 50 | } 51 | return display; 52 | } 53 | public static void OpenLink(string link) 54 | { 55 | Application.OpenURL(link); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Editor/VRCSDK.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021 AoiKamishiro 3 | * 4 | * This code is provided under the MIT license. 5 | * 6 | */ 7 | 8 | #if VRC_SDK_VRCSDK2 9 | using VRCSDK2; 10 | #endif 11 | #if VRC_SDK_VRCSDK3 12 | using VRC.SDK3.Avatars.Components; 13 | #endif 14 | using UnityEngine; 15 | using UnityEditor; 16 | using System.Linq; 17 | 18 | namespace Kamishiro.UnityEditor.EasyAnchorSetup 19 | { 20 | public static class VRCSDK 21 | { 22 | #if VRC_SDK_VRCSDK2 23 | public static GameObject[] GetAllAvatars() 24 | { 25 | GameObject[] rev = new GameObject[] { }; 26 | 27 | VRC_AvatarDescriptor[] avatarDescriptors = Resources.FindObjectsOfTypeAll(typeof(VRC_AvatarDescriptor)) as VRC_AvatarDescriptor[]; 28 | 29 | foreach (VRC_AvatarDescriptor a in avatarDescriptors) 30 | { 31 | if (a.hideFlags != HideFlags.NotEditable && a.hideFlags != HideFlags.HideAndDontSave) 32 | { 33 | string path = AssetDatabase.GetAssetOrScenePath(a); 34 | bool isScene = path.Contains(".unity"); 35 | if (isScene) 36 | { 37 | rev = rev.Concat(new GameObject[] { a.gameObject }).ToArray(); 38 | } 39 | } 40 | } 41 | return rev; 42 | } 43 | #endif 44 | #if VRC_SDK_VRCSDK3 45 | public static GameObject[] GetAllAvatars() 46 | { 47 | GameObject[] rev = new GameObject[] { }; 48 | 49 | VRCAvatarDescriptor[] avatarDescriptors = Resources.FindObjectsOfTypeAll(typeof(VRCAvatarDescriptor)) as VRCAvatarDescriptor[]; 50 | 51 | foreach (VRCAvatarDescriptor a in avatarDescriptors) 52 | { 53 | if (a.hideFlags != HideFlags.NotEditable && a.hideFlags != HideFlags.HideAndDontSave) 54 | { 55 | string path = AssetDatabase.GetAssetOrScenePath(a); 56 | bool isScene = path.Contains(".unity"); 57 | if (isScene) 58 | { 59 | rev = rev.Concat(new GameObject[] { a.gameObject }).ToArray(); 60 | } 61 | } 62 | } 63 | return rev; 64 | } 65 | #endif 66 | 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/00Kamishiro/EasyAnchorOverride/Kamishiro.UnityEditor.EasyAnchorSetup.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Kamishiro.UnityEditor.EasyAnchorSetup", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [ 7 | "Android", 8 | "iOS", 9 | "LinuxStandalone32", 10 | "LinuxStandalone64", 11 | "LinuxStandaloneUniversal", 12 | "Lumin", 13 | "macOSStandalone", 14 | "PS4", 15 | "Switch", 16 | "tvOS", 17 | "WSA", 18 | "WebGL", 19 | "WindowsStandalone32", 20 | "WindowsStandalone64", 21 | "XboxOne" 22 | ], 23 | "allowUnsafeCode": false, 24 | "overrideReferences": false, 25 | "precompiledReferences": [], 26 | "autoReferenced": true, 27 | "defineConstraints": [] 28 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 AoiKamishiro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityCustomEditor_EasyAnchorSetup 2 | ## [最新版のダウンロードはこちら](https://github.com/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup/releases) 3 | ## [English](https://github.com/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup/blob/master/README_EN.md) 4 | ## ※更新の際は以前のバージョンを削除してからインポートしてください。 5 | ### 拡張エディタについて 6 | なんか自分のアバター、顔だけ暗いんだけど!?みたいな現象に覚えはありませんか? 7 | もしそういう経験があるようなら、そういう方にこそぜひおすすめしたいツールです。 8 | このツールは、アバター内の全てのパーツの光の当たり方を統一させ、アバターがちぐはぐな明るさになる事を防ぐのに役立ちます。 9 | 10 | 全て手作業で設定するより断然簡単なので、是非お試しあれ。 11 | 12 | 13 | アバターの SkinnedMeshRenderer / MeshRenderer のAnchorOverride を一括で設定するツールです。 14 | SDK2,SDK3 両対応です。 15 | 16 | ### 困ったら 17 | AnchorOverrideに何を設定したら良いかわからない!という場合は、アバターのHeadかChestのボーンを指定するといいと思います。 18 | ツールの不具合などは下記連絡先まで。 19 | 20 | * [Booth ショップページ](https://kamishirolab.booth.pm/items/2494327) 21 | * [Vket ショップページ](https://www.v-market.work/ec/items/3993/detail/) 22 | ### 想定環境 23 | * Unity 2018.4.20f1 24 | * VRCSDK2 or VRCSDK3-Avatar 25 | ### 使用方法 26 | UnityPackage をインポート後、Tools/Kamishiro/EasyAnchorSetup から起動できます。 27 | ### 連絡先 28 | [Twitter: @aoi3192](https://twitter.com/aoi3192) 29 | [Booth: 神城工業](https://kamishirolab.booth.pm/) 30 | [Vket: 神城工業](https://www.v-market.work/ec/shops/1810/detail/) 31 | [VRC: 神城アオイ](https://www.vrchat.com/home/user/usr_19514816-2cf8-43cc-a046-9e2d87d15af7) -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # UnityCustomEditor_EasyAnchorSetup 2 | ## [download the latest version here](https://github.com/AoiKamishiro/UnityCustomEditor_EasyAnchorSetup/releases) 3 | ## *You must delete the previous version before importing. 4 | ### About Editor. 5 | This is a tool to set the AnchorOverride of the SkinnedMeshRenderer / MeshRenderer for your avatar. 6 | Both SDK2 and SDK3 are supported. 7 | * [Booth Page](https://kamishirolab.booth.pm/items/2494327) 8 | ### Assumptions. 9 | * Unity 2018.4.20f1 10 | * VRCSDK2 or VRCSDK3-Avatar 11 | ### Use. 12 | After importing the UnityPackage, you can launch it from Tools/Kamishiro/EasyAnchorSetup. 13 | ### Contact. 14 | [Twitter: @aoi3192](https://twitter.com/aoi3192) 15 | [Booth: Kamishiro Industries](https://kamishirolab.booth.pm/) --------------------------------------------------------------------------------