updated samples, autoconnect to server on enable/disable, auto-login option, add bool for players that were already in room when you joined
parent
3154fc5094
commit
efed5c3d14
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 009dc4ba29f14b649beb8c3eaad89f15
|
||||
guid: dc0ae145afb98164493d097e29dfb3bd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 009dc4ba29f14b649beb8c3eaad89f15
|
||||
guid: 18b28d1150d229647ae76efe2bea95f8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dda4edde45d871c4c9cc53849f3b62c7
|
||||
guid: f8bb9027566930042942da486c1e29e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
@ -633,8 +633,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 7a7db5bc792cd471dbd8039664359eee, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
autoConnect: 1
|
||||
autoRejoin: 0
|
||||
userInput: {fileID: 626742069}
|
||||
sendInput: {fileID: 0}
|
||||
roomInput: {fileID: 711524768}
|
||||
|
|
@ -2524,6 +2522,9 @@ MonoBehaviour:
|
|||
port: 5000
|
||||
udpConnected: 0
|
||||
userid: -1
|
||||
debugMessages: 1
|
||||
autoLogin: 1
|
||||
onlyConnectToSameVersion: 1
|
||||
connected: 0
|
||||
prefabs:
|
||||
- {fileID: 9102273340480352682, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3}
|
||||
|
|
@ -123,7 +123,7 @@ NavMeshSettings:
|
|||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &516411417
|
||||
--- !u!1 &561771045
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -131,104 +131,54 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 516411421}
|
||||
- component: {fileID: 516411420}
|
||||
- component: {fileID: 516411419}
|
||||
- component: {fileID: 516411418}
|
||||
- component: {fileID: 561771047}
|
||||
- component: {fileID: 561771046}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Name: VelNet Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &516411418
|
||||
--- !u!114 &561771046
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_GameObject: {fileID: 561771045}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
host: 127.0.0.1
|
||||
port: 80
|
||||
host: vn.ugavel.com
|
||||
port: 5000
|
||||
udpConnected: 0
|
||||
userid: -1
|
||||
room:
|
||||
debugMessages: 1
|
||||
autoLogin: 1
|
||||
onlyConnectToSameVersion: 0
|
||||
connected: 0
|
||||
prefabs: []
|
||||
sceneObjects: []
|
||||
deletedSceneObjects: []
|
||||
--- !u!81 &516411419
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &516411420
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &516411421
|
||||
--- !u!4 &561771047
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_GameObject: {fileID: 561771045}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &756322628
|
||||
--- !u!1 &951053497
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -236,8 +186,8 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 756322630}
|
||||
- component: {fileID: 756322629}
|
||||
- component: {fileID: 951053499}
|
||||
- component: {fileID: 951053498}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
|
|
@ -245,13 +195,13 @@ GameObject:
|
|||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &756322629
|
||||
--- !u!108 &951053498
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 756322628}
|
||||
m_GameObject: {fileID: 951053497}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
|
|
@ -307,17 +257,238 @@ Light:
|
|||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &756322630
|
||||
--- !u!4 &951053499
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 756322628}
|
||||
m_GameObject: {fileID: 951053497}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &958953873
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 958953877}
|
||||
- component: {fileID: 958953876}
|
||||
- component: {fileID: 958953875}
|
||||
- component: {fileID: 958953874}
|
||||
- component: {fileID: 958953879}
|
||||
- component: {fileID: 958953878}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &958953874
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &958953875
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &958953876
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &958953877
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &958953878
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3f1f9b0bbd93a484a987c51f1107ebe5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
networkObject: {fileID: 958953879}
|
||||
serializationRateHz: 30
|
||||
hybridOnChangeCompression: 1
|
||||
useLocalTransform: 0
|
||||
teleportDistance: 0
|
||||
teleportAngle: 0
|
||||
--- !u!114 &958953879
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ownershipLocked: 0
|
||||
networkId:
|
||||
sceneNetworkId: 100
|
||||
prefabName:
|
||||
isSceneObject: 1
|
||||
syncedComponents:
|
||||
- {fileID: 958953878}
|
||||
--- !u!1 &1615517332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1615517335}
|
||||
- component: {fileID: 1615517334}
|
||||
- component: {fileID: 1615517333}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1615517333
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1615517334
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &1615517335
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2e6e0ddeb76e51b46afc0f0a43386ff2
|
||||
guid: 3e0da379b7e26cf4384f5cdff10f4fda
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cd6dd1d4e81bce64faaf29eedf9d2a63
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
using VelNet;
|
||||
|
||||
public class CustomMessageTest : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
VelNetManager.OnJoinedRoom += _ =>
|
||||
{
|
||||
byte[] testPacket = { 244 };
|
||||
VelNetManager.SendCustomMessage(testPacket, true, true, false);
|
||||
};
|
||||
|
||||
VelNetManager.CustomMessageReceived += (senderId, dataWithCategory) =>
|
||||
{
|
||||
if (dataWithCategory[0] == 244)
|
||||
{
|
||||
Debug.Log($"Received test packet from {senderId}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -8,9 +8,6 @@ namespace VelNet
|
|||
{
|
||||
public class NetworkGUI : MonoBehaviour
|
||||
{
|
||||
public bool autoConnect = true;
|
||||
public bool autoRejoin = true;
|
||||
|
||||
public InputField userInput;
|
||||
public InputField sendInput;
|
||||
public InputField roomInput;
|
||||
|
|
@ -40,7 +37,7 @@ namespace VelNet
|
|||
{
|
||||
if (VelNetManager.IsConnected)
|
||||
{
|
||||
VelNetManager.GetRoomData("0");
|
||||
VelNetManager.GetRoomData(VelNetManager.Room);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,44 +59,6 @@ namespace VelNet
|
|||
{
|
||||
comms = FindObjectOfType<DissonanceComms>();
|
||||
microphones.AddOptions(new List<string>(Microphone.devices));
|
||||
|
||||
if (autoConnect)
|
||||
{
|
||||
AutoJoin();
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoJoin()
|
||||
{
|
||||
VelNetManager.OnConnectedToServer += Login;
|
||||
|
||||
void Login()
|
||||
{
|
||||
if (!autoRejoin)
|
||||
{
|
||||
VelNetManager.OnConnectedToServer -= Login;
|
||||
}
|
||||
|
||||
HandleLogin();
|
||||
VelNetManager.OnLoggedIn += JoinRoom;
|
||||
|
||||
void JoinRoom()
|
||||
{
|
||||
HandleJoin();
|
||||
VelNetManager.OnLoggedIn -= JoinRoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (autoRejoin)
|
||||
{
|
||||
if (!VelNetManager.IsConnected)
|
||||
{
|
||||
AutoJoin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleMicrophoneSelection()
|
||||
|
|
@ -16,11 +16,11 @@ public class RPCTest : NetworkComponent
|
|||
|
||||
private void TestRPC()
|
||||
{
|
||||
Debug.LogError("RPC RECEIVED!");
|
||||
Debug.Log("RPC RECEIVED!");
|
||||
}
|
||||
|
||||
public override void ReceiveBytes(byte[] message)
|
||||
{
|
||||
Debug.LogError("WOW. BYTES");
|
||||
Debug.Log("WOW. BYTES");
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d1b34f106c04378428823df374b0e07c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 112000000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
using UnityEngine;
|
||||
using VelNet;
|
||||
|
||||
public class test : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
private void Start()
|
||||
{
|
||||
VelNetManager.OnJoinedRoom += roomName =>
|
||||
{
|
||||
Debug.Log("VelNet room joined!!!!!: " + roomName);
|
||||
//VelNetManager.GetRoomData(roomName);
|
||||
byte[] testpacekt = new[] { (byte)244 };
|
||||
VelNetManager.SendCustomMessage(testpacekt, true, true, false);
|
||||
};
|
||||
|
||||
VelNetManager.CustomMessageReceived += (senderId, dataWithCategory) =>
|
||||
{
|
||||
//customPacketReceived(senderId, dataWithCategory);
|
||||
if (dataWithCategory[0] == (byte)244)
|
||||
{
|
||||
Debug.Log("received test packet");
|
||||
return;
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &1148318672
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1148318674}
|
||||
- component: {fileID: 1148318673}
|
||||
- component: {fileID: 1148318675}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1148318673
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1148318672}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
host: velnet-lts.ugavel.com
|
||||
port: 5000
|
||||
udpConnected: 0
|
||||
userid: -1
|
||||
connected: 0
|
||||
prefabs:
|
||||
- {fileID: 9102273340480352682, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3}
|
||||
- {fileID: 3951900052977689805, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
||||
sceneObjects: []
|
||||
deletedSceneObjects: []
|
||||
--- !u!4 &1148318674
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1148318672}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 297.37976, y: 241.59624, z: -3.2564697}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1148318675
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1148318672}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5ea1fe0eb58e4184bbb2edcc99c51119, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
|
@ -35,6 +35,7 @@ namespace VelNet
|
|||
/// <summary>
|
||||
/// This may be empty if it's not a prefab (scene object)
|
||||
/// </summary>
|
||||
[Tooltip("For spawnable prefab objects")]
|
||||
public string prefabName;
|
||||
|
||||
public bool isSceneObject;
|
||||
|
|
|
|||
|
|
@ -139,11 +139,5 @@ namespace VelNet
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
[VelNetRPC]
|
||||
private void Test()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace VelNet
|
||||
{
|
||||
public static class VelNetLogger
|
||||
{
|
||||
public static void Info(string message, Object context = null)
|
||||
{
|
||||
if (VelNetManager.instance != null && VelNetManager.instance.debugMessages)
|
||||
{
|
||||
Debug.Log($"[VelNet] {message}", context);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Error(string message, Object context = null)
|
||||
{
|
||||
Debug.LogError($"[VelNet] {message}", context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 38bfd5f9fb924b7bb82a7a5e4fc09c1c
|
||||
timeCreated: 1658256074
|
||||
|
|
@ -11,12 +11,11 @@ using System.IO;
|
|||
|
||||
namespace VelNet
|
||||
{
|
||||
|
||||
/// <summary>Used to flag methods as remote-callable.</summary>
|
||||
public class VelNetRPC : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
[AddComponentMenu("VelNet/VelNet Manager")]
|
||||
public class VelNetManager : MonoBehaviour
|
||||
{
|
||||
|
|
@ -70,6 +69,15 @@ namespace VelNet
|
|||
private Thread clientReceiveThreadUDP;
|
||||
public int userid = -1;
|
||||
|
||||
[Tooltip("Sends debug messages about connection and join events")]
|
||||
public bool debugMessages;
|
||||
|
||||
[Tooltip("Automatically logs in with app name and hash of device id after connecting")]
|
||||
public bool autoLogin = true;
|
||||
|
||||
[Tooltip("Uses the version number in the login to prevent crosstalk between different app versions")]
|
||||
public bool onlyConnectToSameVersion;
|
||||
|
||||
public readonly Dictionary<int, VelNetPlayer> players = new Dictionary<int, VelNetPlayer>();
|
||||
|
||||
#region Callbacks
|
||||
|
|
@ -88,8 +96,9 @@ namespace VelNet
|
|||
|
||||
/// <summary>
|
||||
/// Somebody else just joined our room
|
||||
/// bool is true when this is a join message for someone that was already in the room when we joined it
|
||||
/// </summary>
|
||||
public static Action<VelNetPlayer> OnPlayerJoined;
|
||||
public static Action<VelNetPlayer, bool> OnPlayerJoined;
|
||||
|
||||
/// <summary>
|
||||
/// Somebody else just left our room
|
||||
|
|
@ -177,6 +186,11 @@ namespace VelNet
|
|||
{
|
||||
public string room;
|
||||
public readonly List<(int, string)> members = new List<(int, string)>();
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return room + "\n" + string.Join("\n", members.Select(m => $"{m.Item1}\t{m.Item2}"));
|
||||
}
|
||||
}
|
||||
|
||||
public class JoinMessage : Message
|
||||
|
|
@ -198,7 +212,7 @@ namespace VelNet
|
|||
|
||||
public class YouJoinedMessage : Message
|
||||
{
|
||||
public List<int> ids;
|
||||
public List<int> playerIds;
|
||||
public string room;
|
||||
}
|
||||
|
||||
|
|
@ -217,27 +231,35 @@ namespace VelNet
|
|||
{
|
||||
}
|
||||
|
||||
private int maxUnreadMessages = 1000;
|
||||
public readonly List<Message> receivedMessages = new List<Message>();
|
||||
private const int maxUnreadMessages = 1000;
|
||||
private readonly List<Message> receivedMessages = new List<Message>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
Debug.LogError("Multiple NetworkManagers detected! Bad!", this);
|
||||
}
|
||||
|
||||
instance = this;
|
||||
|
||||
SceneManager.sceneLoaded += (scene, mode) =>
|
||||
SceneManager.sceneLoaded += (_, _) =>
|
||||
{
|
||||
// add all local network objects
|
||||
sceneObjects = FindObjectsOfType<NetworkObject>().Where(o => o.isSceneObject).ToArray();
|
||||
};
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
VelNetLogger.Error("Multiple NetworkManagers detected! Bad!", this);
|
||||
}
|
||||
|
||||
instance = this;
|
||||
ConnectToServer();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
DisconnectFromServer();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
private void AddMessage(Message m)
|
||||
{
|
||||
bool added = false;
|
||||
|
|
@ -257,7 +279,7 @@ namespace VelNet
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,6 +294,7 @@ namespace VelNet
|
|||
{
|
||||
case ConnectedMessage msg:
|
||||
{
|
||||
VelNetLogger.Info("Connected to server.");
|
||||
try
|
||||
{
|
||||
OnConnectedToServer?.Invoke();
|
||||
|
|
@ -279,7 +302,15 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString());
|
||||
}
|
||||
|
||||
if (autoLogin)
|
||||
{
|
||||
Login(
|
||||
onlyConnectToSameVersion ? $"{Application.productName}_{Application.version}" : $"{Application.productName}",
|
||||
Hash128.Compute(SystemInfo.deviceUniqueIdentifier).ToString()
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -288,12 +319,11 @@ namespace VelNet
|
|||
{
|
||||
if (userid == lm.userId)
|
||||
{
|
||||
Debug.Log("Received duplicate login message " + userid);
|
||||
return;
|
||||
VelNetLogger.Error("Received duplicate login message " + userid);
|
||||
}
|
||||
|
||||
userid = lm.userId;
|
||||
Debug.Log("Joined server " + userid);
|
||||
VelNetLogger.Info("Logged in: " + userid);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -302,7 +332,7 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
//start the udp thread
|
||||
|
|
@ -314,6 +344,7 @@ namespace VelNet
|
|||
}
|
||||
case RoomsMessage rm:
|
||||
{
|
||||
VelNetLogger.Info($"Received rooms:\n{rm}");
|
||||
try
|
||||
{
|
||||
RoomsReceived?.Invoke(rm);
|
||||
|
|
@ -321,13 +352,14 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case RoomDataMessage rdm:
|
||||
{
|
||||
VelNetLogger.Info($"Received room data:\n{rdm}");
|
||||
try
|
||||
{
|
||||
RoomDataReceived?.Invoke(rdm);
|
||||
|
|
@ -335,19 +367,21 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case YouJoinedMessage jm:
|
||||
{
|
||||
VelNetLogger.Info($"Joined Room: {jm.room} \t ({jm.playerIds.Count} players)");
|
||||
|
||||
// we clear the list, but will recreate as we get messages from people in our room
|
||||
players.Clear();
|
||||
masterPlayer = null;
|
||||
|
||||
|
||||
foreach (int playerId in jm.ids)
|
||||
foreach (int playerId in jm.playerIds)
|
||||
{
|
||||
VelNetPlayer player = new VelNetPlayer
|
||||
{
|
||||
|
|
@ -365,7 +399,7 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<int, VelNetPlayer> kvp in players)
|
||||
|
|
@ -374,12 +408,12 @@ namespace VelNet
|
|||
{
|
||||
try
|
||||
{
|
||||
OnPlayerJoined?.Invoke(kvp.Value);
|
||||
OnPlayerJoined?.Invoke(kvp.Value, true);
|
||||
}
|
||||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -394,7 +428,10 @@ namespace VelNet
|
|||
}
|
||||
case PlayerLeftMessage lm:
|
||||
{
|
||||
VelNetLogger.Info($"Player left: {lm.userId}");
|
||||
|
||||
VelNetPlayer me = players[userid];
|
||||
|
||||
// we got a left message, kill it
|
||||
// change ownership of all objects to master
|
||||
List<string> deleteObjects = new List<string>();
|
||||
|
|
@ -433,13 +470,15 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case JoinMessage jm:
|
||||
{
|
||||
VelNetLogger.Info($"Player joined: {jm.userId}");
|
||||
|
||||
// we got a join message, create it
|
||||
VelNetPlayer player = new VelNetPlayer
|
||||
{
|
||||
|
|
@ -450,12 +489,12 @@ namespace VelNet
|
|||
players.Add(jm.userId, player);
|
||||
try
|
||||
{
|
||||
OnPlayerJoined?.Invoke(player);
|
||||
OnPlayerJoined?.Invoke(player, false);
|
||||
}
|
||||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -469,13 +508,15 @@ namespace VelNet
|
|||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Received message from player that doesn't exist ");
|
||||
VelNetLogger.Error("Received message from player that doesn't exist ");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ChangeMasterMessage cm:
|
||||
{
|
||||
VelNetLogger.Info($"Master client changed: {cm.masterId}");
|
||||
|
||||
if (masterPlayer == null)
|
||||
{
|
||||
if (players.ContainsKey(cm.masterId))
|
||||
|
|
@ -485,7 +526,7 @@ namespace VelNet
|
|||
else
|
||||
{
|
||||
masterPlayer = players.Aggregate((p1, p2) => p1.Value.userid.CompareTo(p2.Value.userid) > 0 ? p1 : p2).Value;
|
||||
Debug.LogError("Got an invalid master client id from the server. Using fallback.");
|
||||
VelNetLogger.Error("Got an invalid master client id from the server. Using fallback.");
|
||||
}
|
||||
|
||||
// no master player yet, add the scene objects
|
||||
|
|
@ -494,23 +535,24 @@ namespace VelNet
|
|||
{
|
||||
if (sceneObjects[i].sceneNetworkId == 0)
|
||||
{
|
||||
Debug.LogError("Scene Network ID is 0. Make sure to assign one first.", sceneObjects[i]);
|
||||
VelNetLogger.Error("Scene Network ID is 0. Make sure to assign one first.", sceneObjects[i]);
|
||||
}
|
||||
|
||||
sceneObjects[i].networkId = -1 + "-" + sceneObjects[i].sceneNetworkId;
|
||||
sceneObjects[i].owner = masterPlayer;
|
||||
sceneObjects[i].isSceneObject = true; // needed for special handling when deleted
|
||||
try {
|
||||
try
|
||||
{
|
||||
sceneObjects[i].OwnershipChanged?.Invoke(masterPlayer);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Error in event handling.\n" + e);
|
||||
VelNetLogger.Error("Error in event handling.\n" + e);
|
||||
}
|
||||
|
||||
if (objects.ContainsKey(sceneObjects[i].networkId))
|
||||
{
|
||||
Debug.LogError($"Duplicate NetworkID: {sceneObjects[i].networkId} {sceneObjects[i].name} {objects[sceneObjects[i].networkId]}");
|
||||
VelNetLogger.Error($"Duplicate NetworkID: {sceneObjects[i].networkId} {sceneObjects[i].name} {objects[sceneObjects[i].networkId]}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -541,12 +583,12 @@ namespace VelNet
|
|||
receivedMessages.Clear();
|
||||
}
|
||||
|
||||
|
||||
// reconnection
|
||||
if (Time.timeAsDouble - lastConnectionCheck > 2)
|
||||
{
|
||||
if (!IsConnected && wasConnected)
|
||||
{
|
||||
Debug.Log("Reconnecting...");
|
||||
VelNetLogger.Info("Reconnecting...");
|
||||
ConnectToServer();
|
||||
}
|
||||
|
||||
|
|
@ -556,7 +598,7 @@ namespace VelNet
|
|||
|
||||
private void LeaveRoom()
|
||||
{
|
||||
Debug.Log("Leaving Room");
|
||||
VelNetLogger.Info("Leaving Room");
|
||||
string oldRoom = LocalPlayer?.room;
|
||||
// delete all NetworkObjects that aren't scene objects or are null now
|
||||
objects
|
||||
|
|
@ -582,7 +624,7 @@ namespace VelNet
|
|||
// prevent errors in subscribers from breaking our code
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
VelNetLogger.Error(e.ToString(), this);
|
||||
}
|
||||
|
||||
foreach (NetworkObject s in sceneObjects)
|
||||
|
|
@ -604,7 +646,7 @@ namespace VelNet
|
|||
/// <summary>
|
||||
/// Setup socket connection.
|
||||
/// </summary>
|
||||
public static void ConnectToServer()
|
||||
private static void ConnectToServer()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -613,16 +655,13 @@ namespace VelNet
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log("On client connect exception " + e);
|
||||
VelNetLogger.Error("On client connect exception " + e);
|
||||
}
|
||||
}
|
||||
|
||||
private void DisconnectFromServer()
|
||||
{
|
||||
Debug.Log("Disconnecting from server");
|
||||
|
||||
|
||||
Debug.Log("Leaving Room");
|
||||
VelNetLogger.Info("Disconnecting from server...");
|
||||
string oldRoom = LocalPlayer?.room;
|
||||
// delete all NetworkObjects that aren't scene objects or are null now
|
||||
objects
|
||||
|
|
@ -788,10 +827,10 @@ namespace VelNet
|
|||
{
|
||||
YouJoinedMessage m = new YouJoinedMessage();
|
||||
int N = GetIntFromBytes(ReadExact(stream, 4));
|
||||
m.ids = new List<int>();
|
||||
m.playerIds = new List<int>();
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
m.ids.Add(GetIntFromBytes(ReadExact(stream, 4)));
|
||||
m.playerIds.Add(GetIntFromBytes(ReadExact(stream, 4)));
|
||||
}
|
||||
|
||||
N = stream.ReadByte();
|
||||
|
|
@ -822,11 +861,17 @@ namespace VelNet
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
catch (Exception socketException)
|
||||
catch (ThreadAbortException ex)
|
||||
{
|
||||
Debug.Log("Socket exception: " + socketException);
|
||||
// pass
|
||||
}
|
||||
catch (SocketException socketException)
|
||||
{
|
||||
VelNetLogger.Error("Socket exception: " + socketException);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
VelNetLogger.Error(ex.ToString());
|
||||
}
|
||||
|
||||
connected = false;
|
||||
|
|
@ -857,7 +902,7 @@ namespace VelNet
|
|||
if (udpSocket.Available == 0)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
Debug.Log("Waiting for UDP response");
|
||||
VelNetLogger.Info("Waiting for UDP response");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -873,7 +918,7 @@ namespace VelNet
|
|||
switch ((MessageReceivedType)buffer[0])
|
||||
{
|
||||
case MessageReceivedType.LOGGED_IN:
|
||||
Debug.Log("UDP connected");
|
||||
VelNetLogger.Info("UDP connected");
|
||||
break;
|
||||
case MessageReceivedType.DATA_MESSAGE:
|
||||
{
|
||||
|
|
@ -891,9 +936,17 @@ namespace VelNet
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception socketException)
|
||||
catch (ThreadAbortException ex)
|
||||
{
|
||||
Debug.Log("Socket exception: " + socketException);
|
||||
// pass
|
||||
}
|
||||
catch (SocketException socketException)
|
||||
{
|
||||
VelNetLogger.Error("Socket exception: " + socketException);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
VelNetLogger.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -914,10 +967,10 @@ namespace VelNet
|
|||
/// <returns>True if the message successfully sent. False if it failed and we should quit</returns>
|
||||
private static bool SendTcpMessage(byte[] message)
|
||||
{
|
||||
// Debug.Log("Sent: " + clientMessage);
|
||||
// Logging.Info("Sent: " + clientMessage);
|
||||
if (instance.socketConnection == null)
|
||||
{
|
||||
Debug.LogError("Tried to send message while socket connection was still null.", instance);
|
||||
VelNetLogger.Error("Tried to send message while socket connection was still null.", instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -927,7 +980,7 @@ namespace VelNet
|
|||
if (!instance.socketConnection.Connected)
|
||||
{
|
||||
instance.DisconnectFromServer();
|
||||
Debug.LogError("Disconnected from server. Most likely due to timeout.");
|
||||
VelNetLogger.Error("Disconnected from server. Most likely due to timeout.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -941,12 +994,12 @@ namespace VelNet
|
|||
catch (IOException ioException)
|
||||
{
|
||||
instance.DisconnectFromServer();
|
||||
Debug.LogError("Disconnected from server. Most likely due to timeout.\n" + ioException);
|
||||
VelNetLogger.Error("Disconnected from server. Most likely due to timeout.\n" + ioException);
|
||||
return false;
|
||||
}
|
||||
catch (SocketException socketException)
|
||||
{
|
||||
Debug.Log("Socket exception: " + socketException);
|
||||
VelNetLogger.Error("Socket exception: " + socketException);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -996,6 +1049,12 @@ namespace VelNet
|
|||
|
||||
public static void GetRoomData(string roomName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(roomName))
|
||||
{
|
||||
VelNetLogger.Error("Room name is null. Can't get info for this room.");
|
||||
return;
|
||||
}
|
||||
|
||||
MemoryStream stream = new MemoryStream();
|
||||
BinaryWriter writer = new BinaryWriter(stream);
|
||||
|
||||
|
|
@ -1147,14 +1206,14 @@ namespace VelNet
|
|||
NetworkObject prefab = instance.prefabs.Find(p => p.name == prefabName);
|
||||
if (prefab == null)
|
||||
{
|
||||
Debug.LogError("Couldn't find a prefab with that name: " + prefabName);
|
||||
VelNetLogger.Error("Couldn't find a prefab with that name: " + prefabName);
|
||||
return null;
|
||||
}
|
||||
|
||||
string networkId = localPlayer.userid + "-" + localPlayer.lastObjectId++;
|
||||
if (instance.objects.ContainsKey(networkId))
|
||||
{
|
||||
Debug.LogError("Can't instantiate object. Obj with that network ID was already instantiated.", instance.objects[networkId]);
|
||||
VelNetLogger.Error("Can't instantiate object. Obj with that network ID was already instantiated.", instance.objects[networkId]);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -1168,7 +1227,7 @@ namespace VelNet
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Error in event handling.\n" + e);
|
||||
VelNetLogger.Error("Error in event handling.\n" + e);
|
||||
}
|
||||
|
||||
instance.objects.Add(newObject.networkId, newObject);
|
||||
|
|
@ -1199,8 +1258,9 @@ namespace VelNet
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Error in event handling.\n" + e);
|
||||
VelNetLogger.Error("Error in event handling.\n" + e);
|
||||
}
|
||||
|
||||
instance.objects.Add(newObject.networkId, newObject);
|
||||
}
|
||||
|
||||
|
|
@ -1218,7 +1278,7 @@ namespace VelNet
|
|||
if (obj == null)
|
||||
{
|
||||
instance.objects.Remove(networkId);
|
||||
Debug.LogError("Object to delete was already null");
|
||||
VelNetLogger.Error("Object to delete was already null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1241,7 +1301,7 @@ namespace VelNet
|
|||
if (obj == null)
|
||||
{
|
||||
instance.objects.Remove(networkId);
|
||||
Debug.LogError("Object to delete was already null");
|
||||
// VelNetLogger.Error("Object to delete was already null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1263,28 +1323,28 @@ namespace VelNet
|
|||
{
|
||||
if (!InRoom)
|
||||
{
|
||||
Debug.LogError("Can't take ownership. Not in a room.");
|
||||
VelNetLogger.Error("Can't take ownership. Not in a room.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// local player must exist
|
||||
if (LocalPlayer == null)
|
||||
{
|
||||
Debug.LogError("Can't take ownership. No local player.");
|
||||
VelNetLogger.Error("Can't take ownership. No local player.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// obj must exist
|
||||
if (!instance.objects.ContainsKey(networkId))
|
||||
{
|
||||
Debug.LogError("Can't take ownership. Object with that network id doesn't exist: " + networkId);
|
||||
VelNetLogger.Error("Can't take ownership. Object with that network id doesn't exist: " + networkId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the ownership is locked, fail
|
||||
if (instance.objects[networkId].ownershipLocked)
|
||||
{
|
||||
Debug.LogError("Can't take ownership. Ownership for this object is locked.");
|
||||
VelNetLogger.Error("Can't take ownership. Ownership for this object is locked.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1296,7 +1356,7 @@ namespace VelNet
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Error in event handling.\n" + e);
|
||||
VelNetLogger.Error("Error in event handling.\n" + e);
|
||||
}
|
||||
|
||||
// must be ordered, so that ownership transfers are not confused.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VelNet
|
||||
|
|
@ -33,7 +32,7 @@ namespace VelNet
|
|||
VelNetManager.OnPlayerJoined += HandlePlayerJoined;
|
||||
}
|
||||
|
||||
public void HandlePlayerJoined(VelNetPlayer player)
|
||||
public void HandlePlayerJoined(VelNetPlayer player, bool alreadyInRoom)
|
||||
{
|
||||
//if this is the local player, go through the objects that I own, and send instantiation messages for the ones that have prefab names
|
||||
if (isLocal)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4838fd3ac54efa4c88253bb977c20c1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dc0ae145afb98164493d097e29dfb3bd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 18b28d1150d229647ae76efe2bea95f8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -28,6 +28,7 @@ Transform:
|
|||
m_LocalRotation: {x: -0.70710635, y: -0, z: -0, w: 0.7071073}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 8, y: 0.1, z: 8}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3076416102083120807}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -51,6 +52,7 @@ MeshRenderer:
|
|||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
|
|
@ -114,6 +116,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6602982999811082154}
|
||||
m_Father: {fileID: 0}
|
||||
|
|
@ -138,6 +141,7 @@ MeshRenderer:
|
|||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f8bb9027566930042942da486c1e29e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -193,6 +193,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 626742070}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -296,6 +297,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 138032023}
|
||||
- {fileID: 1557879931}
|
||||
|
|
@ -416,6 +418,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 117638565}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -453,6 +456,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 711524767}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -595,6 +599,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1894247853}
|
||||
- {fileID: 117638565}
|
||||
|
|
@ -628,8 +633,6 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 7a7db5bc792cd471dbd8039664359eee, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
autoConnect: 1
|
||||
autoRejoin: 1
|
||||
userInput: {fileID: 626742069}
|
||||
sendInput: {fileID: 0}
|
||||
roomInput: {fileID: 711524768}
|
||||
|
|
@ -664,6 +667,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 948755938}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -777,6 +781,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
|
|
@ -809,6 +814,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1992361063}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -889,6 +895,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1081889596}
|
||||
m_Father: {fileID: 244561620}
|
||||
|
|
@ -1021,6 +1028,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1047954372}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -1138,7 +1146,10 @@ MonoBehaviour:
|
|||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_OnSubmit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnDidEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
|
|
@ -1162,6 +1173,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2034439}
|
||||
- {fileID: 1560686264}
|
||||
|
|
@ -1300,6 +1312,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
|
|
@ -1333,6 +1346,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 162005664}
|
||||
- {fileID: 1484033256}
|
||||
|
|
@ -1395,7 +1409,10 @@ MonoBehaviour:
|
|||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_OnSubmit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnDidEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
|
|
@ -1517,6 +1534,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1047954372}
|
||||
m_RootOrder: 2
|
||||
|
|
@ -1555,6 +1573,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1401860307}
|
||||
m_Father: {fileID: 244561620}
|
||||
|
|
@ -1753,6 +1772,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -20}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
|
|
@ -1786,6 +1806,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1055818112}
|
||||
m_Father: {fileID: 927188573}
|
||||
|
|
@ -1876,6 +1897,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 912887456}
|
||||
- {fileID: 1154194182}
|
||||
|
|
@ -1986,6 +2008,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 359309141}
|
||||
- {fileID: 1840952814}
|
||||
|
|
@ -2084,7 +2107,10 @@ MonoBehaviour:
|
|||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_OnSubmit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnDidEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
|
|
@ -2164,6 +2190,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 244561620}
|
||||
m_RootOrder: 10
|
||||
|
|
@ -2242,6 +2269,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2144436500}
|
||||
- {fileID: 615558652}
|
||||
|
|
@ -2328,6 +2356,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1047954372}
|
||||
m_Father: {fileID: 912887456}
|
||||
|
|
@ -2366,6 +2395,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 545137760}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -2428,6 +2458,7 @@ GameObject:
|
|||
- component: {fileID: 1099803615}
|
||||
- component: {fileID: 1099803616}
|
||||
- component: {fileID: 1099803613}
|
||||
- component: {fileID: 1099803614}
|
||||
m_Layer: 0
|
||||
m_Name: NetworkManager
|
||||
m_TagString: Untagged
|
||||
|
|
@ -2448,6 +2479,18 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
playerPrefab: {fileID: 6139051692386484099, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3}
|
||||
--- !u!114 &1099803614
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1099803612}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5ea1fe0eb58e4184bbb2edcc99c51119, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &1099803615
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -2458,6 +2501,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -2474,10 +2518,13 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
host: velnet-lts.ugavel.com
|
||||
host: vn.ugavel.com
|
||||
port: 5000
|
||||
udpConnected: 0
|
||||
userid: -1
|
||||
debugMessages: 1
|
||||
autoLogin: 1
|
||||
onlyConnectToSameVersion: 1
|
||||
connected: 0
|
||||
prefabs:
|
||||
- {fileID: 9102273340480352682, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3}
|
||||
|
|
@ -2513,6 +2560,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1679565284}
|
||||
m_Father: {fileID: 927188573}
|
||||
|
|
@ -2639,6 +2687,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1295274441}
|
||||
m_Father: {fileID: 244561620}
|
||||
|
|
@ -2771,6 +2820,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1278634767}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -2850,6 +2900,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 864104176}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -2929,6 +2980,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1997780490}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -3024,6 +3076,7 @@ Transform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 818.5, y: 223, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -3130,6 +3183,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 711524767}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -3209,6 +3263,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 244561620}
|
||||
m_RootOrder: 11
|
||||
|
|
@ -3288,6 +3343,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 117638565}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -3363,6 +3419,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 626742070}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -3440,6 +3497,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2033163677}
|
||||
m_Father: {fileID: 1154194182}
|
||||
|
|
@ -3479,6 +3537,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2118429759}
|
||||
m_Father: {fileID: 244561620}
|
||||
|
|
@ -3611,6 +3670,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 948755938}
|
||||
m_RootOrder: 1
|
||||
|
|
@ -3690,6 +3750,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 244561620}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -3770,6 +3831,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 498776800}
|
||||
m_Father: {fileID: 948755938}
|
||||
|
|
@ -3903,6 +3965,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1428857710}
|
||||
m_Father: {fileID: 244561620}
|
||||
|
|
@ -4007,6 +4070,71 @@ CanvasRenderer:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1997780489}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2021764943
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2021764946}
|
||||
- component: {fileID: 2021764945}
|
||||
- component: {fileID: 2021764944}
|
||||
m_Layer: 0
|
||||
m_Name: TestRPC Object
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2021764944
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2021764943}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ownershipLocked: 0
|
||||
networkId:
|
||||
sceneNetworkId: 102
|
||||
prefabName:
|
||||
isSceneObject: 1
|
||||
syncedComponents:
|
||||
- {fileID: 2021764945}
|
||||
--- !u!114 &2021764945
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2021764943}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2bcc94802a5742d4299e48c898e52dfa, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
networkObject: {fileID: 2021764944}
|
||||
--- !u!4 &2021764946
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2021764943}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 2.9278836, y: 2.2367568, z: 0.06653424}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2033163676
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -4035,6 +4163,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1679565284}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -4110,6 +4239,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1760805525}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -4189,6 +4319,7 @@ RectTransform:
|
|||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1047954372}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -4251,6 +4382,10 @@ PrefabInstance:
|
|||
propertyPath: sceneNetworkId
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8565720275311462452, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8565720275311462453, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: TestNetworkedGameObject
|
||||
|
|
@ -123,7 +123,7 @@ NavMeshSettings:
|
|||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &516411417
|
||||
--- !u!1 &561771045
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -131,104 +131,54 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 516411421}
|
||||
- component: {fileID: 516411420}
|
||||
- component: {fileID: 516411419}
|
||||
- component: {fileID: 516411418}
|
||||
- component: {fileID: 561771047}
|
||||
- component: {fileID: 561771046}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Name: VelNet Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &516411418
|
||||
--- !u!114 &561771046
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_GameObject: {fileID: 561771045}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
host: 127.0.0.1
|
||||
port: 80
|
||||
host: vn.ugavel.com
|
||||
port: 5000
|
||||
udpConnected: 0
|
||||
userid: -1
|
||||
room:
|
||||
debugMessages: 1
|
||||
autoLogin: 1
|
||||
onlyConnectToSameVersion: 0
|
||||
connected: 0
|
||||
prefabs: []
|
||||
sceneObjects: []
|
||||
deletedSceneObjects: []
|
||||
--- !u!81 &516411419
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &516411420
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &516411421
|
||||
--- !u!4 &561771047
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516411417}
|
||||
m_GameObject: {fileID: 561771045}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &756322628
|
||||
--- !u!1 &951053497
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -236,8 +186,8 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 756322630}
|
||||
- component: {fileID: 756322629}
|
||||
- component: {fileID: 951053499}
|
||||
- component: {fileID: 951053498}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
|
|
@ -245,13 +195,13 @@ GameObject:
|
|||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &756322629
|
||||
--- !u!108 &951053498
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 756322628}
|
||||
m_GameObject: {fileID: 951053497}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
|
|
@ -307,17 +257,238 @@ Light:
|
|||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &756322630
|
||||
--- !u!4 &951053499
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 756322628}
|
||||
m_GameObject: {fileID: 951053497}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &958953873
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 958953877}
|
||||
- component: {fileID: 958953876}
|
||||
- component: {fileID: 958953875}
|
||||
- component: {fileID: 958953874}
|
||||
- component: {fileID: 958953879}
|
||||
- component: {fileID: 958953878}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &958953874
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &958953875
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &958953876
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &958953877
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &958953878
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3f1f9b0bbd93a484a987c51f1107ebe5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
networkObject: {fileID: 958953879}
|
||||
serializationRateHz: 30
|
||||
hybridOnChangeCompression: 1
|
||||
useLocalTransform: 0
|
||||
teleportDistance: 0
|
||||
teleportAngle: 0
|
||||
--- !u!114 &958953879
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 958953873}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ownershipLocked: 0
|
||||
networkId:
|
||||
sceneNetworkId: 100
|
||||
prefabName:
|
||||
isSceneObject: 1
|
||||
syncedComponents:
|
||||
- {fileID: 958953878}
|
||||
--- !u!1 &1615517332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1615517335}
|
||||
- component: {fileID: 1615517334}
|
||||
- component: {fileID: 1615517333}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1615517333
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1615517334
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &1615517335
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615517332}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2e6e0ddeb76e51b46afc0f0a43386ff2
|
||||
guid: 3e0da379b7e26cf4384f5cdff10f4fda
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cd6dd1d4e81bce64faaf29eedf9d2a63
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using UnityEngine;
|
||||
using VelNet;
|
||||
|
||||
public class CustomMessageTest : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
VelNetManager.OnJoinedRoom += _ =>
|
||||
{
|
||||
byte[] testPacket = { 244 };
|
||||
VelNetManager.SendCustomMessage(testPacket, true, true, false);
|
||||
};
|
||||
|
||||
VelNetManager.CustomMessageReceived += (senderId, dataWithCategory) =>
|
||||
{
|
||||
if (dataWithCategory[0] == 244)
|
||||
{
|
||||
Debug.Log($"Received test packet from {senderId}");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5ea1fe0eb58e4184bbb2edcc99c51119
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -8,9 +8,6 @@ namespace VelNet
|
|||
{
|
||||
public class NetworkGUI : MonoBehaviour
|
||||
{
|
||||
public bool autoConnect = true;
|
||||
public bool autoRejoin = true;
|
||||
|
||||
public InputField userInput;
|
||||
public InputField sendInput;
|
||||
public InputField roomInput;
|
||||
|
|
@ -40,7 +37,7 @@ namespace VelNet
|
|||
{
|
||||
if (VelNetManager.IsConnected)
|
||||
{
|
||||
VelNetManager.GetRoomData("0");
|
||||
VelNetManager.GetRoomData(VelNetManager.Room);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,44 +59,6 @@ namespace VelNet
|
|||
{
|
||||
comms = FindObjectOfType<DissonanceComms>();
|
||||
microphones.AddOptions(new List<string>(Microphone.devices));
|
||||
|
||||
if (autoConnect)
|
||||
{
|
||||
AutoJoin();
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoJoin()
|
||||
{
|
||||
VelNetManager.OnConnectedToServer += Login;
|
||||
|
||||
void Login()
|
||||
{
|
||||
if (!autoRejoin)
|
||||
{
|
||||
VelNetManager.OnConnectedToServer -= Login;
|
||||
}
|
||||
|
||||
HandleLogin();
|
||||
VelNetManager.OnLoggedIn += JoinRoom;
|
||||
|
||||
void JoinRoom()
|
||||
{
|
||||
HandleJoin();
|
||||
VelNetManager.OnLoggedIn -= JoinRoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (autoRejoin)
|
||||
{
|
||||
if (!VelNetManager.IsConnected)
|
||||
{
|
||||
AutoJoin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleMicrophoneSelection()
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using VelNet;
|
||||
|
||||
public class RPCTest : NetworkComponent
|
||||
{
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
SendRPC(nameof(TestRPC), true);
|
||||
}
|
||||
}
|
||||
|
||||
private void TestRPC()
|
||||
{
|
||||
Debug.Log("RPC RECEIVED!");
|
||||
}
|
||||
|
||||
public override void ReceiveBytes(byte[] message)
|
||||
{
|
||||
Debug.Log("WOW. BYTES");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2bcc94802a5742d4299e48c898e52dfa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "edu.uga.engr.vel.velnet",
|
||||
"displayName": "VelNet",
|
||||
"version": "1.0.13",
|
||||
"version": "1.1.0",
|
||||
"unity": "2019.1",
|
||||
"description": "A custom networking library for Unity.",
|
||||
"keywords": [
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@
|
|||
"depth": 0,
|
||||
"source": "local",
|
||||
"dependencies": {
|
||||
"edu.uga.engr.vel.velnet": "1.0.4"
|
||||
"edu.uga.engr.vel.velnet": "1.1.0"
|
||||
}
|
||||
},
|
||||
"com.unity.modules.ai": {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ EditorBuildSettings:
|
|||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Samples/VelNet/1.0.4/Example/test.unity
|
||||
path: Assets/Samples/VelNet/1.0.4/Example/Scenes/Demo All.unity
|
||||
guid: e4e43899246c941c78acfc59ce2f664a
|
||||
m_configObjects: {}
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.Rider.Editor:Packages.Rider.Editor:RiderScriptEditorPersistedState
|
||||
lastWriteTicks: -8585461253992250955
|
||||
lastWriteTicks: -8585433455978485828
|
||||
|
|
|
|||
BIN
velnet_logo.png
BIN
velnet_logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 40 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Loading…
Reference in New Issue