public void UpdateSerializeReferenceCurvesArrayNiceDisplayName() { if (state.activeRootGameObject == null) { return; } //This is required in the case that there might have been a topological change //leading to a different display name(topological path) SerializedObject so = null; foreach (AnimationWindowHierarchyNode hierarchyNode in GetRows()) { if (hierarchyNode.curves != null) { foreach (var curve in hierarchyNode.curves) { if (curve.isSerializeReferenceCurve && hierarchyNode.displayName.Contains(".Array.data[")) { var animatedObject = AnimationUtility.GetAnimatedObject(state.activeRootGameObject, curve.binding); if (animatedObject != null && (so == null || so.targetObject != animatedObject)) { so = new SerializedObject(animatedObject); } hierarchyNode.displayName = AnimationWindowUtility.GetNicePropertyDisplayName(curve.binding, so); } } } } }
private TreeViewItem CreateNode(EditorCurveBinding[] curveBindings, TreeViewItem parentNode, SerializedObject so) { var node = new AddCurvesPopupPropertyNode(parentNode, curveBindings, AnimationWindowUtility.GetNicePropertyDisplayName(curveBindings[0], so)); // For RectTransform.position we only want .z if (AnimationWindowUtility.IsRectTransformPosition(node.curveBindings[0])) { node.curveBindings = new EditorCurveBinding[] { node.curveBindings[2] } } ; node.icon = parentNode.icon; return(node); }
public AnimationWindowHierarchyPropertyNode(System.Type animatableObjectType, int setId, string propertyName, string path, TreeViewItem parent, EditorCurveBinding binding, bool isPptrNode) : base(AnimationWindowUtility.GetPropertyNodeID(setId, path, animatableObjectType, propertyName), parent != null ? parent.depth + 1 : -1, parent, animatableObjectType, propertyName, path, AnimationWindowUtility.GetNicePropertyDisplayName(animatableObjectType, propertyName)) { this.binding = binding; this.isPptrNode = isPptrNode; }
public AnimationWindowHierarchyPropertyNode(Type animatableObjectType, string propertyName, string path, TreeViewItem parent, EditorCurveBinding binding, bool isPptrNode) : base(AnimationWindowUtility.GetPropertyNodeID(path, animatableObjectType, propertyName), (parent == null) ? -1 : (parent.depth + 1), parent, animatableObjectType, propertyName, path, AnimationWindowUtility.GetNicePropertyDisplayName(animatableObjectType, propertyName)) { this.binding = new EditorCurveBinding?(binding); this.isPptrNode = isPptrNode; }
private AnimationWindowHierarchyPropertyNode AddPropertyToHierarchy(AnimationWindowCurve curve, AnimationWindowHierarchyNode parentNode, SerializedObject so) { AnimationWindowHierarchyPropertyNode node = new AnimationWindowHierarchyPropertyNode(curve.type, 0, curve.propertyName, curve.path, parentNode, curve.binding, curve.isPPtrCurve, AnimationWindowUtility.GetNicePropertyDisplayName(curve.binding, so)); if (parentNode.icon != null) { node.icon = parentNode.icon; } else { node.icon = GetIcon(curve.binding); } node.indent = curve.depth; node.curves = new[] { curve }; return(node); }