Netcode Bootstrap

This commit is contained in:
Luis Gonzalez
2026-05-31 14:27:52 -07:00
parent 99d8d2d2a9
commit 7fa77ce821
1813 changed files with 2921554 additions and 84 deletions
@@ -0,0 +1,39 @@
#if UNITY_EDITOR
using System.Collections.Generic;
using Unity.Collections;
using UnityEditor;
using UnityEngine;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rukhanka.Hybrid
{
public partial class AnimationClipBaker
{
struct SampledCurve
{
public ParsedCurveBinding pb;
public float value;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
List<SampledCurve> SampleAnimation(AnimationClip ac, Avatar avatar, float time)
{
var rv = new List<SampledCurve>();
var bindings = AnimationUtility.GetCurveBindings(ac);
foreach (var cb in bindings)
{
var ec = AnimationUtility.GetEditorCurve(ac, cb);
var v = new SampledCurve();
v.pb = ParseCurveBinding(ac, cb, avatar);
v.value = ec.Evaluate(time);
rv.Add(v);
}
return rv;
}
}
}
#endif