This guide will help you quickly set up and use the MathsEngine in your Unity project.
MathsEngine evaluates mathematical expressions using nodes.
Each node represents a mathematical operation.
Examples include:
Nodes can reference other nodes to form a graph.
When evaluated, the graph propagates values through connected nodes until the final result is produced.
MathsEngine formulas are stored inside a ScriptableObject called MathFormula.
In the Unity Project window:
Right Click → Create → Baruah → MathsEngine → Maths Formula

Name the asset:
This asset will hold the full node graph.
Inside the MathFormula asset assign a root node to Math Node.
Example graph:
Node structure:
You can evaluate the formula from any script.
Output:
The formula asset will display the equation automaticallcustom-nodes.mdy.
Example:
(5 + 3) * 2 = 16
This is generated by the ToEquation() method.
Some nodes can use external parameters when evaluating the formula.
Example:
The meaning of parameters depends on the nodes used in the graph.