Exemple #1
0
 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);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 public static void SetValueNoLeading(this VariableStorageBehaviour v, string variableNameNoLeading, Value value)
 => v.SetValue(AddLeadingIfNeeded(variableNameNoLeading), value);