Beispiel #1
0
        /// <summary>
        /// Dynamically removing tail segments from chain
        /// </summary>
        /// <param name="fromLastTo"> Segment with this index will be removed too but used as ghosting child </param>
        public void User_CutEndSegmentsTo(int fromLastTo)
        {
            if (fromLastTo < TailSegments.Count)
            {
                GhostChild = TailSegments[fromLastTo];
                GhostChild.SetChildRef(null);

                for (int i = TailSegments.Count - 1; i >= fromLastTo; i--)
                {
                    TailSegments.RemoveAt(i);
                    _TransformsGhostChain.RemoveAt(i);
                }
            }
            else
            {
                Debug.Log("[Tail Animator Cutting] Wrong index, you want cut from end to " + fromLastTo + " segment but there are only " + TailSegments.Count + " segments!");
            }
        }