added automatic reconnection of the socket after a disconnect, handle disconnects from timouts properly as a leave event to prevent errors and allow rejoining, fix delete network objects from not being sent across the network, add auto-rejoin option to the test scene, test scene uses callbacks instead of timed spacing to join server and room
parent
956267d04e
commit
de4975b5e3
|
|
@ -1,18 +1,15 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using Dissonance;
|
using Dissonance;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Serialization;
|
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace VelNet
|
namespace VelNet
|
||||||
{
|
{
|
||||||
public class NetworkGUI : MonoBehaviour
|
public class NetworkGUI : MonoBehaviour
|
||||||
{
|
{
|
||||||
public VelNetManager velNetManager;
|
|
||||||
|
|
||||||
public bool autoConnect = true;
|
public bool autoConnect = true;
|
||||||
|
public bool autoRejoin = true;
|
||||||
|
|
||||||
public InputField userInput;
|
public InputField userInput;
|
||||||
public InputField sendInput;
|
public InputField sendInput;
|
||||||
|
|
@ -68,17 +65,41 @@ namespace VelNet
|
||||||
|
|
||||||
if (autoConnect)
|
if (autoConnect)
|
||||||
{
|
{
|
||||||
StartCoroutine(testes());
|
AutoJoin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator testes()
|
private void AutoJoin()
|
||||||
{
|
{
|
||||||
yield return new WaitForSeconds(1.0f);
|
VelNetManager.OnConnectedToServer += Login;
|
||||||
HandleLogin();
|
|
||||||
yield return new WaitForSeconds(1.0f);
|
void Login()
|
||||||
HandleJoin();
|
{
|
||||||
yield return null;
|
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()
|
public void handleMicrophoneSelection()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -12,8 +11,10 @@ namespace VelNet
|
||||||
private Renderer rend;
|
private Renderer rend;
|
||||||
public Color color;
|
public Color color;
|
||||||
|
|
||||||
private void Start()
|
protected override void Awake()
|
||||||
{
|
{
|
||||||
|
base.Awake();
|
||||||
|
|
||||||
rend = GetComponent<MeshRenderer>();
|
rend = GetComponent<MeshRenderer>();
|
||||||
if (IsMine)
|
if (IsMine)
|
||||||
{
|
{
|
||||||
|
|
@ -35,7 +36,7 @@ namespace VelNet
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
{
|
{
|
||||||
VelNetManager.InstantiateNetworkObject("TestNetworkedGameObject");
|
VelNetManager.NetworkInstantiate("TestNetworkedGameObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.BackQuote))
|
if (Input.GetKeyDown(KeyCode.BackQuote))
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ public class VelNetMan : MonoBehaviour
|
||||||
{
|
{
|
||||||
VelNetManager.OnJoinedRoom += player =>
|
VelNetManager.OnJoinedRoom += player =>
|
||||||
{
|
{
|
||||||
VelNetManager.InstantiateNetworkObject(playerPrefab.name);
|
VelNetManager.NetworkInstantiate(playerPrefab.name);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -628,8 +628,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 7a7db5bc792cd471dbd8039664359eee, type: 3}
|
m_Script: {fileID: 11500000, guid: 7a7db5bc792cd471dbd8039664359eee, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
velNetManager: {fileID: 1099803616}
|
autoConnect: 1
|
||||||
autoConnect: 0
|
autoRejoin: 1
|
||||||
userInput: {fileID: 626742069}
|
userInput: {fileID: 626742069}
|
||||||
sendInput: {fileID: 0}
|
sendInput: {fileID: 0}
|
||||||
roomInput: {fileID: 711524768}
|
roomInput: {fileID: 711524768}
|
||||||
|
|
@ -2028,7 +2028,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
ownershipLocked: 0
|
ownershipLocked: 0
|
||||||
networkId:
|
networkId:
|
||||||
sceneNetworkId: 2
|
sceneNetworkId: 101
|
||||||
prefabName:
|
prefabName:
|
||||||
isSceneObject: 1
|
isSceneObject: 1
|
||||||
syncedComponents:
|
syncedComponents:
|
||||||
|
|
@ -2474,8 +2474,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
host: 129.158.60.79
|
host: velnet-lts.ugavel.com
|
||||||
port: 80
|
port: 5000
|
||||||
udpConnected: 0
|
udpConnected: 0
|
||||||
userid: -1
|
userid: -1
|
||||||
connected: 0
|
connected: 0
|
||||||
|
|
@ -4249,7 +4249,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 3951900052977689805, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
- target: {fileID: 3951900052977689805, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
||||||
propertyPath: sceneNetworkId
|
propertyPath: sceneNetworkId
|
||||||
value: 1
|
value: 100
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8565720275311462453, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
- target: {fileID: 8565720275311462453, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,12 @@ namespace VelNet.Editor
|
||||||
ids.Add(o.sceneNetworkId, o);
|
ids.Add(o.sceneNetworkId, o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[UnityEditor.Callbacks.DidReloadScripts]
|
||||||
|
private static void OnScriptsReloaded()
|
||||||
|
{
|
||||||
|
CheckDuplicateNetworkIds();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -101,6 +101,7 @@ namespace VelNet
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public bool connected;
|
public bool connected;
|
||||||
|
private double lastConnectionCheck;
|
||||||
|
|
||||||
public List<NetworkObject> prefabs = new List<NetworkObject>();
|
public List<NetworkObject> prefabs = new List<NetworkObject>();
|
||||||
public NetworkObject[] sceneObjects;
|
public NetworkObject[] sceneObjects;
|
||||||
|
|
@ -225,14 +226,10 @@ namespace VelNet
|
||||||
// add all local network objects
|
// add all local network objects
|
||||||
sceneObjects = FindObjectsOfType<NetworkObject>().Where(o => o.isSceneObject).ToArray();
|
sceneObjects = FindObjectsOfType<NetworkObject>().Where(o => o.isSceneObject).ToArray();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ConnectToServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
ConnectToTcpServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void AddMessage(Message m)
|
private void AddMessage(Message m)
|
||||||
{
|
{
|
||||||
lock (receivedMessages)
|
lock (receivedMessages)
|
||||||
|
|
@ -290,6 +287,7 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
|
|
||||||
//start the udp thread
|
//start the udp thread
|
||||||
|
clientReceiveThreadUDP?.Abort();
|
||||||
clientReceiveThreadUDP = new Thread(ListenForDataUDP);
|
clientReceiveThreadUDP = new Thread(ListenForDataUDP);
|
||||||
clientReceiveThreadUDP.Start();
|
clientReceiveThreadUDP.Start();
|
||||||
|
|
||||||
|
|
@ -373,34 +371,7 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
case YouLeftMessage msg:
|
case YouLeftMessage msg:
|
||||||
{
|
{
|
||||||
string oldRoom = LocalPlayer?.room;
|
LeaveRoom();
|
||||||
// delete all networkobjects that aren't sceneobjects or are null now
|
|
||||||
objects
|
|
||||||
.Where(kvp => kvp.Value == null || !kvp.Value.isSceneObject)
|
|
||||||
.Select(o => o.Key)
|
|
||||||
.ToList().ForEach(NetworkDestroy);
|
|
||||||
|
|
||||||
// then remove references to the ones that are left
|
|
||||||
objects.Clear();
|
|
||||||
|
|
||||||
// empty all the groups
|
|
||||||
foreach (string group in instance.groups.Keys)
|
|
||||||
{
|
|
||||||
SetupMessageGroup(group, new List<int>());
|
|
||||||
}
|
|
||||||
|
|
||||||
instance.groups.Clear();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
OnLeftRoom?.Invoke(oldRoom);
|
|
||||||
}
|
|
||||||
// prevent errors in subscribers from breaking our code
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Debug.LogError(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PlayerLeftMessage lm:
|
case PlayerLeftMessage lm:
|
||||||
|
|
@ -536,6 +507,56 @@ namespace VelNet
|
||||||
|
|
||||||
receivedMessages.Clear();
|
receivedMessages.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (Time.timeAsDouble - lastConnectionCheck > 2)
|
||||||
|
{
|
||||||
|
if (!IsConnected)
|
||||||
|
{
|
||||||
|
ConnectToServer();
|
||||||
|
}
|
||||||
|
|
||||||
|
lastConnectionCheck = Time.timeAsDouble;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LeaveRoom()
|
||||||
|
{
|
||||||
|
string oldRoom = LocalPlayer?.room;
|
||||||
|
// delete all NetworkObjects that aren't scene objects or are null now
|
||||||
|
objects
|
||||||
|
.Where(kvp => kvp.Value == null || !kvp.Value.isSceneObject)
|
||||||
|
.Select(o => o.Key)
|
||||||
|
.ToList().ForEach(NetworkDestroy);
|
||||||
|
|
||||||
|
// then remove references to the ones that are left
|
||||||
|
objects.Clear();
|
||||||
|
|
||||||
|
// empty all the groups
|
||||||
|
foreach (string group in instance.groups.Keys)
|
||||||
|
{
|
||||||
|
SetupMessageGroup(@group, new List<int>());
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.groups.Clear();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OnLeftRoom?.Invoke(oldRoom);
|
||||||
|
}
|
||||||
|
// prevent errors in subscribers from breaking our code
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (NetworkObject s in sceneObjects)
|
||||||
|
{
|
||||||
|
s.owner = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
players.Clear();
|
||||||
|
masterPlayer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnApplicationQuit()
|
private void OnApplicationQuit()
|
||||||
|
|
@ -548,12 +569,12 @@ namespace VelNet
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setup socket connection.
|
/// Setup socket connection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ConnectToTcpServer()
|
public static void ConnectToServer()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
clientReceiveThread = new Thread(ListenForData);
|
instance.clientReceiveThread = new Thread(instance.ListenForData);
|
||||||
clientReceiveThread.Start();
|
instance.clientReceiveThread.Start();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
@ -561,6 +582,18 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DisconnectFromServer()
|
||||||
|
{
|
||||||
|
LeaveRoom();
|
||||||
|
connected = false;
|
||||||
|
udpConnected = false;
|
||||||
|
socketConnection?.Close();
|
||||||
|
clientReceiveThreadUDP?.Abort();
|
||||||
|
clientReceiveThread?.Abort();
|
||||||
|
socketConnection = null;
|
||||||
|
udpSocket = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs in background clientReceiveThread; Listens for incoming data.
|
/// Runs in background clientReceiveThread; Listens for incoming data.
|
||||||
|
|
@ -649,7 +682,7 @@ namespace VelNet
|
||||||
rdm.room = roomname;
|
rdm.room = roomname;
|
||||||
for (int i = 0; i < N; i++)
|
for (int i = 0; i < N; i++)
|
||||||
{
|
{
|
||||||
//client id + short string
|
// client id + short string
|
||||||
int client_id = GetIntFromBytes(ReadExact(stream, 4));
|
int client_id = GetIntFromBytes(ReadExact(stream, 4));
|
||||||
int s = stream.ReadByte(); //size of string
|
int s = stream.ReadByte(); //size of string
|
||||||
utf8data = ReadExact(stream, s); //the username
|
utf8data = ReadExact(stream, s); //the username
|
||||||
|
|
@ -815,17 +848,27 @@ namespace VelNet
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send message to server using socket connection.
|
/// Send message to server using socket connection.
|
||||||
|
/// <param name="message">We can assume that this message is already formatted, so we just send it</param>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void SendTcpMessage(byte[] message) //we can assume that this message is already formatted, so we just send it
|
private static void SendTcpMessage(byte[] message)
|
||||||
{
|
{
|
||||||
// Debug.Log("Sent: " + clientMessage);
|
// Debug.Log("Sent: " + clientMessage);
|
||||||
if (instance.socketConnection == null)
|
if (instance.socketConnection == null)
|
||||||
{
|
{
|
||||||
|
Debug.LogError("Tried to send message while socket connection was still null.", instance);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// check if we have been disconnected, if so shut down velnet
|
||||||
|
if (!instance.socketConnection.Connected)
|
||||||
|
{
|
||||||
|
instance.DisconnectFromServer();
|
||||||
|
Debug.LogError("Disconnected from server. Most likely due to timeout.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get a stream object for writing.
|
// Get a stream object for writing.
|
||||||
NetworkStream stream = instance.socketConnection.GetStream();
|
NetworkStream stream = instance.socketConnection.GetStream();
|
||||||
if (stream.CanWrite)
|
if (stream.CanWrite)
|
||||||
|
|
@ -839,7 +882,7 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] get_be_bytes(int n)
|
private static byte[] get_be_bytes(int n)
|
||||||
{
|
{
|
||||||
return BitConverter.GetBytes(n).Reverse().ToArray();
|
return BitConverter.GetBytes(n).Reverse().ToArray();
|
||||||
}
|
}
|
||||||
|
|
@ -881,12 +924,12 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void GetRoomData(string roomname)
|
public static void GetRoomData(string roomName)
|
||||||
{
|
{
|
||||||
MemoryStream stream = new MemoryStream();
|
MemoryStream stream = new MemoryStream();
|
||||||
BinaryWriter writer = new BinaryWriter(stream);
|
BinaryWriter writer = new BinaryWriter(stream);
|
||||||
|
|
||||||
byte[] R = Encoding.UTF8.GetBytes(roomname);
|
byte[] R = Encoding.UTF8.GetBytes(roomName);
|
||||||
writer.Write((byte)MessageSendType.MESSAGE_GETROOMDATA);
|
writer.Write((byte)MessageSendType.MESSAGE_GETROOMDATA);
|
||||||
writer.Write((byte)R.Length);
|
writer.Write((byte)R.Length);
|
||||||
writer.Write(R);
|
writer.Write(R);
|
||||||
|
|
@ -896,13 +939,13 @@ namespace VelNet
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Joins a room by name
|
/// Joins a room by name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roomname">The name of the room to join</param>
|
/// <param name="roomName">The name of the room to join</param>
|
||||||
public static void Join(string roomname)
|
public static void Join(string roomName)
|
||||||
{
|
{
|
||||||
MemoryStream stream = new MemoryStream();
|
MemoryStream stream = new MemoryStream();
|
||||||
BinaryWriter writer = new BinaryWriter(stream);
|
BinaryWriter writer = new BinaryWriter(stream);
|
||||||
|
|
||||||
byte[] R = Encoding.UTF8.GetBytes(roomname);
|
byte[] R = Encoding.UTF8.GetBytes(roomName);
|
||||||
writer.Write((byte)MessageSendType.MESSAGE_JOINROOM);
|
writer.Write((byte)MessageSendType.MESSAGE_JOINROOM);
|
||||||
writer.Write((byte)R.Length);
|
writer.Write((byte)R.Length);
|
||||||
writer.Write(R);
|
writer.Write(R);
|
||||||
|
|
@ -917,7 +960,7 @@ namespace VelNet
|
||||||
{
|
{
|
||||||
if (InRoom)
|
if (InRoom)
|
||||||
{
|
{
|
||||||
Join(""); //super secret way to leave
|
Join(""); // super secret way to leave
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -996,25 +1039,25 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// changes the designated group that sendto(4) will go to
|
/// changes the designated group that SendTo(4) will go to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetupMessageGroup(string groupname, List<int> client_ids)
|
public static void SetupMessageGroup(string groupName, List<int> clientIds)
|
||||||
{
|
{
|
||||||
if (client_ids.Count > 0)
|
if (clientIds.Count > 0)
|
||||||
{
|
{
|
||||||
instance.groups[groupname] = client_ids.ToList();
|
instance.groups[groupName] = clientIds.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryStream stream = new MemoryStream();
|
MemoryStream stream = new MemoryStream();
|
||||||
BinaryWriter writer = new BinaryWriter(stream);
|
BinaryWriter writer = new BinaryWriter(stream);
|
||||||
byte[] R = Encoding.UTF8.GetBytes(groupname);
|
byte[] R = Encoding.UTF8.GetBytes(groupName);
|
||||||
writer.Write((byte)6);
|
writer.Write((byte)6);
|
||||||
writer.Write((byte)R.Length);
|
writer.Write((byte)R.Length);
|
||||||
writer.Write(R);
|
writer.Write(R);
|
||||||
writer.Write(get_be_bytes(client_ids.Count * 4));
|
writer.Write(get_be_bytes(clientIds.Count * 4));
|
||||||
for (int i = 0; i < client_ids.Count; i++)
|
foreach (int c in clientIds)
|
||||||
{
|
{
|
||||||
writer.Write(get_be_bytes(client_ids[i]));
|
writer.Write(get_be_bytes(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
SendTcpMessage(stream.ToArray());
|
SendTcpMessage(stream.ToArray());
|
||||||
|
|
@ -1081,9 +1124,36 @@ namespace VelNet
|
||||||
{
|
{
|
||||||
if (!instance.objects.ContainsKey(networkId)) return;
|
if (!instance.objects.ContainsKey(networkId)) return;
|
||||||
NetworkObject obj = instance.objects[networkId];
|
NetworkObject obj = instance.objects[networkId];
|
||||||
|
|
||||||
|
// clean up if this is null
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
{
|
{
|
||||||
instance.objects.Remove(networkId);
|
instance.objects.Remove(networkId);
|
||||||
|
Debug.LogError("Object to delete was already null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete locally immediately
|
||||||
|
SomebodyDestroyedNetworkObject(networkId);
|
||||||
|
|
||||||
|
// Only sent to others, as we already deleted this.
|
||||||
|
using MemoryStream mem = new MemoryStream();
|
||||||
|
using BinaryWriter writer = new BinaryWriter(mem);
|
||||||
|
writer.Write((byte)MessageType.Destroy);
|
||||||
|
writer.Write(networkId);
|
||||||
|
SendToRoom(mem.ToArray(), include_self: false, reliable: true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void SomebodyDestroyedNetworkObject(string networkId)
|
||||||
|
{
|
||||||
|
if (!instance.objects.ContainsKey(networkId)) return;
|
||||||
|
NetworkObject obj = instance.objects[networkId];
|
||||||
|
if (obj == null)
|
||||||
|
{
|
||||||
|
instance.objects.Remove(networkId);
|
||||||
|
Debug.LogError("Object to delete was already null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1113,7 +1183,7 @@ namespace VelNet
|
||||||
// obj must exist
|
// obj must exist
|
||||||
if (!instance.objects.ContainsKey(networkId))
|
if (!instance.objects.ContainsKey(networkId))
|
||||||
{
|
{
|
||||||
Debug.LogError("Can't take ownership. Object with that network id doesn't exist.");
|
Debug.LogError("Can't take ownership. Object with that network id doesn't exist: " + networkId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,17 +120,15 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
case VelNetManager.MessageType.Destroy: // I'm trying to destroy a gameobject I own
|
case VelNetManager.MessageType.Destroy: // I'm trying to destroy a gameobject I own
|
||||||
{
|
{
|
||||||
string networkId = reader.ReadString();
|
VelNetManager.SomebodyDestroyedNetworkObject(reader.ReadString());
|
||||||
|
|
||||||
VelNetManager.NetworkDestroy(networkId);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VelNetManager.MessageType.DeleteSceneObjects: //deleted scene objects
|
case VelNetManager.MessageType.DeleteSceneObjects: // deleted scene objects
|
||||||
{
|
{
|
||||||
int len = reader.ReadInt32();
|
int len = reader.ReadInt32();
|
||||||
for (int k = 1; k < len; k++)
|
for (int k = 1; k < len; k++)
|
||||||
{
|
{
|
||||||
VelNetManager.NetworkDestroy(reader.ReadString());
|
VelNetManager.SomebodyDestroyedNetworkObject(reader.ReadString());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using VelNet;
|
||||||
|
|
||||||
|
public class MouseDragger : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Camera cam;
|
||||||
|
public string[] draggableTags = { "draggable" };
|
||||||
|
private NetworkObject draggingObject;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
cam = Camera.main;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
|
||||||
|
{
|
||||||
|
foreach (string draggableTag in draggableTags)
|
||||||
|
{
|
||||||
|
if (hit.transform.CompareTag(draggableTag) || (hit.transform.parent != null && hit.transform.parent.CompareTag(draggableTag)))
|
||||||
|
{
|
||||||
|
NetworkObject netObj = hit.transform.GetComponent<NetworkObject>();
|
||||||
|
netObj ??= hit.transform.GetComponentInParent<NetworkObject>();
|
||||||
|
if (netObj == null) break;
|
||||||
|
netObj.TakeOwnership();
|
||||||
|
draggingObject = netObj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Input.GetMouseButtonUp(0))
|
||||||
|
{
|
||||||
|
draggingObject = null;
|
||||||
|
}
|
||||||
|
else if (Input.GetMouseButton(0) && draggingObject != null)
|
||||||
|
{
|
||||||
|
draggingObject.transform.position = cam.ScreenPointToRay(Input.mousePosition).direction * Vector3.Distance(draggingObject.transform.position, cam.transform.position) + cam.transform.position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c9d312e1088769143a72b0c13d5aee32
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -1,35 +1,46 @@
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Dissonance;
|
using Dissonance;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Serialization;
|
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace VelNet
|
namespace VelNet
|
||||||
{
|
{
|
||||||
public class NetworkGUI : MonoBehaviour
|
public class NetworkGUI : MonoBehaviour
|
||||||
{
|
{
|
||||||
[FormerlySerializedAs("networkManager")] public VelNetManager velNetManager;
|
public bool autoConnect = true;
|
||||||
|
public bool autoRejoin = true;
|
||||||
|
|
||||||
public InputField userInput;
|
public InputField userInput;
|
||||||
public InputField sendInput;
|
public InputField sendInput;
|
||||||
public InputField roomInput;
|
public InputField roomInput;
|
||||||
public Text messages;
|
public Text messages;
|
||||||
public List<string> messageBuffer;
|
public List<string> messageBuffer;
|
||||||
public Dropdown microphones;
|
public Dropdown microphones;
|
||||||
DissonanceComms comms;
|
private DissonanceComms comms;
|
||||||
|
|
||||||
public void HandleSend()
|
|
||||||
{
|
|
||||||
if (sendInput.text != "")
|
|
||||||
{
|
|
||||||
VelNetManager.SendTo(VelNetManager.MessageType.OTHERS, sendInput.text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void HandleLogin()
|
public void HandleLogin()
|
||||||
{
|
{
|
||||||
if (userInput.text != "")
|
if (userInput.text != "")
|
||||||
{
|
{
|
||||||
VelNetManager.Login(userInput.text, "nopass");
|
VelNetManager.Login(userInput.text, SystemInfo.deviceUniqueIdentifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleGetRooms()
|
||||||
|
{
|
||||||
|
if (VelNetManager.instance.connected)
|
||||||
|
{
|
||||||
|
VelNetManager.GetRooms();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GetRoomData()
|
||||||
|
{
|
||||||
|
if (VelNetManager.IsConnected)
|
||||||
|
{
|
||||||
|
VelNetManager.GetRoomData("0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,28 +52,54 @@ namespace VelNet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HandleLeave()
|
||||||
|
{
|
||||||
|
VelNetManager.Leave();
|
||||||
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
comms = FindObjectOfType<DissonanceComms>();
|
comms = FindObjectOfType<DissonanceComms>();
|
||||||
microphones.AddOptions(new List<string>(Microphone.devices));
|
microphones.AddOptions(new List<string>(Microphone.devices));
|
||||||
VelNetManager.MessageReceived += (m) =>
|
|
||||||
|
if (autoConnect)
|
||||||
{
|
{
|
||||||
string s = m.type + ":" + m.sender + ":" + m.text;
|
AutoJoin();
|
||||||
messageBuffer.Add(s);
|
}
|
||||||
messages.text = "";
|
}
|
||||||
|
|
||||||
|
private void AutoJoin()
|
||||||
|
{
|
||||||
|
VelNetManager.OnConnectedToServer += Login;
|
||||||
|
|
||||||
if (messageBuffer.Count > 10)
|
void Login()
|
||||||
|
{
|
||||||
|
if (!autoRejoin)
|
||||||
{
|
{
|
||||||
messageBuffer.RemoveAt(0);
|
VelNetManager.OnConnectedToServer -= Login;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (string msg in messageBuffer)
|
HandleLogin();
|
||||||
|
VelNetManager.OnLoggedIn += JoinRoom;
|
||||||
|
|
||||||
|
void JoinRoom()
|
||||||
{
|
{
|
||||||
messages.text = messages.text + msg + "\n";
|
HandleJoin();
|
||||||
|
VelNetManager.OnLoggedIn -= JoinRoom;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (autoRejoin)
|
||||||
|
{
|
||||||
|
if (!VelNetManager.IsConnected)
|
||||||
|
{
|
||||||
|
AutoJoin();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleMicrophoneSelection()
|
public void handleMicrophoneSelection()
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,31 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
namespace VelNet
|
namespace VelNet
|
||||||
{
|
{
|
||||||
public class PlayerController : NetworkComponent
|
public class PlayerController : NetworkSerializedObjectStream
|
||||||
{
|
{
|
||||||
public Vector3 targetPosition;
|
private Renderer rend;
|
||||||
public Quaternion targetRotation;
|
public Color color;
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
|
||||||
|
rend = GetComponent<MeshRenderer>();
|
||||||
|
if (IsMine)
|
||||||
|
{
|
||||||
|
color = new Color(Random.Range(0, 1f), Random.Range(0, 1f), Random.Range(0, 1f));
|
||||||
|
rend.material.color = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
// if (!IsMine)
|
|
||||||
// {
|
|
||||||
// transform.position = Vector3.Lerp(transform.position, targetPosition, .1f);
|
|
||||||
// transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, .1f);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
if (IsMine)
|
if (IsMine)
|
||||||
{
|
{
|
||||||
Vector3 movement = new Vector3();
|
Vector3 movement = new Vector3();
|
||||||
|
|
@ -29,54 +36,48 @@ namespace VelNet
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
{
|
{
|
||||||
VelNetManager.InstantiateNetworkObject("TestNetworkedGameObject");
|
VelNetManager.NetworkInstantiate("TestNetworkedGameObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.BackQuote))
|
if (Input.GetKeyDown(KeyCode.BackQuote))
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<string, NetworkObject> kvp in VelNetManager.instance.objects)
|
foreach (KeyValuePair<string, NetworkObject> kvp in VelNetManager.instance.objects)
|
||||||
{
|
{
|
||||||
Owner.TakeOwnership(kvp.Key);
|
kvp.Value.TakeOwnership();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Backspace))
|
if (Input.GetKeyDown(KeyCode.Backspace))
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<string, NetworkObject> kvp in VelNetManager.instance.objects)
|
foreach (string key in VelNetManager.instance.objects
|
||||||
|
.Where(kvp => !kvp.Value.ownershipLocked)
|
||||||
|
.Select(kvp => kvp.Key).ToArray())
|
||||||
{
|
{
|
||||||
// don't destroy player objects
|
VelNetManager.NetworkDestroy(key);
|
||||||
if (!kvp.Value.ownershipLocked)
|
|
||||||
{
|
|
||||||
Owner.NetworkDestroy(kvp.Key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
protected override void SendState(BinaryWriter binaryWriter)
|
||||||
// protected override byte[] SendState()
|
|
||||||
// {
|
|
||||||
// using MemoryStream mem = new MemoryStream();
|
|
||||||
// using BinaryWriter writer = new BinaryWriter(mem);
|
|
||||||
//
|
|
||||||
// writer.Write(transform.position);
|
|
||||||
// writer.Write(transform.rotation);
|
|
||||||
//
|
|
||||||
// return mem.ToArray();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// protected override void ReceiveState(byte[] message)
|
|
||||||
// {
|
|
||||||
// using MemoryStream mem = new MemoryStream(message);
|
|
||||||
// using BinaryReader reader = new BinaryReader(mem);
|
|
||||||
//
|
|
||||||
// targetPosition = reader.ReadVector3();
|
|
||||||
// targetRotation = reader.ReadQuaternion();
|
|
||||||
// }
|
|
||||||
public override void ReceiveBytes(byte[] message)
|
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
binaryWriter.Write(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ReceiveState(BinaryReader binaryReader)
|
||||||
|
{
|
||||||
|
// Color newColor = binaryReader.ReadColor();
|
||||||
|
Color newColor;
|
||||||
|
newColor.r = binaryReader.ReadSingle();
|
||||||
|
newColor.g = binaryReader.ReadSingle();
|
||||||
|
newColor.b = binaryReader.ReadSingle();
|
||||||
|
newColor.a = binaryReader.ReadSingle();
|
||||||
|
if (newColor != color)
|
||||||
|
{
|
||||||
|
rend.material.color = newColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
color = newColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,86 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &2802320351940726854
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6602982999811082154}
|
||||||
|
- component: {fileID: 6433756913090684124}
|
||||||
|
- component: {fileID: 6919422133110223353}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Dissonance Range
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6602982999811082154
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2802320351940726854}
|
||||||
|
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_Children: []
|
||||||
|
m_Father: {fileID: 3076416102083120807}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||||
|
--- !u!33 &6433756913090684124
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2802320351940726854}
|
||||||
|
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!23 &6919422133110223353
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2802320351940726854}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 2
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: 6fad1ca32acea73489c2c4b898cdb9d4, type: 2}
|
||||||
|
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!1 &6139051692386484099
|
--- !u!1 &6139051692386484099
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -32,8 +113,9 @@ Transform:
|
||||||
m_GameObject: {fileID: 6139051692386484099}
|
m_GameObject: {fileID: 6139051692386484099}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||||
m_Children: []
|
m_Children:
|
||||||
|
- {fileID: 6602982999811082154}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -113,6 +195,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
ownershipLocked: 1
|
ownershipLocked: 1
|
||||||
networkId:
|
networkId:
|
||||||
|
sceneNetworkId: 0
|
||||||
prefabName:
|
prefabName:
|
||||||
isSceneObject: 0
|
isSceneObject: 0
|
||||||
syncedComponents:
|
syncedComponents:
|
||||||
|
|
@ -132,8 +215,9 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
networkObject: {fileID: 9102273340480352682}
|
networkObject: {fileID: 9102273340480352682}
|
||||||
targetPosition: {x: 0, y: 0, z: 0}
|
serializationRateHz: 30
|
||||||
targetRotation: {x: 0, y: 0, z: 0, w: 0}
|
hybridOnChangeCompression: 1
|
||||||
|
color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
--- !u!114 &1181612843795795320
|
--- !u!114 &1181612843795795320
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -147,9 +231,10 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
networkObject: {fileID: 9102273340480352682}
|
networkObject: {fileID: 9102273340480352682}
|
||||||
|
useTcp: 0
|
||||||
dissonanceID:
|
dissonanceID:
|
||||||
closePlayers:
|
closePlayers:
|
||||||
maxDistance: 0
|
maxDistance: 2
|
||||||
--- !u!114 &7564913803199044469
|
--- !u!114 &7564913803199044469
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -163,7 +248,8 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
networkObject: {fileID: 9102273340480352682}
|
networkObject: {fileID: 9102273340480352682}
|
||||||
serializationRateHz: 30
|
serializationRateHz: 60
|
||||||
targetPosition: {x: 0, y: 0, z: 0}
|
hybridOnChangeCompression: 1
|
||||||
targetRotation: {x: 0, y: 0, z: 0, w: 0}
|
useLocalTransform: 0
|
||||||
smoothness: 0.1
|
teleportDistance: 0
|
||||||
|
teleportAngle: 0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
using System.IO;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using VelNet;
|
||||||
|
|
||||||
|
public class SyncedTextbox : NetworkSerializedObjectStream
|
||||||
|
{
|
||||||
|
public InputField text;
|
||||||
|
|
||||||
|
|
||||||
|
protected override void SendState(BinaryWriter binaryWriter)
|
||||||
|
{
|
||||||
|
binaryWriter.Write(text.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ReceiveState(BinaryReader binaryReader)
|
||||||
|
{
|
||||||
|
text.text = binaryReader.ReadString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TakeOwnership()
|
||||||
|
{
|
||||||
|
networkObject.TakeOwnership();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a7b2180d3fffdc459417bfc24b179b8
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!1 &8565720275311462453
|
--- !u!1 &6003361529827848619
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
|
@ -8,92 +8,24 @@ GameObject:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 8565720275311462455}
|
- component: {fileID: 7099230484513283147}
|
||||||
- component: {fileID: 3951900052977689805}
|
- component: {fileID: 8811139817265458480}
|
||||||
- component: {fileID: 8565720275311462452}
|
- component: {fileID: 3776025769317911085}
|
||||||
|
- component: {fileID: 1426238303320144522}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: TestNetworkedGameObject
|
m_Name: Cube
|
||||||
m_TagString: TestSphere
|
m_TagString: TestSphere
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!4 &8565720275311462455
|
--- !u!4 &7099230484513283147
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8565720275311462453}
|
m_GameObject: {fileID: 6003361529827848619}
|
||||||
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_Children:
|
|
||||||
- {fileID: 8565720276181857624}
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_RootOrder: 0
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!114 &3951900052977689805
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 8565720275311462453}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
ownershipLocked: 0
|
|
||||||
networkId:
|
|
||||||
prefabName:
|
|
||||||
isSceneObject: 0
|
|
||||||
syncedComponents:
|
|
||||||
- {fileID: 8565720275311462452}
|
|
||||||
--- !u!114 &8565720275311462452
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 8565720275311462453}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 3f1f9b0bbd93a484a987c51f1107ebe5, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
networkObject: {fileID: 3951900052977689805}
|
|
||||||
serializationRateHz: 30
|
|
||||||
targetPosition: {x: 0, y: 0, z: 0}
|
|
||||||
targetRotation: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
smoothness: 0.1
|
|
||||||
--- !u!1 &8565720276181857625
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 8565720276181857624}
|
|
||||||
- component: {fileID: 8565720276181857605}
|
|
||||||
- component: {fileID: 8565720276181857626}
|
|
||||||
- component: {fileID: 8565720276181857627}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Sphere
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &8565720276181857624
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 8565720276181857625}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
|
@ -101,21 +33,21 @@ Transform:
|
||||||
m_Father: {fileID: 8565720275311462455}
|
m_Father: {fileID: 8565720275311462455}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!33 &8565720276181857605
|
--- !u!33 &8811139817265458480
|
||||||
MeshFilter:
|
MeshFilter:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8565720276181857625}
|
m_GameObject: {fileID: 6003361529827848619}
|
||||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
--- !u!23 &8565720276181857626
|
--- !u!23 &3776025769317911085
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8565720276181857625}
|
m_GameObject: {fileID: 6003361529827848619}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_CastShadows: 1
|
m_CastShadows: 1
|
||||||
m_ReceiveShadows: 1
|
m_ReceiveShadows: 1
|
||||||
|
|
@ -150,16 +82,86 @@ MeshRenderer:
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
--- !u!135 &8565720276181857627
|
--- !u!65 &1426238303320144522
|
||||||
SphereCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8565720276181857625}
|
m_GameObject: {fileID: 6003361529827848619}
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_IsTrigger: 0
|
m_IsTrigger: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Radius: 0.5
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &8565720275311462453
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 8565720275311462455}
|
||||||
|
- component: {fileID: 3951900052977689805}
|
||||||
|
- component: {fileID: 8565720275311462452}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: TestNetworkedGameObject
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &8565720275311462455
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8565720275311462453}
|
||||||
|
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_Children:
|
||||||
|
- {fileID: 7099230484513283147}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3951900052977689805
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8565720275311462453}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
ownershipLocked: 0
|
||||||
|
networkId:
|
||||||
|
sceneNetworkId: 0
|
||||||
|
prefabName:
|
||||||
|
isSceneObject: 0
|
||||||
|
syncedComponents:
|
||||||
|
- {fileID: 8565720275311462452}
|
||||||
|
--- !u!114 &8565720275311462452
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8565720275311462453}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 3f1f9b0bbd93a484a987c51f1107ebe5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
networkObject: {fileID: 3951900052977689805}
|
||||||
|
serializationRateHz: 60
|
||||||
|
hybridOnChangeCompression: 1
|
||||||
|
useLocalTransform: 0
|
||||||
|
teleportDistance: 0
|
||||||
|
teleportAngle: 0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: TransparentMat
|
||||||
|
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: 3000
|
||||||
|
stringTagMap:
|
||||||
|
RenderType: Transparent
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _BumpMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailAlbedoMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailMask:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _DetailNormalMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _EmissionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MetallicGlossMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OcclusionMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _ParallaxMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
- _BumpScale: 1
|
||||||
|
- _Cutoff: 0.5
|
||||||
|
- _DetailNormalMapScale: 1
|
||||||
|
- _DstBlend: 10
|
||||||
|
- _GlossMapScale: 1
|
||||||
|
- _Glossiness: 0.5
|
||||||
|
- _GlossyReflections: 0
|
||||||
|
- _Metallic: 0
|
||||||
|
- _Mode: 3
|
||||||
|
- _OcclusionStrength: 1
|
||||||
|
- _Parallax: 0.02
|
||||||
|
- _SmoothnessTextureChannel: 0
|
||||||
|
- _SpecularHighlights: 0
|
||||||
|
- _SrcBlend: 1
|
||||||
|
- _UVSec: 0
|
||||||
|
- _ZWrite: 0
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 0.03137255}
|
||||||
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6fad1ca32acea73489c2c4b898cdb9d4
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VelNet;
|
using VelNet;
|
||||||
|
|
||||||
|
|
@ -12,7 +10,7 @@ public class VelNetMan : MonoBehaviour
|
||||||
{
|
{
|
||||||
VelNetManager.OnJoinedRoom += player =>
|
VelNetManager.OnJoinedRoom += player =>
|
||||||
{
|
{
|
||||||
VelNetManager.InstantiateNetworkObject(playerPrefab.name);
|
VelNetManager.NetworkInstantiate(playerPrefab.name);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 009dc4ba29f14b649beb8c3eaad89f15
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,323 @@
|
||||||
|
%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.44657898, g: 0.4964133, b: 0.5748178, 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 &516411417
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 516411421}
|
||||||
|
- component: {fileID: 516411420}
|
||||||
|
- component: {fileID: 516411419}
|
||||||
|
- component: {fileID: 516411418}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Main Camera
|
||||||
|
m_TagString: MainCamera
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &516411418
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 516411417}
|
||||||
|
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
|
||||||
|
udpConnected: 0
|
||||||
|
userid: -1
|
||||||
|
room:
|
||||||
|
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
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 516411417}
|
||||||
|
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_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &756322628
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 756322630}
|
||||||
|
- component: {fileID: 756322629}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Directional Light
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!108 &756322629
|
||||||
|
Light:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 756322628}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 10
|
||||||
|
m_Type: 1
|
||||||
|
m_Shape: 0
|
||||||
|
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||||
|
m_Intensity: 1
|
||||||
|
m_Range: 10
|
||||||
|
m_SpotAngle: 30
|
||||||
|
m_InnerSpotAngle: 21.80208
|
||||||
|
m_CookieSize: 10
|
||||||
|
m_Shadows:
|
||||||
|
m_Type: 2
|
||||||
|
m_Resolution: -1
|
||||||
|
m_CustomResolution: -1
|
||||||
|
m_Strength: 1
|
||||||
|
m_Bias: 0.05
|
||||||
|
m_NormalBias: 0.4
|
||||||
|
m_NearPlane: 0.2
|
||||||
|
m_CullingMatrixOverride:
|
||||||
|
e00: 1
|
||||||
|
e01: 0
|
||||||
|
e02: 0
|
||||||
|
e03: 0
|
||||||
|
e10: 0
|
||||||
|
e11: 1
|
||||||
|
e12: 0
|
||||||
|
e13: 0
|
||||||
|
e20: 0
|
||||||
|
e21: 0
|
||||||
|
e22: 1
|
||||||
|
e23: 0
|
||||||
|
e30: 0
|
||||||
|
e31: 0
|
||||||
|
e32: 0
|
||||||
|
e33: 1
|
||||||
|
m_UseCullingMatrixOverride: 0
|
||||||
|
m_Cookie: {fileID: 0}
|
||||||
|
m_DrawHalo: 0
|
||||||
|
m_Flare: {fileID: 0}
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_Lightmapping: 4
|
||||||
|
m_LightShadowCasterMode: 0
|
||||||
|
m_AreaSize: {x: 1, y: 1}
|
||||||
|
m_BounceIntensity: 1
|
||||||
|
m_ColorTemperature: 6570
|
||||||
|
m_UseColorTemperature: 0
|
||||||
|
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_UseBoundingSphereOverride: 0
|
||||||
|
m_UseViewFrustumForShadowCasterCull: 1
|
||||||
|
m_ShadowRadius: 0
|
||||||
|
m_ShadowAngle: 0
|
||||||
|
--- !u!4 &756322630
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 756322628}
|
||||||
|
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_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2e6e0ddeb76e51b46afc0f0a43386ff2
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "edu.uga.engr.vel.velnet",
|
"name": "edu.uga.engr.vel.velnet",
|
||||||
"displayName": "VelNet",
|
"displayName": "VelNet",
|
||||||
"version": "1.0.9",
|
"version": "1.0.10",
|
||||||
"unity": "2019.1",
|
"unity": "2019.1",
|
||||||
"description": "A custom networking library for Unity.",
|
"description": "A custom networking library for Unity.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue