Add animation transition
This commit is contained in:
@@ -582,10 +582,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
||||
{
|
||||
if (CurrentUMAContainer && CurrentUMAContainer.UmaAnimator)
|
||||
{
|
||||
AnimationClip bbb = asset as AnimationClip;
|
||||
bbb.wrapMode = WrapMode.Loop;
|
||||
CurrentUMAContainer.OverrideController["clip"] = bbb;
|
||||
CurrentUMAContainer.UmaAnimator.Play("clip", 0, 0);
|
||||
LoadAnimation(asset as AnimationClip);
|
||||
}
|
||||
|
||||
if (!CurrentLiveContainer)
|
||||
@@ -833,6 +830,41 @@ public class UmaViewerBuilder : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadAnimation(AnimationClip clip)
|
||||
{
|
||||
CurrentUMAContainer.OverrideController["clip_1"] = CurrentUMAContainer.OverrideController["clip_2"];
|
||||
var lastTime = CurrentUMAContainer.UmaAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime;
|
||||
CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime);
|
||||
bool needTransit = false;
|
||||
|
||||
if (clip.name.EndsWith("_loop"))
|
||||
{
|
||||
var motion_s = Main.AbList.FirstOrDefault(a => a.Name.EndsWith(clip.name.Replace("_loop", "_s")));
|
||||
var motion_e = Main.AbList.FirstOrDefault(a => a.Name.EndsWith(CurrentUMAContainer.OverrideController["clip_2"].name.Replace("_loop", "_e")));
|
||||
needTransit = (motion_s != null && motion_e != null);
|
||||
if (needTransit)
|
||||
{
|
||||
RecursiveLoadAsset(motion_e);
|
||||
RecursiveLoadAsset(motion_s);
|
||||
}
|
||||
CurrentUMAContainer.OverrideController["clip_2"] = clip;
|
||||
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
|
||||
}
|
||||
else if(clip.name.EndsWith("_S"))
|
||||
{
|
||||
CurrentUMAContainer.OverrideController["clip_s"] = clip;
|
||||
}
|
||||
else if(clip.name.EndsWith("_E"))
|
||||
{
|
||||
CurrentUMAContainer.OverrideController["clip_e"] = clip;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentUMAContainer.OverrideController["clip_2"] = clip;
|
||||
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
|
||||
}
|
||||
}
|
||||
|
||||
private void UnloadBundle(AssetBundle bundle, bool unloadAllObjects)
|
||||
{
|
||||
var entry = Main.LoadedBundles.FirstOrDefault(b => b.Value == bundle);
|
||||
|
||||
@@ -29,8 +29,9 @@ public class UmaViewerMain : MonoBehaviour
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
Application.targetFrameRate = -1;
|
||||
Instance = this;
|
||||
Application.targetFrameRate = -1;
|
||||
if (!Application.isEditor) Debug.unityLogger.logEnabled = false;
|
||||
AbList = UmaDatabaseController.Instance.MetaEntries.ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -358,10 +358,14 @@ public class UmaViewerUI : MonoBehaviour,FaceLoadCallBack
|
||||
Destroy(animationList.content.GetChild(i).gameObject);
|
||||
}
|
||||
|
||||
var filteredList = mini ?
|
||||
Main.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.MotionPath) && !a.Name.Contains($"mirror") && a.Name.Contains($"mini") && !a.Name.Contains($"facial") && !a.Name.Contains($"_cam"))
|
||||
:
|
||||
Main.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.MotionPath) && !a.Name.Contains($"mirror") && !a.Name.Contains($"mini") && !a.Name.Contains($"facial") && !a.Name.Contains($"_cam"));
|
||||
var filteredList = Main.AbList.Where(a => a.Name.StartsWith(UmaDatabaseController.MotionPath)
|
||||
&& !a.Name.Contains($"mirror")
|
||||
&& (mini ? a.Name.Contains($"mini") : !a.Name.Contains($"mini"))
|
||||
&& !a.Name.Contains($"facial")
|
||||
&& !a.Name.Contains($"_cam")
|
||||
&& !a.Name.EndsWith($"_s")
|
||||
&& !a.Name.EndsWith($"_e")
|
||||
);
|
||||
|
||||
if (umaId == -1)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Gallop
|
||||
|
||||
gameObjects.Clear();
|
||||
gameObjects.AddRange(transform.parent.transform.parent.GetComponentsInChildren<Transform>());
|
||||
foreach (CySpringParamDataElement spring in springParam)
|
||||
foreach(CySpringParamDataElement spring in springParam)
|
||||
{
|
||||
var bone = gameObjects.Find(a => { return a.name == spring._boneName; });
|
||||
if (bone)
|
||||
|
||||
Reference in New Issue
Block a user