AK.ExpressionSolver.SetGlobalVariable C# (CSharp) Method

SetGlobalVariable() public method

public SetGlobalVariable ( string name, double value ) : Variable
name string
value double
return Variable
        public Variable SetGlobalVariable(string name, double value)
        {
            Variable variable;
            if (globalConstants.TryGetValue(name, out variable))
            {
                if (variable.stringValue != null)
                {
                    throw new ESParameterTypeChangedException("Can not change type of existing parameter " + name);
                }
                variable.value = value;
                return variable;
            }
            else
            {
                Variable v = new Variable(name,value);
                globalConstants.Add (name,v);
                return v;
            }
        }

Same methods

ExpressionSolver::SetGlobalVariable ( string name, string value ) : Variable

Usage Example

Example #1
0
 // Use this for initialization
 void Awake()
 {
     xmin     = -1f * minmaxVal;
     xmax     = minmaxVal;
     ymin     = -1f * minmaxVal;
     ymax     = minmaxVal;
     zmin     = -1f * minmaxVal;
     zmax     = minmaxVal;
     vectors  = new List <Transform>();
     startPts = new Vector3[2097152];
     offsets  = new Vector3[2097152];
     solver   = new AK.ExpressionSolver();
     expX     = new AK.Expression();
     expY     = new AK.Expression();
     expZ     = new AK.Expression();
     solver.SetGlobalVariable("x", 0);
     solver.SetGlobalVariable("y", 0);
     solver.SetGlobalVariable("z", 0);
     max_magnitude       = 0f;
     textureMap          = new Texture3D(128, 128, 128, TextureFormat.RGBA32, true);
     textureMap.wrapMode = TextureWrapMode.Clamp;
     numComplete         = 0;
     drawn     = true;
     drawQueue = 0;
     if (loadingMsg != null)
     {
         loadingMsgText = loadingMsg.GetComponent <TextMesh>();
     }
     sleepInterval = 126;
     //CalculateVectors();
     //DrawDensityPlot();
 }
All Usage Examples Of AK.ExpressionSolver::SetGlobalVariable