public static void PromptToUpdateSpringBonesFromList() { if (Application.isPlaying) { Debug.LogError("再生中に更新できません"); return; } var selectedSpringManagers = Selection.gameObjects .Select(gameObject => gameObject.GetComponent <SpringManager>()) .Where(manager => manager != null) .ToArray(); if (!selectedSpringManagers.Any()) { selectedSpringManagers = GameObjectUtil.FindComponentsOfType <SpringManager>().ToArray(); } if (selectedSpringManagers.Count() != 1) { Debug.LogError("一つだけのSpringManagerを選択してください"); return; } var springManager = selectedSpringManagers.First(); var queryMessage = "ボーンリストから揺れものボーンを更新しますか?\n\n" + "リストにないSpringBone情報は削除され、\n" + "モデルにないSpringBone情報は追加されます。\n\n" + "SpringManager: " + springManager.name; if (EditorUtility.DisplayDialog("ボーンリストから更新", queryMessage, "更新", "キャンセル")) { AutoSpringBoneSetup.UpdateSpringManagerFromBoneList(springManager); } }
public static void PromptToUpdateSpringBonesFromList() { if (Application.isPlaying) { Debug.LogError("Play过程中无法更新"); return; } var selectedSpringManagers = Selection.gameObjects .Select(gameObject => gameObject.GetComponent <SpringManager>()) .Where(manager => manager != null) .ToArray(); if (!selectedSpringManagers.Any()) { selectedSpringManagers = GameObjectUtil.FindComponentsOfType <SpringManager>().ToArray(); } if (selectedSpringManagers.Count() != 1) { Debug.LogError("只可以选择一个SpringManager"); return; } var springManager = selectedSpringManagers.First(); var queryMessage = "要根据所选Manager的列表更新SpringBone?\n\n" + "不在列表中的SpringBone信息会被删除、\n" + "列表中存在,但是模型上没有的SpringBone将被添加。\n\n" + "SpringManager: " + springManager.name; if (EditorUtility.DisplayDialog("从所选Manager的列表更新", queryMessage, "更新", "取消")) { AutoSpringBoneSetup.UpdateSpringManagerFromBoneList(springManager); } }