public void CrossFade(int idx, float length) { _fadeOutState = _fadeInState; _fadeInState = new GPUAnimationState(_skinningData, idx); _fadingLength = length; _fadingTime = 0f; enabled = true; }
public void Stop() { enabled = false; _fadeInState = null; _fadeOutState = null; _fadingLength = Mathf.Infinity; _fadingTime = 0f; }
public void Play(int idx) { _fadeOutState = null; _fadingLength = Mathf.Infinity; _fadingTime = 0f; _fadeInState = new GPUAnimationState(_skinningData, idx); enabled = true; }
public void Update(GPUAnimationState fadeOsutState, GPUAnimationState fadeInState, float percent) { //IRuntimeBoneInfo[] stateValues = _currState.runtimeBoneInfos; //Debug.Assert(stateValues.Length == _boneTransforms.Length); //for (int i = 0; i < _boneTransforms.Length; i++) //{ // TRS trs = stateValues[i].trs; // _boneTransforms[i].localToParentMatrix = Matrix4x4.TRS(trs.position * _currWeight, trs.rotation.MultyScalar(_currWeight), trs.scale * _currWeight); //} //VirtualBoneTransform rootNode = _boneTransforms[0]; //System.Action<VirtualBoneTransform> updateRecursive = null; //updateRecursive = node => //{ // node.Update(); // foreach (var child in node.children) // updateRecursive(child); // return; //}; //updateRecursive(rootNode); }