My game connects to a central update server at startup, and I would like to be able to adjust any necessary Photon settings via this update server. For example, if Photon Cloud goes down I would like to be able to host my own server and temporarily point all my released games to it.
For some reason, Photon's ServerSettings seem to be stored as static members of a nonstatic serialized ScriptableObject. How do I access and change them at runtime? The code I have:
Results in this error:
For some reason, Photon's ServerSettings seem to be stored as static members of a nonstatic serialized ScriptableObject. How do I access and change them at runtime? The code I have:
public static ServerSettings PhotonServerSettings = (ServerSettings)Resources.Load (Path.GetFileNameWithoutExtension (NetworkingPeer.serverSettingsAssetPath), typeof(ServerSettings));
PhotonServerSettings.DefaultMasterPort = 5005;
Results in this error:
error CS0176: Static member `ServerSettings.DefaultMasterPort ' cannot be accessed with an instance reference, qualify it with a type name instead