예제 #1
0
        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))))));
        }
예제 #2
0
 public static IEnumerable <SyntaxNode> BuildOnKeyPressEcs(this RoslynEcsTranslator translator,
                                                           OnKeyPressEcsNodeModel model, IPortModel portModel)
 {
     return(translator.BuildOnEntitiesEventBase(model, MakeKeyPressConstraint(model)));
 }