-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
なにもしなければ自動で既存Actionを読み込むし、なにかすれば名前の設定や取捨選択もできる close #46
- Loading branch information
Showing
9 changed files
with
117 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
File renamed without changes.
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
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
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
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,44 @@ | ||
#if UNITY_EDITOR | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using com.github.pandrabox.emoteprefab.runtime; | ||
using nadena.dev.ndmf; | ||
using UnityEditor; | ||
using UnityEditor.Animations; | ||
using UnityEngine; | ||
using VRC.SDK3.Avatars.Components; | ||
using VRC.SDKBase; | ||
using static com.github.pandrabox.emoteprefab.runtime.Generic; | ||
|
||
|
||
namespace com.github.pandrabox.emoteprefab.runtime | ||
{ | ||
public class LegacySupport | ||
{ | ||
public LegacySupport(VRCAvatarDescriptor descriptor) | ||
{ | ||
AnimationClip[] clips = descriptor.baseAnimationLayers[3].animatorController?.animationClips; | ||
if (clips == null) return; | ||
HashSet<AnimationClip> uniqueClipsSet = new HashSet<AnimationClip>(clips); | ||
AnimationClip[] uniqueClips = new AnimationClip[uniqueClipsSet.Count]; | ||
uniqueClipsSet.CopyTo(uniqueClips); | ||
var root = new GameObject(Config.LegacyObjName); | ||
var folder = root.AddComponent<EmoteFolder>(); | ||
folder.FolderName = "Legacies"; | ||
root.transform.SetParent(descriptor.transform); | ||
foreach(var cl in uniqueClips) | ||
{ | ||
var obj = new GameObject(); | ||
obj.transform.SetParent(root.transform); | ||
var ep = obj.AddComponent<EmotePrefab>(); | ||
ep.SetEasy(cl); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.