Esempio n. 1
0
 public void CrossFade(int idx, float length)
 {
     _fadeOutState = _fadeInState;
     _fadeInState  = new GPUAnimationState(_skinningData, idx);
     _fadingLength = length;
     _fadingTime   = 0f;
     enabled       = true;
 }
Esempio n. 2
0
 public void Stop()
 {
     enabled       = false;
     _fadeInState  = null;
     _fadeOutState = null;
     _fadingLength = Mathf.Infinity;
     _fadingTime   = 0f;
 }
Esempio n. 3
0
 public void Play(int idx)
 {
     _fadeOutState = null;
     _fadingLength = Mathf.Infinity;
     _fadingTime   = 0f;
     _fadeInState  = new GPUAnimationState(_skinningData, idx);
     enabled       = true;
 }
Esempio n. 4
0
        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);
        }