Ejemplo n.º 1
0
    protected AlloyFieldParser(MaterialProperty prop)
    {
        var lexer = new AlloyFieldLexer();

        Tokens = lexer.GenerateTokens(prop.displayName);

        if (Tokens.Count == 0)
        {
            Debug.LogError("No tokens found!");
            return;
        }

        MaterialProperty = prop;
        DisplayName      = Tokens[0].Token;

        if (Tokens.Count <= 1)
        {
            return;
        }

        var settingsToken = Tokens[1] as AlloyCollectionToken;

        if (settingsToken == null)
        {
            return;
        }

        HasSettings = true;
        Arguments   = settingsToken.SubTokens.OfType <AlloyArgumentToken>().ToArray();
    }
Ejemplo n.º 2
0
    protected AlloyFieldParser(MaterialProperty prop) {
        var lexer = new AlloyFieldLexer();
        Tokens = lexer.GenerateTokens(prop.displayName);

        if (Tokens.Count == 0) {
            Debug.LogError("No tokens found!");
            return;
        }

        MaterialProperty = prop;
        DisplayName = Tokens[0].Token;

        if (Tokens.Count <= 1) {
            return;
        }

        var settingsToken = Tokens[1] as AlloyCollectionToken;
        if (settingsToken == null) {
            return;
        }
        
        HasSettings = true;
        Arguments = settingsToken.SubTokens.OfType<AlloyArgumentToken>().ToArray();
    }
Ejemplo n.º 3
0
 public AlloyCollectionToken(string field, AlloyFieldLexer currentLexer)
     : base(field, currentLexer)
 {
     SubTokens = currentLexer.GenerateTokens(field);
 }
Ejemplo n.º 4
0
    public AlloyCollectionToken(string field, AlloyFieldLexer currentLexer)
        : base(field, currentLexer) {


        SubTokens = currentLexer.GenerateTokens(field);
    }