void Update() { int i; if (shadowGraph != null) { string0 = shadowGraph.string0; string1 = shadowGraph.string1; } if (game.playing) { } else { if (polar) { variable0 = "a"; variable1 = "r"; } else { variable0 = "x"; variable1 = "y"; } if (swapped) { string swapVariable = variable0; variable0 = variable1; variable1 = swapVariable; } if (!validHeightPlayer) { error1 = "The sled must be above the hill"; } else if (!validHeightObjective) { error1 = "All rolling objectives must be above the hill"; } valid = false; valid0 = true; valid1 = true; if (parametric) { if (string0 == "" || string0.Contains("=") || string0.Contains("/+") || string0.Contains("/*") || (parametric && (string0.Contains(variable0) || string0.Contains(variable1)))) { valid0 = false; } else { try { parseContext.AssignVariable("t", new ScalarValue(0)); parseContext.AssignVariable("T", new ScalarValue(0)); parseContext.AssignVariable("pa", new ScalarValue(0)); parseContext.AssignVariable("pr", new ScalarValue(0)); valid0 = true; parser0 = Parser.Parse(string0); } catch (YAMPParseException ex0) { valid0 = false; } catch (YAMPSymbolMissingException ex1) { valid0 = false; } } } for (i = 0; i < implicitStrings.Length; i++) { if (string1.Contains(implicitStrings[i])) { valid1 = false; error = "Multiplication must be explicit! Change '" + implicitStrings[i] + "' to '" + explicitStrings[i] + "'"; } } if (!valid1) { } else if (string1 == "") { valid1 = false; error1 = "Something's wrong! Your function cannot be empty"; } else if (string1.Contains("=")) { valid1 = false; error1 = "Something's wrong! You cannot use '=' in your function"; } else if (string1.Contains("--")) { valid1 = false; error1 = "Something's wrong! You cannot use '--' in your function"; } // else if (string1.Contains(variable1)) { // valid1 = false; // error1 = "Something's wrong! You cannot use the variable '"+variable1.ToUpper()+"' in your function"; // } else { try { valid1 = true; parseContext.AssignVariable(variable0, new ScalarValue(0)); parseContext.AssignVariable(variable0.ToUpper(), new ScalarValue(0)); parseContext.AssignVariable("t", new ScalarValue(0)); parseContext.AssignVariable("T", new ScalarValue(0)); parseContext.AssignVariable("px", new ScalarValue(0)); parseContext.AssignVariable("py", new ScalarValue(0)); parseContext.AssignVariable("pa", new ScalarValue(0)); parseContext.AssignVariable("pr", new ScalarValue(0)); parser1 = Parser.Parse(string1); float testValue = (float)((ScalarValue)parser1.Execute()).Value; } catch (YAMPParseException ex0) { valid1 = false; error1 = "Something's wrong! Double-check your function for problems"; } catch (YAMPSymbolMissingException ex1) { valid1 = false; error1 = "Something's wrong! Looks like you used an invalid symbol"; } catch (YAMPArgumentNumberException ex2) { valid1 = false; error1 = "Something's wrong! One of your operations has too many inputs"; } catch (Exception ex) { valid1 = false; if (Application.isEditor) { error = ex.Message; } else { error1 = "Something's wrong! Double-check your function for problems"; } } } if (valid0 && valid1) { valid = true; } } if (graphColliderPolygon != null) { graphColliderPolygon.isTrigger = true; } if (shadowGraph != null && game.playing) { graphLine.enabled = false; if (meshRenderer) { meshRenderer.enabled = false; } } else if (valid) { GenerateGraph(); graphLine.enabled = true; if (meshRenderer) { if (drawMesh && !(swapped && polar)) { meshRenderer.enabled = true; } else { meshRenderer.enabled = false; } } } else { graphLine.enabled = false; if (meshRenderer) { meshRenderer.enabled = false; } } if (valid && validHeightPlayer && validHeightObjective) { ready = true; } else { ready = false; } if (shadowGraph != null) { graphLine.SetWidth((1 - (Time.time + shadowOffset) % shadowLimit / shadowLimit) * 0.9f * thickness * game.windowSize / 100, (1 - (Time.time + shadowOffset) % shadowLimit / shadowLimit) * 0.9f * thickness * game.windowSize / 100); } else { graphLine.SetWidth(thickness * game.windowSize / 100, thickness * game.windowSize / 100); } validHeightPlayer = true; validHeightObjective = true; }