public void RemoveMixingTransform(string timelineName = null, bool recursive = true) { if (timelineName != null) { if (recursive) { int i = _armature._boneList.Count; Bone bone = null; Bone currentBone = null; while (i-- > 0) { bone = _armature._boneList[i]; if (bone.Name == timelineName) { currentBone = bone; } if (currentBone != null && (currentBone == bone || currentBone.Contains(bone))) { _mixingTransforms.Remove(bone.Name); } } } else { _mixingTransforms.Remove(timelineName); } bool hasMixing = false; foreach (KeyValuePair <string, int> timelineName1 in _mixingTransforms) { hasMixing = true; break; } if (!hasMixing) { _mixingTransforms = null; } } else { _mixingTransforms = null; } updateTimelineStates(); }
public void AddMixingTransform(string timelineName, int type = 2, bool recursive = true) { if (_clip != null && _clip.GetTimeline(timelineName) != null) { if (_mixingTransforms == null) { _mixingTransforms = new Dictionary <string, int>(); } if (recursive) { int i = _armature._boneList.Count; Bone bone = null; Bone currentBone = null; while (i-- > 0) { bone = _armature._boneList[i]; if (bone.Name == timelineName) { currentBone = bone; } if (currentBone != null && (currentBone == bone || currentBone.Contains(bone))) { _mixingTransforms[bone.Name] = type; } } } else { _mixingTransforms[timelineName] = type; } updateTimelineStates(); } else { throw new ArgumentException(); } }