/// <summary> /// Perform any fading / width delta required; internal method /// </summary> /// <param name="time"> The time of the update</param> /// public virtual void TimeUpdate(float time) { // Apply all segment effects for (int s = 0; s < chainSegmentList.Count; s++) { ChainSegment seg = chainSegmentList[s]; TrailAttributes attributes = trailAttributes[s]; if (seg.head != SEGMENT_EMPTY && seg.head != seg.tail) { for (int e = seg.head + 1;; ++e) { e = e % maxElementsPerChain; Element elem = chainElementList[seg.start + e]; elem.width = elem.width - (time * attributes.deltaWidth); elem.width = Math.Max(0.0f, elem.width); elem.color = elem.color - (attributes.deltaColor * time); elem.color.Saturate(); if (e == seg.tail) { break; } } } } }
protected void InitializeRibbonTrail() { this.TexCoordDirection = TextureCoordDirection.V; trailAttributes = new TrailAttributes[numberOfChains]; for (int i = 0; i < numberOfChains; i++) { trailAttributes[i] = new TrailAttributes(); freeChains.Add(i); } }