How to add/subtract int in C#
Posted: Mon May 06, 2024 7:57 am
Hey Tony.
I had another question. How do you Add/Subtract a int variable in C# script? Been digging through this website and I can't find no simple solution for it anywhere.
Example.
public int Coin = 100;
void Start()
int Coin = DialogueLua.GetVariable("Coin").AsInt;
DialogueLua.SetVariable("Coin", 150);
public void Punch()
Coin + 10;
----------------------------------------------------------------------------------------------------------
Now Coin = 160. After void Punch() is activated.
This is what I want. but it don't work?
I had another question. How do you Add/Subtract a int variable in C# script? Been digging through this website and I can't find no simple solution for it anywhere.
Example.
public int Coin = 100;
void Start()
int Coin = DialogueLua.GetVariable("Coin").AsInt;
DialogueLua.SetVariable("Coin", 150);
public void Punch()
Coin + 10;
----------------------------------------------------------------------------------------------------------
Now Coin = 160. After void Punch() is activated.
This is what I want. but it don't work?