Beispiel #1
0
        public static ActionTreeItem AddTo(TreeViewItem parent, SerializedProperty actionMapProperty, SerializedProperty actionProperty)
        {
            var item = new ActionTreeItem(actionMapProperty, actionProperty);

            item.depth       = parent.depth + 1;
            item.displayName = item.name;
            parent.AddChild(item);

            return(item);
        }
Beispiel #2
0
        private void AddActionsTo(TreeViewItem parent, bool addBindings)
        {
            var actionsArrayProperty = this.actionsArrayProperty;

            Debug.Assert(actionsArrayProperty != null, $"Cannot find m_Actions in {property}");

            for (var i = 0; i < actionsArrayProperty.arraySize; i++)
            {
                var actionProperty = actionsArrayProperty.GetArrayElementAtIndex(i);
                var actionItem     = ActionTreeItem.AddTo(parent, property, actionProperty);

                if (addBindings)
                {
                    actionItem.AddBindingsTo(actionItem);
                }
            }
        }