public AnimationHierarchyData GetAnimationHierarchyData(FoldoutTree tree) { return(new AnimationHierarchyData { animationWindow = this.m_AnimationWindow, animationSelection = this, states = tree.states }); }
public void Refresh() { this.SetAnimationCurves(); FoldoutTree[] trees = this.trees; for (int i = 0; i < trees.Length; i++) { FoldoutTree foldoutTree = trees[i]; foldoutTree.Refresh(this.GetAnimationHierarchyData(foldoutTree)); } }
private void GenerateAnimationSelections() { bool flag = AnimationMode.InAnimationMode(); bool flag2 = false; int frame = this.state.m_Frame; this.EndAnimationMode(); List<AnimationSelection> list = new List<AnimationSelection>(); GameObject gameObject = (!(Selection.activeGameObject != null)) ? this.state.m_ActiveGameObject : Selection.activeGameObject; Transform transform = (!gameObject) ? null : gameObject.transform; if (transform == null && this.state.m_RootGameObject != null) { transform = ((!(this.state.m_RootGameObject != null)) ? null : this.state.m_RootGameObject.transform); this.state.m_ActiveGameObject = this.state.m_RootGameObject; this.state.refresh = AnimationWindowState.RefreshType.Everything; } if (transform != null) { GameObject[] array = this.GetAnimationComponentsInAllParents(transform); if (array.Length == 0) { array = this.GetAllParents(transform); } AnimationSelection orAddAnimationSelectionWithObjects = this.GetOrAddAnimationSelectionWithObjects(array, list); if (AnimationWindow.m_Selected != null) { AnimationSelection[] selected = AnimationWindow.m_Selected; for (int i = 0; i < selected.Length; i++) { AnimationSelection animationSelection = selected[i]; if (animationSelection.animatedObject == orAddAnimationSelectionWithObjects.animatedObject) { flag2 = true; } } } FoldoutTree tree = new FoldoutTree(transform, this.m_ExpandedFoldouts); orAddAnimationSelectionWithObjects.AddTree(tree); } AnimationWindow.m_Selected = list.ToArray(); if (AnimationWindow.m_Selected != null && AnimationWindow.m_Selected.Length > 0) { if (Selection.activeGameObject != null) { this.state.m_ActiveGameObject = Selection.activeGameObject; } this.state.m_ActiveAnimationClip = AnimationWindow.m_Selected[0].clip; this.state.m_RootGameObject = AnimationWindow.m_Selected[0].avatarRootObject; } else { if (Selection.activeObject != null) { this.state.m_ActiveAnimationClip = null; this.state.m_RootGameObject = null; this.state.m_ActiveGameObject = null; this.state.refresh = AnimationWindowState.RefreshType.Everything; } } if (flag && flag2) { this.state.m_Frame = frame; this.BeginAnimationMode(false); } if (!flag2) { AnimationEventPopup.ClosePopup(); this.m_AnimationEventTimeLine.DeselectAll(); } }
public void AddTree(FoldoutTree tree) { Array.Resize <FoldoutTree>(ref this.m_Trees, this.m_Trees.Length + 1); this.trees[this.trees.Length - 1] = tree; }
public void AddTree(FoldoutTree tree) { Array.Resize<FoldoutTree>(ref this.m_Trees, this.m_Trees.Length + 1); this.trees[this.trees.Length - 1] = tree; }
public AnimationHierarchyData GetAnimationHierarchyData(FoldoutTree tree) { return new AnimationHierarchyData { animationWindow = this.m_AnimationWindow, animationSelection = this, states = tree.states }; }