I have an effect class whose static information is held in a Scriptable Object EffectData
:
public class Effect
{
[field: SerializeField] public EffectData Data { get; private set; }
[SerializeField] private EffectType type;
[SerializeField] private int duration;
}
Now, when an effect is applied to a character, it must be communicated to all other peers in the network. Since the EffectType and the duration are primitive types, I can pass them in an RPC. But how can I synchronize the data? Of course, I don’t want to send all values, but only the reference to the specific Scriptable Object.
As far as I can see, there are two options: Addressables and a custom registry manager. For the latter, I would create something like an EffectManager that contains all the effects and assign a GUID to each. If I use Addressables, I can just pass the address in an RPC.
So my questions are:
- are my assumptions correct?
- are there other possibilities that I have not considered?
- which should i use?
- how high is the overhead of an address group for all effects compared to an EffectManager?
- is there a minimum number of objects for which it is worth implementing addressables?