Ejemplo n.º 1
0
            public State(JitterParameter _param)
            {
                param         = _param;
                nextAmplitude = param.amplitude.RandomInside();
                nextOffset    = param.offset.RandomInside();
                fastForward   = 0f;

                SetNextParameter();
            }
Ejemplo n.º 2
0
            /// <summary>
            /// 現在のWeightを計算
            /// </summary>
            /// <returns>weight</returns>
            public float GetCurrentWeight(AnimationCurve curve, JitterParameter _param = null)
            {
                if (curPeriod <= 0f)
                {
                    return(curOffset);
                }

                var easeParam = (_param == null) ? param : _param;

                float timer01 = Mathf.Clamp01(timer);
                float amp     = easeParam.easingAmplitude.Evaluate(curAmplitude, nextAmplitude, timer01);
                float ofs     = easeParam.easingOffset.Evaluate(curOffset, nextOffset, timer01);

                return(Mathf.Clamp(curve.Evaluate(timer01) * amp + ofs, -1, 1));
            }
Ejemplo n.º 3
0
 public float GetCurrentLoopWeight(AnimationCurve loopCurve, JitterParameter _param)
 {
     return(loopState.GetCurrentWeight(loopCurve, _param));
 }
Ejemplo n.º 4
0
 public JitterHelper(JitterParameter loopParameter, JitterParameter onceParameter)
 {
     loopState = new State(loopParameter);
     onceState = new State(onceParameter);
 }