설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CurveTreeViewNode.cs 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Linq;
  2. using UnityEditor.IMGUI.Controls;
  3. using UnityEngine;
  4. namespace UnityEditor.Timeline
  5. {
  6. class CurveTreeViewNode : TreeViewItem
  7. {
  8. public bool forceGroup { get; }
  9. public System.Type iconType { get; }
  10. public GUIContent iconOverlay { get; }
  11. EditorCurveBinding[] m_Bindings;
  12. public EditorCurveBinding[] bindings
  13. {
  14. get { return m_Bindings; }
  15. }
  16. public CurveTreeViewNode(int id, TreeViewItem parent, string displayName, EditorCurveBinding[] bindings, bool _forceGroup = false)
  17. : base(id, parent != null ? parent.depth + 1 : -1, parent, displayName)
  18. {
  19. m_Bindings = bindings;
  20. forceGroup = _forceGroup;
  21. // capture the preview icon type. If all subbindings are the same type, use that. Otherwise use null as a default
  22. iconType = null;
  23. if (parent != null && parent.depth >= 0 && bindings != null && bindings.Length > 0 && bindings.All(b => b.type == bindings[0].type))
  24. {
  25. iconType = bindings[0].type;
  26. // for components put the component type in a tooltip
  27. if (iconType != null && typeof(Component).IsAssignableFrom(iconType))
  28. iconOverlay = new GUIContent(string.Empty, ObjectNames.NicifyVariableName(iconType.Name));
  29. }
  30. }
  31. }
  32. }