Exemplo n.º 1
0
        internal TokenMatch AddMatch(int index, TokenMatch?match)
        {
            if (MatchMap == null || match == null)
            {
                return(match !);
            }

            if (!MatchMap.TryGetValue(index, out var matches))
            {
                MatchMap[index] = matches = new List <TokenMatch>();
            }

            matches.Add(match);

            return(match);
        }
Exemplo n.º 2
0
        /// <summary>
        /// try to get mirrored bone, if not found or is deactivated, return null
        /// </summary>
        public Transform GetMirrorBone(Transform thisBone)
        {
            string    thisTrPath = AnimationUtility.CalculateTransformPath(thisBone, m_AnimRoot);
            MatchBone matchBone;

            if (m_MatchMap.TryGetValue(thisTrPath, out matchBone))
            {
                string    thatTrPath = matchBone.path;
                Transform thatTr     = m_AnimRoot.Find(thatTrPath);
                return(thatTr);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        internal void ClearData(int?index = null)
        {
            if (MatchMap == null)
            {
                return;
            }

            if (index is int i)
            {
                if (MatchMap.TryGetValue(i, out var matches))
                {
                    matches.Clear();
                }
            }
            else
            {
                MatchMap.Clear();
            }
        }