Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
3. Usage
Updated 2 years agoIn the Awake() method of your main plugin class, create a new instance of your config class and pass Config as an argument.
It doesn't have to be stored in any variable. The instance will be handled by CSync.
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
//Other Awake code
_ = new ExampleConfig(Config);
}
}
In any class, to access the config values, simply use ExampleConfig.Instance to access them.
Example: float syncedFloat = ExampleConfig.Instance.syncedVariable
Done!
That's all there is to it. If you have any issues, questions or suggestions, feel free to contact me through Discord @Dreadrith.