TNetLibrarySystem is a packages for make your Networking scripts more readable and support parameters!
This readme file need to be reviewed, this is an very old version and some stuff aren't updated today!
Import with VRChat Creator Companion:
Import with VRChat Creator Companion:
- Download
fr.tismatis.tnetlibrarysystem.zipfrom here- Unpack the .zip somewhere
- In VRChat Creator Companion, navigate to
Settings>User Packages>Add- Navigate to the unpacked folder,
fr.tismatis.tnetlibrarysystemand clickSelect FolderTNetLibrarySystemshould now be visible underLocal User Packagesin the project view in VRChat Creator Companion- Click
Add
Import with Unity Package Manager (git):
Import with Unity Package Manager (git):
- In the Unity toolbar, select
Window>Package Manager>[+]>Add package from git URL...- Paste the following link:
https://github.com/Matis-Projects/TNetLibrarySystem.git
- TODO: Remake this part
- Select in the Menu Bar
TNetLibrarySystem. - Click on
Import prefab in the sceneand select the line count.
- We recommends to use 16 lines.
- Warning, all old method for adding the script automaticly to TNLS is outdated, that include
AssignNewScriptToNetworkdue to the new update.
- Import
Tismatis.TNetLibrarySystem.Codingin the class. - Just put the inherent class as
NetworkedClassand notUdonSharpBehaviourby default. - Set by the
Inspectorin Unity to modify thescriptNamevalue.
- You can set
scriptNameby overridingvoid Start()but you need to change the value before thebase.Start();. - When you use the
void Start(), make sure you override the one ofNetworkedClassand you addedbase.Start();at the first line.
- In the case the script where you start the call is in a NetworkedClass:
- You call the script himself:
SendNetworkedEvent("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>); - You call another script than the one you use to call:
SendExternalNetworkedEvent("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>);
- You call the script himself:
- In the case the script where you start the call is not in a NetworkedClass:
TNLSManager.CallNamedNetworkedScript("All/Local", "<Your Void Name>", "<The ScriptName destination>", <parameters>);
- Currently, only the string is supported.
- Create your button and select it on Unity.
- Add the component
TNLS Custom Button Sender. - Configuration of the component:
- Insert your
TNLS Manager. - Write your Target.
- Write the original ScriptName.
- Write the original MethodName.
- Insert your
- Add an action on the button and insert the
TNLS Custom Button Sendercomponent. - Select the event
UdonBehaviour.SendCustomEventand write the eventCallTheCustomEvent.
- Now you need to declare ddirectly in yours parameters an array of object like this:
void MyNetworkedMethod(object[] parameters).
-
Limits of the system
- Parameters can be
nullor a array ofobject[]! - You have at maximum 25 parameters!* Can be modified in the
TNLS Settingsbut not recommended
- Parameters can be
-
Supported types Some types aren't compatible for now, they will be compatible after.
- If you get any error from one type listed, please create a issue for report it.
Keyword Aliased Type Base Support Array Support Full Support Note shortInt16 ✔️ ✔️ ✔️ ushortUInt16 ✔️ ✔️ ✔️ intInt32 ✔️ ✔️ ✔️ uintUInt32 ✔️ ✔️ ✔️ longInt64 ✔️ ✔️ ✔️ ulongUInt64 ✔️ ✔️ ✔️ floatSingle ✔️ ✔️ ✔️ doubleDouble ✔️ ✔️ ✔️ boolBoolean ✔️ ✔️ ✔️ byteByte ✔️ ✔️ ✔️ sbyteSByte ✔️ ✔️ ✔️ ~ Color ✔️ ✔️ ✔️ ~ Color32 ✔️ ✔️ ✔️ ~ Quarternion ✔️ ✔️ ✔️ ~ Vector2 ✔️ ✔️ ✔️ ~ Vector2Int ✔️ ✔️ ✔️ ~ Vector3 ✔️ ✔️ ✔️ ~ Vector3Int ✔️ ✔️ ✔️ ~ Vector4 ✔️ ✔️ ✔️ decimalDecimal ✔️ ✔️ ✔️ ~ VRCPlayerApi ✔️ ✔️ ✔️ stringString ✔️ ✔️ ✔️ charChar ✔️ ✔️ ✔️
- Now you need to enable
enableLoginDebug Mode! - To put in a text:
- Create a 2D Text
- Assign this 2D Text to the
TNLS Logging System, a child ofTNLS Manager. - Activate debug mode in
TNLS Manager.
- To activate the debug mode: (for get more detail)
- Activate the
Debug Modein theTNLS Settings, a child ofTNLS Manager.
- Activate the