コード例 #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)));
 }