Im working on this project and I am quite new to c#. I want to load configuration from a file. I dont know how to quite explain it, or maybe I'm just retarded because I get nothing of what I'm looking for when I try to search it, but let me try and explain, heres my code:
public class Example : MonoBehaviour
{
int min = 0;
int sec = 10;
void Start()
{
InvokeRepeating("ResetItems", 1, min * 60 + sec);
if (min * 60 + sec > 60)
{
InvokeRepeating("Warning", 1, min * 60 + sec - 60);
}
}
void Warning()
{
NetworkChat.sendAlert("Items Respawning in one minute");
}
void ResetItems()
{
NetworkChat.sendAlert("Items respawning..");
SpawnItems.reset();
}
}
Now what I want to do is make it so I have a config file that reads something like this:
min=1
sec=20
so in my project, those integers will change. or be set to what's in the external config file rather than having to go and manually edit it.