Exemplo n.º 1
0
        public AddNodeMenuData Add(string name, AddNodeMenuData data)
        {
            if (!IsNodeEntry && !m_Data.ContainsKey(name))
            {
                m_Data.Add(name, data);
                return(data);
            }

            return(null);
        }
Exemplo n.º 2
0
        private void BuildRootData()
        {
            m_RootData = new AddNodeMenuData();
            foreach (var nodeInfo in Node.NodeInfos)
            {
                var attrs       = nodeInfo.type.GetCustomAttributes(typeof(MarkAsNode), false);
                var displayName = nodeInfo.type.GetDisplayName();
                if (attrs.Length != 0)
                {
                    var attr = attrs[0] as MarkAsNode;
                    if (attr.HideInInspector)
                    {
                        continue;
                    }
                    if (attr.DisplayName != null)
                    {
                        displayName = attr.DisplayName;
                    }
                }

                AddNodeInfoToRoot(nodeInfo, displayName);
            }
        }