void AddProperty(IShaderProperty property, bool create = false, int index = -1)
        {
            if (m_PropertyRows.ContainsKey(property.guid))
            {
                return;
            }
            var field = new BlackboardField(m_ExposedIcon, property.displayName, property.propertyType.ToString())
            {
                userData = property
            };
            var row = new BlackboardRow(field, new BlackboardFieldPropertyView(m_Graph, property));

            row.userData = property;
            if (index < 0)
            {
                index = m_PropertyRows.Count;
            }
            if (index == m_PropertyRows.Count)
            {
                m_Section.Add(row);
            }
            else
            {
                m_Section.Insert(index, row);
            }
            m_PropertyRows[property.guid] = row;

            if (create)
            {
                field.RenameGo();
                row.expanded = true;
                m_Graph.owner.RegisterCompleteObjectUndo("Create Property");
                m_Graph.AddShaderProperty(property);
            }
        }
Beispiel #2
0
 public static void OpenTextEditor(this BlackboardField field)
 {
     field.RenameGo();
 }