using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Naninovel;
[Naninovel.ExpressionFunctions]
public static class Personality
{
// ...deleted code fro readability...
// Changes int of brash, shy, and kind variables defined in Custom Variables. Then update the temper to match new personality.
public void Nature(string nature, int points)
{
var variableManager = Engine.GetService<ICustomVariableManager>();
if(nature == "shy")
{
variableManager.TryGetVariableValue<int>("shy", out var intValue);
int x = intValue + points;
string new_int = x.ToString();
variableManager.SetVariableValue("shy", new_int);
}
else if (nature == "kind")
{
variableManager.TryGetVariableValue<int>("kind", out var intValue);
int x = intValue + points;
string new_int = x.ToString();
variableManager.SetVariableValue("kind", new_int);
}
else
{
variableManager.TryGetVariableValue<int>("brash", out var intValue);
int x = intValue + points;
string new_int = x.ToString();
variableManager.SetVariableValue("brash", new_int);
}
UpdateNature();
}
// ...deleted code fro readability...
}
You know I looked at the custom command and realized it was a little different then my personality one which was returning a bool based on the temperment. I ended up moving the code and using a custom command script.