Exemple #1
0
        public void Execute()
        {
            mathParser = new MathParser();

            mathParser.debugMode = false;
            mathParser.SetVariableLookUpTable(testDict);

            mathParser.CalculateAsyn(raw_math_expression, (float answer) =>
            {
                //Debug.Log("Async Answer " + answer);
            });

            float syncAnswer = mathParser.Calculate(raw_math_expression);

            Debug.Log("Sync Answer " + syncAnswer);


            //MathParserThreading.Instance.CalculateAsyn(raw_math_expression, (MathParserThreading.ParseResult result) =>
            //{
            //    Debug.Log("Answer "  + result.answer);
            //    Debug.Log("Length " + result.tokens.Count);
            //}, testDict);
        }
Exemple #2
0
 private void Start()
 {
     mathParser = new MathParser();
     mathParser.SetVariableLookUpTable(testDict);
 }