public static ExpressionSyntax MakeKeyPressConstraint(OnKeyPressEcsNodeModel model) { var code = model.Code; var pressType = model.PressType; if (code == KeyCode.None) { return(null); } return(InvocationExpression(KeyFunctionForPressType(pressType)) .WithArgumentList( ArgumentList( SingletonSeparatedList( Argument(GetEnumSyntax(code)))))); }
public static IEnumerable <SyntaxNode> BuildOnKeyPressEcs(this RoslynEcsTranslator translator, OnKeyPressEcsNodeModel model, IPortModel portModel) { return(translator.BuildOnEntitiesEventBase(model, MakeKeyPressConstraint(model))); }