quick sync
This commit is contained in:
parent
1390b86b66
commit
ae74cd2938
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2bda7b958fad5863396916316ca9c9d9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0ff014219851d6143bb979c87f09c424
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b8b4909b7b411cb468ee5071779c402d
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,118 @@
|
||||||
|
using NobleConnect.NetCodeForGameObjects;
|
||||||
|
using System;
|
||||||
|
using Unity.Netcode;
|
||||||
|
using Unity.Netcode.Transports.UTP;
|
||||||
|
using Unity.Networking.Transport;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NobleConnect.Examples.NetCodeForGameObjects
|
||||||
|
{
|
||||||
|
public class ExampleNetCodeNetworkHUD : MonoBehaviour
|
||||||
|
{
|
||||||
|
public TMPro.TMP_InputField hostAddressField;
|
||||||
|
public TMPro.TMP_InputField hostPortField;
|
||||||
|
public TMPro.TMP_InputField hostAddressText;
|
||||||
|
public TMPro.TMP_InputField hostPortText;
|
||||||
|
public TMPro.TMP_Text connectionStatusText;
|
||||||
|
|
||||||
|
public GameObject startPanel;
|
||||||
|
public GameObject clientPanel;
|
||||||
|
public GameObject clientConnectedPanel;
|
||||||
|
public GameObject hostPanel;
|
||||||
|
|
||||||
|
NobleUnityTransport transport;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
transport = (NobleUnityTransport)NetworkManager.Singleton.NetworkConfig.NetworkTransport;
|
||||||
|
|
||||||
|
NetworkManager.Singleton.OnClientConnectedCallback += OnClientConnected;
|
||||||
|
NetworkManager.Singleton.OnClientDisconnectCallback += OnClientDisconnected;
|
||||||
|
transport.OnServerPreparedCallback += OnServerPrepared;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
if (NetworkManager.Singleton)
|
||||||
|
{
|
||||||
|
NetworkManager.Singleton.OnClientConnectedCallback -= OnClientConnected;
|
||||||
|
NetworkManager.Singleton.OnClientDisconnectCallback -= OnClientDisconnected;
|
||||||
|
}
|
||||||
|
if (transport)
|
||||||
|
{
|
||||||
|
transport.OnServerPreparedCallback -= OnServerPrepared;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartHost()
|
||||||
|
{
|
||||||
|
NetworkManager.Singleton.StartHost();
|
||||||
|
|
||||||
|
startPanel.SetActive(false);
|
||||||
|
hostPanel.SetActive(true);
|
||||||
|
|
||||||
|
hostAddressText.text = "Initializing..";
|
||||||
|
hostPortText.text = "Initializing..";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnServerPrepared(string relayAddress, ushort relayPort)
|
||||||
|
{
|
||||||
|
hostAddressText.text = relayAddress;
|
||||||
|
hostPortText.text = relayPort.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowClientPanel()
|
||||||
|
{
|
||||||
|
startPanel.SetActive(false);
|
||||||
|
clientPanel.SetActive(true);
|
||||||
|
|
||||||
|
|
||||||
|
hostAddressField.text = "";
|
||||||
|
hostPortField.text = "";
|
||||||
|
connectionStatusText.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartClient()
|
||||||
|
{
|
||||||
|
transport.ConnectionData.Address = hostAddressField.text;
|
||||||
|
transport.ConnectionData.Port = ushort.Parse(hostPortField.text);
|
||||||
|
|
||||||
|
NetworkManager.Singleton.StartClient();
|
||||||
|
|
||||||
|
clientPanel.SetActive(false);
|
||||||
|
clientConnectedPanel.SetActive(true);
|
||||||
|
|
||||||
|
connectionStatusText.text = "Connecting...";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClientConnected(ulong clientID)
|
||||||
|
{
|
||||||
|
connectionStatusText.text = "Connected via " + transport.ConnectionType.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClientDisconnected(ulong obj)
|
||||||
|
{
|
||||||
|
if (!NetworkManager.Singleton.IsServer)
|
||||||
|
{
|
||||||
|
clientConnectedPanel.SetActive(false);
|
||||||
|
startPanel.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopHost()
|
||||||
|
{
|
||||||
|
NetworkManager.Singleton.Shutdown();
|
||||||
|
|
||||||
|
hostPanel.SetActive(false);
|
||||||
|
startPanel.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disconnect()
|
||||||
|
{
|
||||||
|
NetworkManager.Singleton.Shutdown();
|
||||||
|
|
||||||
|
clientConnectedPanel.SetActive(false);
|
||||||
|
startPanel.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ba5623206fa16f649bf1c1fe1f121507
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,12 @@
|
||||||
|
Example scene that demonstrates how to utilize the Noble Connect relay and punchthrough services with Netcode for GameObjects
|
||||||
|
|
||||||
|
The buttons and text boxes can be used to host a server or connect as a client. When running as a host, the
|
||||||
|
host IP and port are displayed. When running as a client, the host IP and port can be entered in the text boxes
|
||||||
|
to connect to the host.
|
||||||
|
|
||||||
|
When a client connects, a player will be spawned that can be moved around with the arrow keys.
|
||||||
|
|
||||||
|
The connection type will be displayed on the client:
|
||||||
|
DIRECT - The connection was made directly to the host's IP.
|
||||||
|
PUNCHTHROUGH - The connection was made to an address on the host's router discovered via punchthrough.
|
||||||
|
RELAY - The connection is using the Noble Connect relays.
|
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a25369528e091a448ac1885300f43ed1
|
||||||
|
timeCreated: 1539666870
|
||||||
|
licenseType: Free
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Unity.Netcode;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NobleConnect.Examples.NetCodeForGameObjects
|
||||||
|
{
|
||||||
|
public class GUILabelFromText : MonoBehaviour
|
||||||
|
{
|
||||||
|
public TextAsset textFile;
|
||||||
|
TMPro.TMP_Text textComponent;
|
||||||
|
string text;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
text = textFile.text;
|
||||||
|
textComponent = GetComponent<TMPro.TMP_Text>();
|
||||||
|
textComponent.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (NetworkManager.Singleton && textComponent)
|
||||||
|
{
|
||||||
|
textComponent.enabled = !NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsClient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5de42016644089e4abe784ea3895c274
|
||||||
|
timeCreated: 1551004256
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: afe62a97c2928e16c8cf02e746313170
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 13f8d67022c71714d97870d1843d38d6
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,3 @@
|
||||||
|
Step 1: Download and Import the Match Up plugin
|
||||||
|
* If you purchased the Starter Pack or a monthly plan you should already have Match Up
|
||||||
|
Step 2: Import Example Match Up Package.unitypackage
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e91a5b06f65d194428755e7556c1b294
|
||||||
|
timeCreated: 1553109880
|
||||||
|
licenseType: Free
|
||||||
|
TextScriptImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,172 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &1536319450925060
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 4332269479232276}
|
||||||
|
- component: {fileID: 212516290045392758}
|
||||||
|
- component: {fileID: 6637994057718233789}
|
||||||
|
- component: {fileID: 4360000840590759850}
|
||||||
|
- component: {fileID: 4139990911018570439}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: NetCode for GameObjects Example Player
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &4332269479232276
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1536319450925060}
|
||||||
|
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
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!212 &212516290045392758
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1536319450925060}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10754, 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: 0
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 2c0f41f48ef7e7248a5db28d31441b2c, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 2.56, y: 2.56}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!114 &6637994057718233789
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1536319450925060}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
GlobalObjectIdHash: 951099334
|
||||||
|
AlwaysReplicateAsRoot: 0
|
||||||
|
DontDestroyWithOwner: 0
|
||||||
|
AutoObjectParentSync: 1
|
||||||
|
--- !u!114 &4360000840590759850
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1536319450925060}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: daef147c05839a94b97d7962538ed2c8, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!114 &4139990911018570439
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1536319450925060}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: cca18b1aff5bb3e498b69d39cea4db5d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
interpolationBackTime: 0.1
|
||||||
|
extrapolationMode: 1
|
||||||
|
useExtrapolationTimeLimit: 1
|
||||||
|
extrapolationTimeLimit: 5
|
||||||
|
useExtrapolationDistanceLimit: 0
|
||||||
|
extrapolationDistanceLimit: 20
|
||||||
|
sendPositionThreshold: 0
|
||||||
|
sendRotationThreshold: 0
|
||||||
|
sendScaleThreshold: 0
|
||||||
|
sendVelocityThreshold: 0
|
||||||
|
sendAngularVelocityThreshold: 0
|
||||||
|
receivedPositionThreshold: 0
|
||||||
|
receivedRotationThreshold: 0
|
||||||
|
snapPositionThreshold: 0
|
||||||
|
snapRotationThreshold: 0
|
||||||
|
snapScaleThreshold: 0
|
||||||
|
positionLerpSpeed: 0.85
|
||||||
|
rotationLerpSpeed: 0.85
|
||||||
|
scaleLerpSpeed: 0.85
|
||||||
|
timeCorrectionSpeed: 0.1
|
||||||
|
snapTimeThreshold: 3
|
||||||
|
syncPosition: 0
|
||||||
|
syncRotation: 0
|
||||||
|
syncScale: 0
|
||||||
|
syncVelocity: 0
|
||||||
|
syncAngularVelocity: 0
|
||||||
|
isPositionCompressed: 0
|
||||||
|
isRotationCompressed: 0
|
||||||
|
isScaleCompressed: 0
|
||||||
|
isVelocityCompressed: 0
|
||||||
|
isAngularVelocityCompressed: 0
|
||||||
|
automaticallyResetTime: 1
|
||||||
|
isSmoothingAuthorityChanges: 0
|
||||||
|
transformSource: 1
|
||||||
|
whenToUpdateTransform: 0
|
||||||
|
sendRate: 30
|
||||||
|
networkChannel:
|
||||||
|
childObjectToSync: {fileID: 0}
|
||||||
|
setVelocityInsteadOfPositionOnNonOwners: 0
|
||||||
|
maxPositionDifferenceForVelocitySyncing: 10
|
||||||
|
useLocalTransformOnly: 0
|
||||||
|
ownerChangeIndicator: 1
|
||||||
|
receivedStatesCounter: 0
|
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bad715cc405134b43aa5e949bf067444
|
||||||
|
timeCreated: 1552365448
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,29 @@
|
||||||
|
using Unity.Netcode;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NobleConnect.Examples.NetCodeForGameObjects
|
||||||
|
{
|
||||||
|
// A super simple example player. Use arrow keys to move
|
||||||
|
public class NetCodeForGameObjectsExamplePlayer : NetworkBehaviour
|
||||||
|
{
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (!IsLocalPlayer) return;
|
||||||
|
|
||||||
|
Vector3 dir = Vector3.zero;
|
||||||
|
|
||||||
|
if (Input.GetKey(KeyCode.UpArrow)) dir = Vector3.up;
|
||||||
|
else if (Input.GetKey(KeyCode.DownArrow)) dir = Vector3.down;
|
||||||
|
else if (Input.GetKey(KeyCode.LeftArrow)) dir = Vector3.left;
|
||||||
|
else if (Input.GetKey(KeyCode.RightArrow)) dir = Vector3.right;
|
||||||
|
|
||||||
|
MoveServerRpc(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ServerRpc]
|
||||||
|
void MoveServerRpc(Vector3 dir)
|
||||||
|
{
|
||||||
|
transform.position += dir * Time.deltaTime * 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: daef147c05839a94b97d7962538ed2c8
|
||||||
|
timeCreated: 1550909788
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {fileID: 2800000, guid: ffc16905f3ed6244d8bd4624bf34cf82, type: 3}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a008abdf62d15f24ea86f6a697caff98
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,277 @@
|
||||||
|
using Unity.Netcode.Transports.UTP;
|
||||||
|
using Unity.Netcode;
|
||||||
|
using NobleConnect.Ice;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using UnityEngine;
|
||||||
|
using System.Reflection;
|
||||||
|
using Unity.Networking.Transport;
|
||||||
|
using NetworkEvent = Unity.Netcode.NetworkEvent;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace NobleConnect.NetCodeForGameObjects
|
||||||
|
{
|
||||||
|
/// <summary>Extends UnityTransport to use Noble Connect for punchthrough and relays</summary>
|
||||||
|
public class NobleUnityTransport : UnityTransport
|
||||||
|
{
|
||||||
|
/// <summary>Some useful configuration settings like geographic region and timeouts.</summary>
|
||||||
|
[Header("Noble Connect Settings")]
|
||||||
|
public Config Config;
|
||||||
|
|
||||||
|
/// <summary>You can enable this to force relay connections to be used for testing purposes.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Disables punchthrough and direct connections. Forces connections to use the relays.
|
||||||
|
/// This is useful if you want to test your game with the unavoidable latency that is
|
||||||
|
/// introduced when the relay servers are used.
|
||||||
|
/// </remarks>
|
||||||
|
public bool ForceRelayOnly { get => Config.ForceRelayOnly; set => Config.ForceRelayOnly = value; }
|
||||||
|
|
||||||
|
/// <summary>This is the address that clients should connect to. It is assigned by the relay server.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Note that this is not the host's actual IP address, but one assigned to the host by the relay server.
|
||||||
|
/// When clients connect to this address, Noble Connect will find the best possible connection and use it.
|
||||||
|
/// This means that the client may actually end up connecting to an address on the local network, or an address
|
||||||
|
/// on the router, or an address on the relay. But you don't need to worry about any of that, it is all
|
||||||
|
/// handled for you internally.
|
||||||
|
/// </remarks>
|
||||||
|
public IPEndPoint HostRelayEndPoint;
|
||||||
|
|
||||||
|
/// <summary>You can check this on the client after they connect, it will either be Direct, Punchthrough, or Relay.</summary>
|
||||||
|
public ConnectionType LatestConnectionType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Peer != null) return Peer.latestConnectionType;
|
||||||
|
else return ConnectionType.NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Use this callback to be informed when something goes horribly wrong.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// You should see an error in your console with more info any time this is called. Generally
|
||||||
|
/// it will either mean you've completely lost connection to the relay server or you
|
||||||
|
/// have exceeded your CCU or bandwidth limit.
|
||||||
|
/// </remarks>
|
||||||
|
public event Action<string> OnFatalErrorCallback;
|
||||||
|
|
||||||
|
/// <summary>Use this callback to know when a Server has received their HostRelayEndPoint and is ready to receive incoming connections.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If you are using some sort matchmaking this is a good time to create a match now that you have the HostRelayEndPoint that clients will need to connect to.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="hostAddress">The address of the HostRelayEndPoint the clients should use when connecting to the host.</param>
|
||||||
|
/// <param name="hostPort">The port of the HostRelayEndPoint that clients should use when connecting to the host</param>
|
||||||
|
public event Action<string, ushort> OnServerPreparedCallback;
|
||||||
|
|
||||||
|
public ConnectionType ConnectionType => Peer.latestConnectionType;
|
||||||
|
|
||||||
|
/// <summary>Keeps track of which end point each connection belongs to so that when they disconnect we can clean up.</summary>
|
||||||
|
Dictionary<ulong, IPEndPoint> EndPointByConnection = new Dictionary<ulong, IPEndPoint>();
|
||||||
|
|
||||||
|
/// <summary>Represents a peer (client or server) in Noble Connect. Handles creating and destroying connection routes.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is the interface to the relay and punchthrough services.
|
||||||
|
/// It is used to find the best route to connect and to clean up when a client disconnects.
|
||||||
|
/// </remarks>
|
||||||
|
Peer Peer;
|
||||||
|
|
||||||
|
/// <summary>This delegate allows us to call the private base.Update method</summary>
|
||||||
|
Action BaseUpdateDelegate;
|
||||||
|
|
||||||
|
/// <summary>This delegate allows us to call the private ParseClientId method</summary>
|
||||||
|
Func<ulong, NetworkConnection> ParseClientIdDelegate;
|
||||||
|
|
||||||
|
/// <summary>Used to get the remote address of connecting clients</summary>
|
||||||
|
FieldInfo DriverField;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
// Set up logging using the LogLevel from the NetworkManager
|
||||||
|
Logger.logger = Debug.Log;
|
||||||
|
Logger.warnLogger = Debug.LogWarning;
|
||||||
|
Logger.errorLogger = Debug.LogError;
|
||||||
|
switch (NetworkManager.Singleton.LogLevel)
|
||||||
|
{
|
||||||
|
case LogLevel.Developer: Logger.logLevel = Logger.Level.Developer; break;
|
||||||
|
case LogLevel.Error: Logger.logLevel = Logger.Level.Error; break;
|
||||||
|
case LogLevel.Normal: Logger.logLevel = Logger.Level.Info; break;
|
||||||
|
case LogLevel.Nothing: Logger.logLevel = Logger.Level.Fatal; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The base update method is inaccessible but we need it to be called, so use reflection
|
||||||
|
var baseUpdateMethod = typeof(UnityTransport).GetMethod("Update", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||||
|
// Creating a delegate allows for faster method calls than Invoke, and we call Update a lot, so let's do that
|
||||||
|
BaseUpdateDelegate = (Action)Delegate.CreateDelegate(typeof(Action), this, baseUpdateMethod);
|
||||||
|
|
||||||
|
// We need access to the private m_Driver field in order to get the remote address of clients
|
||||||
|
DriverField = typeof(UnityTransport).GetField("m_Driver", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||||
|
|
||||||
|
// We need this private method to convert the ulong network id into a NetworkConnection
|
||||||
|
MethodInfo ParseClientIdMethod = typeof(UnityTransport).GetMethod("ParseClientId", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(ulong) }, null);
|
||||||
|
ParseClientIdDelegate = (Func<ulong, NetworkConnection>)Delegate.CreateDelegate(typeof(Func<ulong, NetworkConnection>), ParseClientIdMethod);
|
||||||
|
|
||||||
|
// Set up the callbacks we need
|
||||||
|
OnFatalErrorCallback += OnFatalError;
|
||||||
|
OnServerPreparedCallback += OnServerPrepared;
|
||||||
|
Config.OnFatalError = OnFatalErrorCallback;
|
||||||
|
|
||||||
|
// The Unity Transport apparently does not support ipv6, so disable it
|
||||||
|
Config.EnableIPv6 = false;
|
||||||
|
|
||||||
|
// Hook in to the transport level events so we can know when a client connects / disconnects
|
||||||
|
OnTransportEvent += OnReceivedTransportEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Initialize(NetworkManager netMan)
|
||||||
|
{
|
||||||
|
// Initialize the Peer
|
||||||
|
Peer = new Peer(Config.AsIceConfig());
|
||||||
|
|
||||||
|
base.Initialize(netMan);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Start a server and allocate a relay.</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// When the server has received a relay address the OnServerPreparedCallback will be triggered.
|
||||||
|
/// This callback is a good place to do things like create a match in your matchmaking system of choice,
|
||||||
|
/// or anything else that you want to do as soon as you have the host's address.
|
||||||
|
/// </remarks>
|
||||||
|
public override bool StartServer()
|
||||||
|
{
|
||||||
|
bool success = base.StartServer();
|
||||||
|
Peer.InitializeHosting(ConnectionData.Port, OnServerPreparedCallback);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Start a client and connect to ConnectionData.Address at ConnectionData.Port</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// ConnectionData.Address and ConnectionData.Port should be set to a host's HostRelayEndPoint before calling this method.
|
||||||
|
/// </remarks>
|
||||||
|
public override bool StartClient()
|
||||||
|
{
|
||||||
|
Peer.InitializeClient(new IPEndPoint(IPAddress.Parse(ConnectionData.Address), ConnectionData.Port), OnClientPrepared);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Shut down, disconnect, and clean up</summary>
|
||||||
|
public override void Shutdown()
|
||||||
|
{
|
||||||
|
base.Shutdown();
|
||||||
|
if (Peer != null)
|
||||||
|
{
|
||||||
|
Peer.CleanUpEverything();
|
||||||
|
Peer.Dispose();
|
||||||
|
Peer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Calls the Peer's Update() method to process messages. Also calls the base Update method via reflection</summary>
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (Peer != null)
|
||||||
|
{
|
||||||
|
Peer.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Equivalent to base.Update()
|
||||||
|
BaseUpdateDelegate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Transport level events are received here. Used to handle client connect / disconnect</summary>
|
||||||
|
/// <param name="eventType">The type of NetworkEvent that occurred</param>
|
||||||
|
/// <param name="clientId">The network id of the client that instigated the event</param>
|
||||||
|
/// <param name="payload">Any payload related to the event</param>
|
||||||
|
/// <param name="receiveTime">The time that the event was triggered</param>
|
||||||
|
private void OnReceivedTransportEvent(NetworkEvent eventType, ulong clientId, ArraySegment<byte> payload, float receiveTime)
|
||||||
|
{
|
||||||
|
if (NetworkManager.Singleton.IsServer)
|
||||||
|
{
|
||||||
|
if (eventType == NetworkEvent.Connect)
|
||||||
|
{
|
||||||
|
OnIncomingClientConnection(clientId);
|
||||||
|
}
|
||||||
|
else if (eventType == NetworkEvent.Disconnect)
|
||||||
|
{
|
||||||
|
OnServerLostClient(clientId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Keep track of the incoming client and their associated end point</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// We need to know the disconnecting client's EndPoint in order to clean up properly when they disconnect.
|
||||||
|
/// Ideally we would just look this up via the transport when the disconnect happens, but by the time we get the event the transport has already
|
||||||
|
/// purged that info, so instead we store it ourselves on connect so we can look it up on disconnect.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="clientId">The network Id of the disconnecting client</param>
|
||||||
|
void OnIncomingClientConnection(ulong clientId)
|
||||||
|
{
|
||||||
|
var clientEndPoint = GetClientEndPoint(clientId);
|
||||||
|
EndPointByConnection[clientId] = clientEndPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Clean up resources associated with the disconnecting client</summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This uses the end point that was associated with the clientId in OnIncomingClientConnection
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="clientId">The network Id of the disconnecting client</param>
|
||||||
|
void OnServerLostClient(ulong clientId)
|
||||||
|
{
|
||||||
|
if (EndPointByConnection.ContainsKey(clientId))
|
||||||
|
{
|
||||||
|
IPEndPoint endPoint = EndPointByConnection[clientId];
|
||||||
|
Peer.EndSession(endPoint);
|
||||||
|
EndPointByConnection.Remove(clientId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Called when the client has been allocated a relay. This is where the Transport level connection starts.</summary>
|
||||||
|
/// <param name="bridgeEndPoint">The IPv4 EndPoint to connect to</param>
|
||||||
|
/// <param name="bridgeEndPointIPv6">The IPv6 EndPoint to connect to. Not used here.</param>
|
||||||
|
void OnClientPrepared(IPEndPoint bridgeEndPoint, IPEndPoint bridgeEndPointIPv6)
|
||||||
|
{
|
||||||
|
ConnectionData.Address = bridgeEndPoint.Address.ToString();
|
||||||
|
ConnectionData.Port = (ushort)bridgeEndPoint.Port;
|
||||||
|
|
||||||
|
StartCoroutine(ConnectEventually());
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator ConnectEventually()
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(1);
|
||||||
|
base.StartClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>Called when the server has been allocated a relay and is ready to receive incoming connections</summary>
|
||||||
|
/// <param name="address">The host relay address that clients should connect to</param>
|
||||||
|
/// <param name="port">The host relay port that clients should connect to</param>
|
||||||
|
void OnServerPrepared(string address, ushort port)
|
||||||
|
{
|
||||||
|
HostRelayEndPoint = new IPEndPoint(IPAddress.Parse(address), port);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>If anythin goes horribly wrong, stop hosting / disconnect.</summary>
|
||||||
|
/// <param name="errorMessage">The error message from Noble Connect</param>
|
||||||
|
void OnFatalError(string errorMessage)
|
||||||
|
{
|
||||||
|
NetworkManager.Singleton.Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>Get a client's end point from their network id</summary>
|
||||||
|
/// <param name="clientId">The network id of the client</param>
|
||||||
|
/// <returns>The IPEndPoint of the client</returns>
|
||||||
|
IPEndPoint GetClientEndPoint(ulong clientId)
|
||||||
|
{
|
||||||
|
var driver = (NetworkDriver)DriverField.GetValue(this);
|
||||||
|
|
||||||
|
var clientNetworkConnection = ParseClientIdDelegate(clientId);
|
||||||
|
var remoteEndPoint = driver.RemoteEndPoint(clientNetworkConnection);
|
||||||
|
|
||||||
|
var ip = new IPAddress(remoteEndPoint.GetRawAddressBytes().ToArray());
|
||||||
|
var port = remoteEndPoint.Port;
|
||||||
|
|
||||||
|
return new IPEndPoint(ip, port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6845a83acce19754b928d0bee185ea3d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -1364,7 +1364,7 @@ GameObject:
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1981107772}
|
- component: {fileID: 1981107772}
|
||||||
- component: {fileID: 1981107771}
|
- component: {fileID: 1981107771}
|
||||||
- component: {fileID: 1981107770}
|
- component: {fileID: 1981107773}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: NetworkManager
|
m_Name: NetworkManager
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -1372,33 +1372,6 @@ GameObject:
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!114 &1981107770
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1981107769}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 6960e84d07fb87f47956e7a81d71c4e6, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_ProtocolType: 0
|
|
||||||
m_MaxPacketQueueSize: 128
|
|
||||||
m_MaxPayloadSize: 6144
|
|
||||||
m_HeartbeatTimeoutMS: 500
|
|
||||||
m_ConnectTimeoutMS: 1000
|
|
||||||
m_MaxConnectAttempts: 60
|
|
||||||
m_DisconnectTimeoutMS: 30000
|
|
||||||
ConnectionData:
|
|
||||||
Address: 127.0.0.1
|
|
||||||
Port: 7777
|
|
||||||
ServerListenAddress:
|
|
||||||
DebugSimulator:
|
|
||||||
PacketDelayMS: 0
|
|
||||||
PacketJitterMS: 0
|
|
||||||
PacketDropRate: 0
|
|
||||||
--- !u!114 &1981107771
|
--- !u!114 &1981107771
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -1415,7 +1388,7 @@ MonoBehaviour:
|
||||||
LogLevel: 1
|
LogLevel: 1
|
||||||
NetworkConfig:
|
NetworkConfig:
|
||||||
ProtocolVersion: 0
|
ProtocolVersion: 0
|
||||||
NetworkTransport: {fileID: 1981107770}
|
NetworkTransport: {fileID: 1981107773}
|
||||||
PlayerPrefab: {fileID: 5037713273676016863, guid: e4d6789fa0b00ceb1a6e5d6e5e801e06, type: 3}
|
PlayerPrefab: {fileID: 5037713273676016863, guid: e4d6789fa0b00ceb1a6e5d6e5e801e06, type: 3}
|
||||||
NetworkPrefabs:
|
NetworkPrefabs:
|
||||||
- Override: 0
|
- Override: 0
|
||||||
|
@ -1453,6 +1426,42 @@ Transform:
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 3
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1981107773
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1981107769}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 6845a83acce19754b928d0bee185ea3d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_ProtocolType: 0
|
||||||
|
m_MaxPacketQueueSize: 128
|
||||||
|
m_MaxPayloadSize: 6144
|
||||||
|
m_HeartbeatTimeoutMS: 500
|
||||||
|
m_ConnectTimeoutMS: 1000
|
||||||
|
m_MaxConnectAttempts: 60
|
||||||
|
m_DisconnectTimeoutMS: 30000
|
||||||
|
ConnectionData:
|
||||||
|
Address: 127.0.0.1
|
||||||
|
Port: 7777
|
||||||
|
ServerListenAddress:
|
||||||
|
DebugSimulator:
|
||||||
|
PacketDelayMS: 0
|
||||||
|
PacketJitterMS: 0
|
||||||
|
PacketDropRate: 0
|
||||||
|
Config:
|
||||||
|
Region: 0
|
||||||
|
ForceRelayOnly: 0
|
||||||
|
EnableIPv6: 1
|
||||||
|
RequestTimeout: 0.2
|
||||||
|
RelayRequestTimeout: 0.1
|
||||||
|
RelayRefreshMaxAttempts: 8
|
||||||
|
RelayLifetime: 60
|
||||||
|
RelayRefreshTime: 30
|
||||||
--- !u!1 &2108671896
|
--- !u!1 &2108671896
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
using System.Collections;
|
using NobleConnect.NetCodeForGameObjects;
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
using UnityEngine;
|
|
||||||
using Unity.Netcode;
|
using Unity.Netcode;
|
||||||
|
using Unity.Netcode.Transports.UTP;
|
||||||
|
using Unity.Networking.Transport;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
public class ServerMenu : MonoBehaviour
|
public class ServerMenu : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,9 @@ EditorUserSettings:
|
||||||
value: 5657560450545c5d590c097a16750743474f4a787f7b7160297b4932e3b56569
|
value: 5657560450545c5d590c097a16750743474f4a787f7b7160297b4932e3b56569
|
||||||
flags: 0
|
flags: 0
|
||||||
RecentlyUsedSceneGuid-1:
|
RecentlyUsedSceneGuid-1:
|
||||||
|
value: 010956525c0550595a0c587341205d44404f1d2f797871617a7e4430b6b0663c
|
||||||
|
flags: 0
|
||||||
|
RecentlyUsedSceneGuid-2:
|
||||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||||
flags: 0
|
flags: 0
|
||||||
vcSharedLogLevel:
|
vcSharedLogLevel:
|
||||||
|
|
|
@ -19,7 +19,7 @@ MonoBehaviour:
|
||||||
width: 1920
|
width: 1920
|
||||||
height: 978
|
height: 978
|
||||||
m_ShowMode: 4
|
m_ShowMode: 4
|
||||||
m_Title: Hierarchy
|
m_Title: Game
|
||||||
m_RootView: {fileID: 6}
|
m_RootView: {fileID: 6}
|
||||||
m_MinSize: {x: 875, y: 300}
|
m_MinSize: {x: 875, y: 300}
|
||||||
m_MaxSize: {x: 10000, y: 10000}
|
m_MaxSize: {x: 10000, y: 10000}
|
||||||
|
@ -48,7 +48,7 @@ MonoBehaviour:
|
||||||
m_MinSize: {x: 300, y: 200}
|
m_MinSize: {x: 300, y: 200}
|
||||||
m_MaxSize: {x: 24288, y: 16192}
|
m_MaxSize: {x: 24288, y: 16192}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 15
|
controlID: 73
|
||||||
--- !u!114 &3
|
--- !u!114 &3
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
|
@ -223,7 +223,7 @@ MonoBehaviour:
|
||||||
m_MinSize: {x: 200, y: 200}
|
m_MinSize: {x: 200, y: 200}
|
||||||
m_MaxSize: {x: 16192, y: 16192}
|
m_MaxSize: {x: 16192, y: 16192}
|
||||||
vertical: 1
|
vertical: 1
|
||||||
controlID: 16
|
controlID: 74
|
||||||
--- !u!114 &10
|
--- !u!114 &10
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
|
@ -248,7 +248,7 @@ MonoBehaviour:
|
||||||
m_MinSize: {x: 200, y: 100}
|
m_MinSize: {x: 200, y: 100}
|
||||||
m_MaxSize: {x: 16192, y: 8096}
|
m_MaxSize: {x: 16192, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 17
|
controlID: 39
|
||||||
--- !u!114 &11
|
--- !u!114 &11
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
|
@ -259,7 +259,7 @@ MonoBehaviour:
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 1
|
m_EditorHideFlags: 1
|
||||||
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
|
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
m_Name: GameView
|
m_Name: SceneView
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Position:
|
m_Position:
|
||||||
|
@ -270,12 +270,12 @@ MonoBehaviour:
|
||||||
height: 550
|
height: 550
|
||||||
m_MinSize: {x: 202, y: 221}
|
m_MinSize: {x: 202, y: 221}
|
||||||
m_MaxSize: {x: 4002, y: 4021}
|
m_MaxSize: {x: 4002, y: 4021}
|
||||||
m_ActualView: {fileID: 16}
|
m_ActualView: {fileID: 15}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 15}
|
- {fileID: 15}
|
||||||
- {fileID: 16}
|
- {fileID: 16}
|
||||||
m_Selected: 1
|
m_Selected: 0
|
||||||
m_LastSelected: 0
|
m_LastSelected: 1
|
||||||
--- !u!114 &12
|
--- !u!114 &12
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
|
@ -330,9 +330,9 @@ MonoBehaviour:
|
||||||
m_IsLocked: 0
|
m_IsLocked: 0
|
||||||
m_FolderTreeState:
|
m_FolderTreeState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs: 76660000
|
m_SelectedIDs: be660000
|
||||||
m_LastClickedID: 26230
|
m_LastClickedID: 26302
|
||||||
m_ExpandedIDs: 000000006266000000ca9a3b
|
m_ExpandedIDs: 0000000062660000426700004c670000a467000000ca9a3b
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
|
@ -387,7 +387,7 @@ MonoBehaviour:
|
||||||
m_ListAreaState:
|
m_ListAreaState:
|
||||||
m_SelectedInstanceIDs:
|
m_SelectedInstanceIDs:
|
||||||
m_LastClickedInstanceID: 0
|
m_LastClickedInstanceID: 0
|
||||||
m_HadKeyboardFocusLastEvent: 0
|
m_HadKeyboardFocusLastEvent: 1
|
||||||
m_ExpandedInstanceIDs: c623000000000000
|
m_ExpandedInstanceIDs: c623000000000000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
|
@ -488,9 +488,9 @@ MonoBehaviour:
|
||||||
m_SceneHierarchy:
|
m_SceneHierarchy:
|
||||||
m_TreeViewState:
|
m_TreeViewState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs:
|
m_SelectedIDs: c4660000
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 44f4ffff86f4ffffeaf5fffff0f5ffffc4f7ffff06f8ffff6af9ffff70f9ffff38fbffff
|
m_ExpandedIDs: 9ee6ffff24e8ffff82e9ffffd2e9ffff14eaffff18eaffffd4ecffff22edffff64edffff68edffff38fbffff02660000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
|
@ -913,7 +913,7 @@ MonoBehaviour:
|
||||||
m_HSlider: 0
|
m_HSlider: 0
|
||||||
m_VSlider: 0
|
m_VSlider: 0
|
||||||
m_IgnoreScrollWheelUntilClicked: 0
|
m_IgnoreScrollWheelUntilClicked: 0
|
||||||
m_EnableMouseInput: 1
|
m_EnableMouseInput: 0
|
||||||
m_EnableSliderZoomHorizontal: 0
|
m_EnableSliderZoomHorizontal: 0
|
||||||
m_EnableSliderZoomVertical: 0
|
m_EnableSliderZoomVertical: 0
|
||||||
m_UniformScale: 1
|
m_UniformScale: 1
|
||||||
|
|
Loading…
Reference in New Issue