Example #1
0
 protected void UpdateArcNoise(int segmentIdx, bool reset)
 {
     for (int i = 0; i <= _SegmentNums[segmentIdx]; i++)
     {
         var factor = GetShiftCoef((float)i / _SegmentNums[segmentIdx]);
         if (reset)
         {
             _ArcTangentsShift[segmentIdx, i * 2]     = CUnityUtil.RandomXYQuaternion(30 * factor);
             _ArcTangentsShift[segmentIdx, i * 2 + 1] = CUnityUtil.RandomXYQuaternion(30 * factor);
             _ShiftVectors[segmentIdx, i]             = CUnityUtil.RandomVector3(0.3f * factor);
         }
         else
         {
             _ArcTangentsShift[segmentIdx, i * 2]     *= CUnityUtil.RandomXYQuaternion(10f * factor);
             _ArcTangentsShift[segmentIdx, i * 2 + 1] *= CUnityUtil.RandomXYQuaternion(10f * factor);
             _ShiftVectors[segmentIdx, i]             += CUnityUtil.RandomVector3(6 * Time.deltaTime) * factor;
         }
     }
 }