public void Increase_Variable() { print(yarn_test_variable); yarn_test_variable = yarn_test_variable + 30; varStore.SetValue("$yarn_test_variable", yarn_test_variable); print(yarn_test_variable); }
protected bool TrySetValue(VariableStorageBehaviour source, string variableName, Value value) { try { source.SetValue(variableName, value); return(true); } catch (SystemException ex) when(ex is ArgumentException || ex is InvalidOperationException) { // The source was not compatible with the value. Try another. // Log the exception if the flag is set to true if (logSetKnownErrors) { Debug.LogException(ex); } } return(false); }
public static void SetValueNoLeading(this VariableStorageBehaviour v, string variableNameNoLeading, Value value) => v.SetValue(AddLeadingIfNeeded(variableNameNoLeading), value);