Hi
I have a question about using RAIN in a custom piece of code. I want to make a GUI button that whenever you press it the variable curEnergy gets an extra 10 points in value. Right now I have it like this:
GUI.Box (new Rect (0, 0, Screen.width / 2, 100), “”);
{
if (GUI.Button(new Rect (50, 10, Screen.width / 3, 20), “Get Energy”)){
Debug.Log(“Clicked the button with text”);
AIRig selectedObjectAI = selectedObject.GetComponentInChildren<AIRig>();
selectedObjectAI.AI.WorkingMemory.SetItem<int>(“curEnergy”, 10);
}
this piece of code set’s the value to 10 instead of adding 10 to the existing amount. How do I fix this?