Esempio 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();
    }
    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();
    }
Esempio n. 3
0
 public AlloyCollectionToken(string field, AlloyFieldLexer currentLexer)
     : base(field, currentLexer)
 {
     SubTokens = currentLexer.GenerateTokens(field);
 }
    public AlloyCollectionToken(string field, AlloyFieldLexer currentLexer)
        : base(field, currentLexer) {


        SubTokens = currentLexer.GenerateTokens(field);
    }