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); }
/// <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); } }
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(); } }