Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
1. Creating the config
Updated 2 years agoCreate a new class for your config.
It must have the [DataContract] attribute and inherit from SyncedInstance<T> where T is the name of your config class.
[DataContract]
public class ExampleConfig : SyncedInstance<ExampleConfig>
Add your synced config variables as [DataMember] SyncedEntry<T> where T is the type of your variable. Note the [DataMember] attribute!
If they won't be synced. You can add them as ConfigEntry<T> and without the attribute.
public ConfigEntry<float> clientOnlyVariable { get; private set; }
[DataMember] public SyncedEntry<float> syncedVariable { get; private set; }