public static ComponentPortsDescription FromData(TypeHandle componentType, IReadOnlyList <Tuple <string, TypeHandle> > componentDescriptions, string prefix = null) { var result = new ComponentPortsDescription(componentType, componentDescriptions.Count, prefix) { m_FieldNames = componentDescriptions.Select(t => t.Item1).ToList() }; return(result); }
protected override void OnDefineNode() { EntityPort = AddDataInput <Entity>("entity"); if (ComponentType != TypeHandle.Unknown) { m_ComponentDescription = AddPortsForComponent(ComponentType); } }
internal ComponentPortsDescription AddPortsForComponent(TypeHandle comp, string prefix = null) { var inputsFromComponentType = HighLevelNodeModelHelpers.GetDataInputsFromComponentType(Stencil, comp).ToList(); var description = ComponentPortsDescription.FromData(comp, inputsFromComponentType, prefix); foreach (Tuple <string, TypeHandle> field in inputsFromComponentType) { AddDataInput($"{field.Item1}", field.Item2, description.GetFieldId(field.Item1)); } return(description); }
protected override void OnDefineNode() { EntityPort = AddDataInput <Entity>(EntityLabel); m_ComponentDescription = ComponentType != TypeHandle.Unknown ? AddPortsForComponent(ComponentType) : null; }