1. Creating the config
Updated 9 months 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; }