working relays hopefully

This commit is contained in:
logzinga 2023-03-02 10:54:21 +11:00
parent e3a55278e5
commit 162dc2cdb4
68 changed files with 487 additions and 6917 deletions

View File

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 47960fcc1509505478abb826d0ddd57b
folderAsset: yes
timeCreated: 1538747955
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f8b65a10719a36e458516ffd952b1bc7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,123 +0,0 @@
using NobleConnect.Ice;
using System;
using System.Text;
using UnityEngine;
namespace NobleConnect
{
[Serializable]
public class Config
{
[NonSerialized]
public ushort IcePort;
[NonSerialized]
public string Username;
[NonSerialized]
public string Password;
[NonSerialized]
public string Origin;
[NonSerialized]
public bool UseSimpleAddressGathering = false;
public Action<string> OnFatalError;
public Action OnOfferFailed;
/// <summary>The geographic region to use when selecting a relay server.</summary>
/// <remarks>
/// Defaults to AUTO which will automatically select the closest region.
/// This is useful if you would like your players to be able to choose
/// their region at run time.
/// Note that players are not prevented from connecting across regions.
/// That would need to be implementing separately via matchmaking for
/// example, by filtering out matches from undesired regions.
/// </remarks>
[Tooltip("The geographic region to use when selecting a relay server.")]
public GeographicRegion Region;
/// <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>
[Tooltip("Enable this to force relay connections to be used for testing purposes.")]
public bool ForceRelayOnly = false;
/// <summary>By default IPv6 is enabled, but you can disable it if you're using a transport that does not support IPv6</summary>
[Tooltip("By default IPv6 is enabled, but you can disable it if you're using a transport that does not support IPv6.")]
public bool EnableIPv6 = true;
/// <summary>Request timeout.</summary>
/// <remarks>
/// This effects how long to wait before considering a request to have failed.
/// Requests are used during the punchthrough process and for setting up and maintaining relays.
/// If you are allowing cross-region play or expect high latency you can increase this so that requests won't time out.
/// The drawback is that waiting longer for timeouts causes it take take longer to detect actual failed requests so the
/// connection process may take longer.
/// </remarks>
[Tooltip("How long to wait before considering a request to have failed.")]
public float RequestTimeout = .2f;
/// <summary>Initial timeout before resending refresh messages. This is doubled for each failed resend.</summary>
[Tooltip("Initial timeout before resending refresh messages. This is doubled for each failed resend.")]
public float RelayRequestTimeout = .1f;
/// <summary>Max number of times to try and resend refresh messages before giving up and shutting down the relay connection.</summary>
[Tooltip("Max number of times to try and resend refresh messages before giving up and shutting down the relay connection.")]
public int RelayRefreshMaxAttempts = 8;
/// <summary>How long a relay will stay alive without being refreshed</summary>
/// <remarks>
/// Setting this value higher means relays will stay alive longer even if the host temporarily loses connection or otherwise fails to send the refresh request in time.
/// This can be helpful to maintain connection on an undependable network or when heavy application load (such as loading large levels synchronously) temporarily prevents requests from being processed.
/// The drawback is that CCU is used for as long as the relay stays alive, so players that crash or otherwise don't clean up properly can cause lingering CCU usage for up to relayLifetime seconds.
/// </remarks>
[Tooltip("How long a relay will stay alive without being refreshed.")]
public int RelayLifetime = 60;
/// <summary>How often to send relay refresh requests.</summary>
[Tooltip("How often to send relay refresh requests.")]
public int RelayRefreshTime = 30;
public IceConfig AsIceConfig()
{
// Get a reference to the NobleConnectSettings
var settings = (NobleConnectSettings)Resources.Load("NobleConnectSettings", typeof(NobleConnectSettings));
// Parse the username, password, and origin from the game id
string username = "", password = "", origin = "";
if (!string.IsNullOrEmpty(settings.gameID))
{
string decodedGameID = Encoding.UTF8.GetString(Convert.FromBase64String(settings.gameID));
string[] parts = decodedGameID.Split('\n');
if (parts.Length == 3)
{
username = parts[1];
password = parts[2];
origin = parts[0];
}
}
var iceConfig = new IceConfig {
iceServerAddress = RegionURL.FromRegion(Region),
icePort = settings.relayServerPort,
username = username,
password = password,
origin = origin,
useSimpleAddressGathering = (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android) && !Application.isEditor,
onFatalError = OnFatalError,
onOfferFailed = () => OnFatalError("Offer failed"),
forceRelayOnly = ForceRelayOnly,
enableIPv6 = EnableIPv6,
RequestTimeout = RequestTimeout,
RelayRequestTimeout = RelayRequestTimeout,
RelayRefreshMaxAttempts = RelayRefreshMaxAttempts,
RelayLifetime = RelayLifetime,
RelayRefreshTime = RelayRefreshTime
};
return iceConfig;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 959d07654e99fd345a7ae965ae68fad7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,140 +0,0 @@
fileFormatVersion: 2
guid: 2c0f41f48ef7e7248a5db28d31441b2c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,19 +0,0 @@
using UnityEngine;
namespace NobleConnect
{
/// <summary>Settings used by Noble Connect to authenticate with the relay and punchthrough services</summary>
public class NobleConnectSettings : ScriptableObject
{
/// <summary>Used to identify your game and authenticate with the relay servers</summary>
/// <remarks>
/// This is populated for you when you go through the setup wizard but you can also set it manually here.
/// Your game ID is available any time on the dashboard at noblewhale.com
/// </remarks>
[Tooltip("Used to identify your game and authenticate with the relay servers")]
public string gameID;
[HideInInspector]
public ushort relayServerPort = 3478;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0154c6ffa997c574c9f0f2680c03e82f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,15 +0,0 @@
using UnityEngine;
using UnityEngine.UI;
namespace NobleConnect.Examples
{
public class TextFromFile : MonoBehaviour
{
public TextAsset TextFile;
void OnValidate()
{
GetComponent<Text>().text = TextFile.text;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 35c73af1cf66d43448d976a70078d546
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,17 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NobleConnect
{
public class UnityLogger
{
public static void Init()
{
Logger.logger = Debug.Log;
Logger.warnLogger = Debug.LogWarning;
Logger.errorLogger = Debug.LogError;
//Logger.logLevel = Logger.Level.Developer;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 59351c3313ddebb45a3153e4cc90a575
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,77 +0,0 @@
fileFormatVersion: 2
guid: e07dc4a0a043f9b4ab82f3967dcb9a2a
timeCreated: 1551016206
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 537f111e71c987b409f64bd60743a6b2
folderAsset: yes
timeCreated: 1539153299
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,52 +0,0 @@
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
namespace NobleConnect
{
/// <summary>
/// Adds the given define symbols to PlayerSettings define symbols.
/// Just add your own define symbols to the Symbols property at the below.
/// </summary>
[InitializeOnLoad]
public class AddNobleConnectScriptingDefine : Editor
{
/// <summary>
/// Symbols that will be added to the editor
/// </summary>
public static readonly string[] Symbols = new string[] {
"NOBLE_CONNECT", // Noble Connect exists
"NOBLE_CONNECT_1", // Major version
"NOBLE_CONNECT_1_37" // Major and minor version
};
/// <summary>
/// Add define symbols as soon as Unity gets done compiling.
/// </summary>
static AddNobleConnectScriptingDefine()
{
// Get the current scripting defines
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
// Convert the string to a list
List<string> allDefines = definesString.Split(';').ToList();
// Remove any old version defines from previous installs
for (int i = allDefines.Count-1; i >= 0; i--)
{
if (allDefines[i].StartsWith("NOBLE_CONNECT") && !Symbols.Contains(allDefines[i]))
{
allDefines.RemoveAt(i);
}
}
// Add any symbols that weren't already in the list
allDefines.AddRange(Symbols.Except(allDefines));
PlayerSettings.SetScriptingDefineSymbolsForGroup(
EditorUserBuildSettings.selectedBuildTargetGroup,
string.Join(";", allDefines.ToArray())
);
}
}
}
#endif

View File

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: b53ae3111803795478bcbb739ad557f1
timeCreated: 1551018990
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 35ce04e51d0abb847890436754a88096, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,42 +0,0 @@
using System;
using UnityEngine.Networking;
using System.Security.Cryptography.X509Certificates;
using UnityEngine;
namespace NobleConnect.Internal
{
#if !UNITY_5 && !UNITY_2017
public class AmazonCertificateHandler : CertificateHandler
{
// Encoded RSAPublicKey
private static readonly string PUB_KEY = "3082010A0282010100CCCC0263917F8002CD937BEDCD06F29" +
"919F82E724EE5012E2C02991AD7FA06603D927975B099FF23" +
"CA94A876ED8F9871051ED81A13D1486534BCF1B07277DC0DA" +
"26C79C03B58590C9B2724917C68E3A10368ABFC214C20D8DF" +
"E3BC8ACE0519C776E9F9EC93FADD6C6A5E1CDA1A24867D67F" +
"EC0AF2B0DB8DD1BBB7D020331B7C0ECF838B57C73E6FF6722" +
"F17A9DF74391CFC4914B44B77655B79223E1E550F715AD6F1" +
"4BF3E755FFF815526C162BB3F379FFB5272D3C0EA59A35D1E" +
"9E49B94872EB768250BA3DBBFFD042015BDD2B1DFD164B950" +
"6D7DA324B63348122CE9EB368DB2FF0E02AD6B7A453A28B11" +
"E67591FC2CC0B74E1C80688C535D32DC692C08ED0203010001";
/// <summary>
/// Validate the Certificate Against the Amazon public Cert
/// </summary>
/// <param name="certificateData">Certifcate to validate</param>
/// <returns></returns>
protected override bool ValidateCertificate(byte[] certificateData)
{
X509Certificate2 certificate = new X509Certificate2(certificateData);
string pk = certificate.GetPublicKeyString();
if (pk.ToLower().Equals(PUB_KEY.ToLower()))
{
return true;
}
return false;
}
}
#endif
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a832db3337d4187499b35f1b02b16042
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1,77 +0,0 @@
fileFormatVersion: 2
guid: e2718437b8b970d43918120542ad4bcd
timeCreated: 1539817181
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,386 +0,0 @@
using System;
using System.Collections;
using System.Text;
using NobleConnect;
using UnityEditor;
using UnityEngine;
using UnityEngine.Networking;
public class SetupWizard : EditorWindow
{
const string windowTitle = "Noble Connect";
const string titleText = "Noble Connect Setup";
const string bodyText = "\nEnter your game id or email address to enable Noble Connect.\n\n" +
"The service is free to use for development but bandwidth and CCU is limited.\n" +
"Visit noblewhale.com to upgrade to a paid account and remove the bandwidth and CCU limits.";
const string signUpSuccessText = "Successful account signup. \n\n" +
"Load up an example to get started or visit our website to upgrade to a paid account.\n";
const string accountAlreadyExistsText = "User already exists. \n\n" +
"Log in at noblewhale.com to get your game ID.\n";
const string otherErrorText = "An error has occurred. \n\n" +
"Log in at noblewhale.com to get your game ID.\n";
const string enteredGameIDText = "GameID entered. \n\n" +
"Welcome back. Visit noblewhale.com to upgrade to a paid account\n" +
"and remove the bandwidth and CCU limits.\n";
Texture2D logo, bg;
GUIStyle headerStyle = new GUIStyle();
GUIStyle titleStyle = new GUIStyle();
GUIStyle logoStyle = new GUIStyle();
GUIStyle bodyStyle = new GUIStyle();
GUIStyle secondScreenStyle = new GUIStyle();
bool clickedActivate = false;
bool accountActivated = false;
bool accountAlreadyExists = false;
bool otherError = false;
bool enteredGameID = false;
IEnumerator createAccountRequest;
string emailOrGameID;
SetupWizard()
{
minSize = new Vector2(530, 300);
}
void OnEnable()
{
if (logo == null)
{
string[] paths = AssetDatabase.FindAssets("whale_256 t:Texture2D");
if (paths != null && paths.Length > 0)
{
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(AssetDatabase.GUIDToAssetPath(paths[0]));
}
}
if (bg == null)
{
string[] paths = AssetDatabase.FindAssets("Noble Setup Title Background t:Texture2D");
if (paths != null && paths.Length > 0)
{
bg = AssetDatabase.LoadAssetAtPath<Texture2D>(AssetDatabase.GUIDToAssetPath(paths[0]));
}
}
}
void Update()
{
if (createAccountRequest != null) createAccountRequest.MoveNext();
}
void OnGUI()
{
DrawHeader();
if (!accountActivated && !accountAlreadyExists && !otherError && !enteredGameID)
{
bodyStyle.padding = new RectOffset(10, 10, 0, 5);
EditorGUILayout.BeginVertical(bodyStyle);
GUILayout.Label(bodyText);
GUILayout.Label("\nEmail or Game ID");
emailOrGameID = EditorGUILayout.TextField(emailOrGameID);
EditorGUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (!clickedActivate && GUILayout.Button("Activate"))
{
createAccountRequest = ActivateAccount();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
// Account creation success.
if (accountActivated)
{
bodyStyle.padding = new RectOffset(15, 10, 15, 5);
EditorGUILayout.BeginVertical(bodyStyle);
GUILayout.Label(signUpSuccessText);
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
secondScreenStyle.padding = new RectOffset(15, Screen.width, 10, 5);
if (GUILayout.Button("Sign Up for Pro"))
{
Application.OpenURL("http://noblewhale.com");
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Close Window"))
{
this.Close();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
// Found account with this email already.
else if (accountAlreadyExists)
{
bodyStyle.padding = new RectOffset(15, 10, 15, 5);
//GUI.contentColor = Color.red;
//bodyStyle.normal.textColor = Color.red;
EditorGUILayout.BeginVertical(bodyStyle);
GUILayout.Label(accountAlreadyExistsText);// secondScreenStyle);
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
secondScreenStyle.padding = new RectOffset(15, Screen.width, 10, 5);
if (GUILayout.Button("Go to noblewhale.com"))
{
Application.OpenURL("http://noblewhale.com");
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Close Window"))
{
this.Close();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
else if (otherError)
{
bodyStyle.padding = new RectOffset(15, 10, 15, 5);
//bodyStyle.normal.textColor = new Color(204,0,0);
EditorGUILayout.BeginVertical();
GUILayout.Label(otherErrorText, bodyStyle);
EditorGUILayout.EndVertical();
//bodyStyle.normal.textColor = Color.black;
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
secondScreenStyle.padding = new RectOffset(15, Screen.width, 10, 5);
if (GUILayout.Button("Go to noblewhale.com"))
{
Application.OpenURL("http://noblewhale.com");
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Close Window"))
{
this.Close();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
else if (enteredGameID)
{
bodyStyle.padding = new RectOffset(15, 10, 15, 5);
//bodyStyle.normal.textColor = new Color(204,0,0);
EditorGUILayout.BeginVertical();
GUILayout.Label(enteredGameIDText, bodyStyle);
EditorGUILayout.EndVertical();
//bodyStyle.normal.textColor = Color.black;
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
secondScreenStyle.padding = new RectOffset(15, Screen.width, 10, 5);
if (GUILayout.Button("Go to noblewhale.com"))
{
Application.OpenURL("http://noblewhale.com");
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical(secondScreenStyle);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Close Window"))
{
this.Close();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
}
IEnumerator ActivateAccount()
{
clickedActivate = true;
string gameID = emailOrGameID;
if (emailOrGameID.Contains("@"))
{
gameID = null;
WWWForm form = new WWWForm();
form.AddField("username", emailOrGameID);
form.AddField("email", emailOrGameID);
#if UNITY_5 || UNITY_2017
WWW w = new WWW("https://robot:z3hZAY*1ESiq7ecUR&OxFFNO@noblewhale.com/wp-json/wp/v2/users", form);
while (!w.isDone) yield return 0;
if (w.error != null && w.error != "")
{
if (w.text.Contains("existing_user_login"))
{
Debug.LogError("User already exists. Log in at noblewhale.com to get your game ID.");
// TODO: Display error notification window
accountAlreadyExists = true;
}
else
{
Debug.LogError(w.error + " " + w.text);
otherError = true;
}
}
else
{
// Get the newly created game id from the response text
// Manually parsing some json to avoid third party libraries and a bunch of needless overhead
string key = "\"game_id_0\"";
int keyIndex = w.text.IndexOf(key);
int valueStartIndex = w.text.IndexOf("\"", keyIndex + key.Length + 1) + 1;
int valueEndIndex = w.text.IndexOf("\"", valueStartIndex + 1);
string value = w.text.Substring(valueStartIndex, valueEndIndex - valueStartIndex);
gameID = value;
accountActivated = true;
}
w.Dispose();
#else
using (var w = UnityEngine.Networking.UnityWebRequest.Post("https://robot:z3hZAY*1ESiq7ecUR&OxFFNO@noblewhale.com/wp-json/wp/v2/users", form))
{
var amazonCertificateHandler = new CertificateDisregarder();
w.certificateHandler = amazonCertificateHandler;
yield return w.SendWebRequest();
while (!w.isDone) yield return 0;
var result = w.downloadHandler.text;
#if UNITY_2020_1_OR_NEWER
if (w.result == UnityEngine.Networking.UnityWebRequest.Result.ConnectionError || w.result == UnityEngine.Networking.UnityWebRequest.Result.ProtocolError)
#else
if (w.isNetworkError || w.isHttpError)
#endif
{
if (result.Contains("existing_user_login"))
{
Debug.LogError("User already exists. Log in at noblewhale.com to get your game ID.");
// TODO: Display error notification window
accountAlreadyExists = true;
}
else
{
Debug.LogError(w.error + " " + result);
otherError = true;
}
}
else
{
// Get the newly created game id from the response text
// Manually parsing some json to avoid third party libraries and a bunch of needless overhead
Debug.Log(result);
StringBuilder sb = new StringBuilder();
foreach (var dict in w.GetResponseHeaders())
{
sb.Append(dict.Key).Append(": \t[").Append(dict.Value).Append("]\n");
}
// Print Headers
Debug.Log(sb.ToString());
string key = "\"game_id_0\"";
int keyIndex = result.IndexOf(key);
int valueStartIndex = result.IndexOf("\"", keyIndex + key.Length + 1) + 1;
int valueEndIndex = result.IndexOf("\"", valueStartIndex + 1);
string value = result.Substring(valueStartIndex, valueEndIndex - valueStartIndex);
gameID = value;
accountActivated = true;
}
}
#endif
}
else
{
enteredGameID = true;
// TODO: Test gameID somehow
}
if (gameID != null)
{
var settings = (NobleConnectSettings)Resources.Load("NobleConnectSettings", typeof(NobleConnectSettings));
if (!settings)
{
settings = ScriptableObject.CreateInstance<NobleConnectSettings>();
if (!AssetDatabase.IsValidFolder("Assets/Noble Connect"))
{
AssetDatabase.CreateFolder("Assets", "Noble Connect");
}
if (!AssetDatabase.IsValidFolder("Assets/Noble Connect/Resources"))
{
AssetDatabase.CreateFolder("Assets/Noble Connect", "Resources");
}
AssetDatabase.CreateAsset(settings, "Assets/Noble Connect/Resources/NobleConnectSettings.asset");
}
settings.gameID = gameID;
EditorUtility.SetDirty(settings);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
}
void DrawHeader()
{
headerStyle.normal.background = bg;
headerStyle.fixedHeight = 68;
EditorGUILayout.BeginHorizontal(headerStyle);
titleStyle.fontSize = 22;
titleStyle.fontStyle = FontStyle.Bold;
titleStyle.padding = new RectOffset(10, 10, 20, 10);
GUILayout.Label(titleText, titleStyle);
GUILayout.FlexibleSpace();
logoStyle.fixedWidth = 50;
logoStyle.margin = new RectOffset(0, 11, 7, 7);
GUILayout.Label(logo, logoStyle);
EditorGUILayout.EndHorizontal();
}
[MenuItem("Window/Noble Connect/Setup", false, 0)]
protected static void MenuItemOpenWizard()
{
GetWindow(typeof(SetupWizard), false, windowTitle, true);
}
[InitializeOnLoad]
public class ShowSetupWizard : EditorWindow
{
static bool hasChecked = false;
static ShowSetupWizard()
{
EditorApplication.update += Update;
}
static void Update()
{
if (EditorApplication.timeSinceStartup > 3.0f && !hasChecked)
{
hasChecked = true;
var settings = (NobleConnectSettings)Resources.Load("NobleConnectSettings", typeof(NobleConnectSettings));
if (!settings || (settings.gameID == ""))
{
SetupWizard window = (SetupWizard)GetWindow(typeof(SetupWizard));
window.Show();
}
}
}
}
public class CertificateDisregarder : CertificateHandler
{
protected override bool ValidateCertificate(byte[] certificateData)
{
return true;
}
}
}

View File

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 6ed5d5a6469ade6438c50b3489f723a8
timeCreated: 1551019118
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 35ce04e51d0abb847890436754a88096, type: 3}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,117 +0,0 @@
fileFormatVersion: 2
guid: 35ce04e51d0abb847890436754a88096
timeCreated: 1551018934
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: iPhone
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Windows Store Apps
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d1429e7cc1a99a1479ef93aac006070c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,3 +0,0 @@
Step 1: Download and import Mirror: https://assetstore.unity.com/packages/tools/network/mirror-129321
Step 2: Import the package "Assets/Noble Connect/Mirror/Mirror Noble Connect.unitypackage" to add Mirror support to Noble Connect.
Step 3: Check out the example scenes in "Assets/Noble Connect/Mirror/Examples" to get started.

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 8efcd80227d51204789cd37b3318fb67
timeCreated: 1552034575
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4677f09a6725cea43abfebd58f5f6ba7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e51f6bc6724c0df41b0ef45a5cd354f8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 2bda7b958fad5863396916316ca9c9d9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0ff014219851d6143bb979c87f09c424
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: b8b4909b7b411cb468ee5071779c402d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,118 +0,0 @@
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);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ba5623206fa16f649bf1c1fe1f121507
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,12 +0,0 @@
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.

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: a25369528e091a448ac1885300f43ed1
timeCreated: 1539666870
licenseType: Free
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,27 +0,0 @@
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;
}
}
}
}

View File

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 5de42016644089e4abe784ea3895c274
timeCreated: 1551004256
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: afe62a97c2928e16c8cf02e746313170
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 13f8d67022c71714d97870d1843d38d6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,3 +0,0 @@
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

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e91a5b06f65d194428755e7556c1b294
timeCreated: 1553109880
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,172 +0,0 @@
%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

View File

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: bad715cc405134b43aa5e949bf067444
timeCreated: 1552365448
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,29 +0,0 @@
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;
}
}
}

View File

@ -1,13 +0,0 @@
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:

View File

@ -1,3 +0,0 @@
Step 1: Use the PackageManager to get NetCode for GameObjects
Step 2: Import the package "Assets/Noble Connect/NetCode for GameObjects/NetCode for GameObjects Noble Connect.unitypackage" to add NetCode for GameObjects support to Noble Connect.
Step 3: Check out the example scenes in "Assets/Noble Connect/NetCode for GameObjects/Examples" to get started.

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 06e66bd298fb6824b8c530a0da552ba3
timeCreated: 1552034575
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a008abdf62d15f24ea86f6a697caff98
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,277 +0,0 @@
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);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6845a83acce19754b928d0bee185ea3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 078540d8d7d4dd644a7466811097da56
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,33 +0,0 @@
fileFormatVersion: 2
guid: 272f780a0da55bb43a85079e5ba1969f
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,91 +0,0 @@
# README
[
[**Website**](https://noblewhale.com)
|
[**Dashboard**](https://noblewhale.com/dashboard)
|
[**Docs**](https://noblewhale.com/docs)
|
[**FAQ**](https://noblewhale.com/faq)
|
[**Asset Store**](https://assetstore.unity.com/packages/tools/network/noble-connect-140535)
]
Adds relays and punchthrough to UNet or Mirror.
Guarantees your players can connect while reducing latency and saving you money by connecting players directly whenever possible.
Your players won't need to worry about forwarding ports or fiddling with router settings, they can just sit back, relax, and enjoy your beautiful game.
Supports Windows, Linux, OSX, Android, and iOS.
Supports:
* UNet
* Mirror with KCP, LiteNetLib, or Ignorance transports
* NetCode for GameObjects with UnityTransport
*Note: Web builds are not supported.*
# How to Use
In order to use the Noble Connect relay and punchthrough services you will need to sign up for an account. You can do this on our
website or through the Unity Engine at Window->Noble Connect->Setup. It is free to sign up but your CCU and bandwidth will be limited.
In order to raise the limits you will either need to purchase the Starter Pack or one of the monthly plans.
## Step 1 - Set up
1. You can access the setup window at any time by going to Window->Noble Connect->Setup.
2. Enter your email address to sign up, or enter your Game ID if you already have an account.
* You can get your Game ID any time from the dashboard at https://noblewhale.com/dashboard
3. Import the package for your networking system:
* If you are using Mirror, import the "Mirror Noble Connect.unitypackage"
* Make sure you have the correct version of Mirror imported first. Usually this means the latest from the Asset Store, but you can check the description on the [Noble Connect](https://assetstore.unity.com/packages/tools/network/noble-connect-140535) page to confirm.
* If you are using UNet, import the "UNet Noble Connect.unitypackage"
* In 2019.1 or later you must first install the "Multiplayer HLAPI" package from the Unity Package Manager
* If you are using NetCode for Gameobjects, import the "NetCode for GameObjects Noble Connect.unitypackage"
## Step 2 - Test it
1. Add the "Noble Connect/[UNet or Mirror or Netcode for GameObjects]/Examples/Network Manager/Network Manager Example.unity" scene to the build settings.
2. Build for your desired platform and run the build.
3. Click "Host" in the build.
* Note the IP and port that are displayed, this is the address that clients will use to connect to the host.
4. Run the Network Manager Example scene in the editor.
5. Click "Client" and then enter the ip and port from the host.
6. Click "Connect" to connect to the host.
* When the connection is complete you will see the connection type displayed on the client.
# Examples
Check out the Example scenes and scripts to see common ways to get connected. Each example includes a README file with more detailed instructions.
If you need any more information don't hesitate to contact us at nobleconnect@noblewhale.com
# What next?
Generally you should extend from the provided NobleNetworkManager.
If you prefer something a little lower level, you can also use the NobleServer and NobleClient classes directly to Listen() and Connect().
Most things will work exactly the same as you are used to if you are familiar with UNet, Mirror, or Netcode for GameObjects
**Note: For most methods that you override in NobleNetworkManager you will want to make sure to call the base method to avoid causing unexpected behaviour.**
# Notes for UNet / Mirror
The main difference is that you will use the NobleNetworkManager instead of Unity or Mirror's NetworkManager, or the NobleServer and NobleClient instead of Unity's or Mirror's NetworkServer and NetworkClient.
# Note for Netcode for GameObjects
Just make sure to use the NobleUnityTransport and you should be good to go.
# General Notes
The host will not know the address that clients should connect to until it has been assigned by the Noble Connect servers.
You will need to override the OnServerPrepared() method or use the OnServerPreparedCallback to know when this has happened and to get the hostAddress and hostPort (collectively known as the HostEndPoint)
that clients should use to connect to the host. This is generally when you would create a match if you're using a matchmaking system. You can also get
the HostEndPoint address any time after it has been assigned via NobleServer.HostEndPoint or NobleNetworkManager.HostEndPoint or NobleUnityTransport.HostRelayEndPoint
# Regions
By default the closest region will be selected automatically for relays. You can also manually select the region on the NobleNetworkManager or by passing in a GeographicRegion at runtime.
You can see this in any of the example scenes.
We have servers in the following regions:
* US_EAST - New York
* US_WEST - California
* EUROPE - Amsterdam
* AUSTRALIA - Sydney
* HONG_KONG - Hong Kong
* ASIA_PACIFIC - Singapore
* SOUTH_AMERICA - Brazil
* CHINE - China
# How it Works
Punchthrough and relays work according to the [ICE](https://tools.ietf.org/html/rfc5245), [TURN](https://tools.ietf.org/html/rfc5766), and [STUN](https://tools.ietf.org/html/rfc5389) specifications.

View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 662e06548d4295445bb8f66021012d93
timeCreated: 1552034575
licenseType: Store
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7bfb9e592d151107f81c9cf252361404
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,16 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0154c6ffa997c574c9f0f2680c03e82f, type: 3}
m_Name: NobleConnectSettings
m_EditorClassIdentifier:
gameID: NDk4CmxvZ2Fuc2ltaWM0OUBnbWFpbC5jb20KSm1PNGNOenBFKzlIdC9yOE5pUWpLNGJYMmF5eFZ2N0hUYnJYanFuYUQwZnByaWFYQVg0U3h3V2FwSHFsOU1Lam5DOUQvT2tMVkY5UTRqOXFWODVYUkE9PQ==
relayServerPort: 3478

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8fa01c579d9dfd963a234ef28ea80a23
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 219fa3c95fcff0b48a9cdbda02f6ad88
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,2 +0,0 @@
As of 2019.1 if you want to use UNet with Noble Connect you must install the HLAPI package from the Unity package manager
and then extract the "UNet Noble Connect" package to get the examples and scripts.

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 2a9d1538892d0bd418a62bf833d4e344
timeCreated: 1510044594
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: db127a021d5837b4bbd7d64fc0498550
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -207,19 +207,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 586010485}
m_TargetAssemblyTypeName: ServerMenu, Assembly-CSharp
m_MethodName: JoinGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 586010483}
- m_Target: {fileID: 545251048}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_MethodName: SetActive
m_Mode: 6
@ -229,7 +217,7 @@ MonoBehaviour:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_BoolArgument: 1
m_CallState: 2
--- !u!114 &299041672
MonoBehaviour:
@ -463,6 +451,124 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &545251048
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 545251049}
m_Layer: 5
m_Name: ServerButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &545251049
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 545251048}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1155345286}
- {fileID: 2023582111}
m_Father: {fileID: 586010484}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &584631261
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 584631262}
- component: {fileID: 584631264}
- component: {fileID: 584631263}
m_Layer: 5
m_Name: Entry
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &584631262
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584631261}
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: 2023582111}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &584631263
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584631261}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &584631264
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 584631261}
m_CullTransparentMesh: 1
--- !u!1 &586010483
GameObject:
m_ObjectHideFlags: 0
@ -495,6 +601,7 @@ RectTransform:
- {fileID: 732642985}
- {fileID: 1223756954}
- {fileID: 299041670}
- {fileID: 545251049}
m_Father: {fileID: 1732865424}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -515,6 +622,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b21e807f462eb3b3fa7c74eee024ee2d, type: 3}
m_Name:
m_EditorClassIdentifier:
joinTextCode: {fileID: 2023582112}
--- !u!1 &619248189
GameObject:
m_ObjectHideFlags: 0
@ -862,6 +970,166 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 119.883, z: 0}
--- !u!1 &870374057
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 870374058}
- component: {fileID: 870374060}
- component: {fileID: 870374059}
m_Layer: 5
m_Name: Placeholder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &870374058
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 870374057}
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: 2023582111}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &870374059
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 870374057}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Enter code...
--- !u!222 &870374060
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 870374057}
m_CullTransparentMesh: 1
--- !u!1 &1155345285
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1155345286}
- component: {fileID: 1155345288}
- component: {fileID: 1155345287}
m_Layer: 5
m_Name: Text (Legacy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1155345286
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1155345285}
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: 545251049}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.000022888184, y: -56.77793}
m_SizeDelta: {x: 82.29559, y: -41.995193}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1155345287
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1155345285}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 32
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 72
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Join Code:'
--- !u!222 &1155345288
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1155345285}
m_CullTransparentMesh: 1
--- !u!1 &1223756953
GameObject:
m_ObjectHideFlags: 0
@ -1453,6 +1721,165 @@ MonoBehaviour:
PacketDelayMS: 0
PacketJitterMS: 0
PacketDropRate: 0
--- !u!1 &2023582110
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2023582111}
- component: {fileID: 2023582114}
- component: {fileID: 2023582113}
- component: {fileID: 2023582112}
m_Layer: 5
m_Name: JoinCode
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2023582111
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023582110}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 870374058}
- {fileID: 584631262}
m_Father: {fileID: 545251049}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -99.18283}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2023582112
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023582110}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2023582113}
m_TextComponent: {fileID: 584631263}
m_Placeholder: {fileID: 870374059}
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
m_OnSubmit:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 586010485}
m_TargetAssemblyTypeName: ServerMenu, Assembly-CSharp
m_MethodName: ServerJoinButton
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_OnDidEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!114 &2023582113
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023582110}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &2023582114
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2023582110}
m_CullTransparentMesh: 1
--- !u!1 &2108671896
GameObject:
m_ObjectHideFlags: 0

View File

@ -14,9 +14,11 @@ using Unity.Netcode.Transports.UTP;
using Unity.Networking.Transport;
using Unity.Networking.Transport.Relay;
using NetworkEvent = Unity.Networking.Transport.NetworkEvent;
using UnityEngine.UI;
public class ServerMenu : MonoBehaviour
{
private async void Start() {
await UnityServices.InitializeAsync();
@ -48,7 +50,33 @@ public class ServerMenu : MonoBehaviour
}
}
public void JoinGame () {
NetworkManager.Singleton.StartClient();
public InputField joinTextCode;
public void ServerJoinButton()
{
string joinCode = joinTextCode.text;
JoinGame(joinCode);
}
public async Task<string> JoinGame(string joinCode)
{
try
{
Debug.Log("Joining server with: " + joinCode);
JoinAllocation joinAllocation = await RelayService.Instance.JoinAllocationAsync(joinCode);
RelayServerData relayServerData = new RelayServerData(joinAllocation, "dtls");
NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(relayServerData);
NetworkManager.Singleton.StartClient();
return joinCode;
}
catch (RelayServiceException e)
{
Debug.Log(e);
return null;
}
}
}

View File

@ -48,7 +48,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 77
controlID: 28
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
@ -223,7 +223,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 78
controlID: 29
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@ -248,7 +248,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 79
controlID: 30
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
@ -317,21 +317,21 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Scenes
- Assets
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 64
m_LastFolders:
- Assets/Scenes
- Assets/Noble Connect
m_LastFoldersGridSize: -1
m_LastProjectPath: /home/logan/HatGunner
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: ea660000
m_LastClickedID: 26346
m_SelectedIDs: 8c660000
m_LastClickedID: 26252
m_ExpandedIDs: 000000008c66000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
@ -451,7 +451,7 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 0
m_LastVerticalScrollValue: 746.2752
m_GlobalObjectId:
m_InspectorMode: 0
m_LockTracker:
@ -488,9 +488,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 726a0000
m_LastClickedID: 27250
m_ExpandedIDs: bef3ffff12f4ffff82f5ffff88f5ffff38fbffff726a0000b46a0000
m_SelectedIDs: aae5ffff
m_LastClickedID: -6742
m_ExpandedIDs: 5edefffff4dfffffaae5ffff08edffff38fbffffe86500002a660000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -506,7 +506,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 0}
m_ClientGUIView: {fileID: 4}
m_SearchString:
m_ExpandedScenes: []
m_CurrenRootInstanceID: 0
@ -772,9 +772,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 538.4778, y: 250.99454, z: 0}
m_Target: {x: 568.29144, y: 257.84183, z: 3.0044832}
speed: 2
m_Value: {x: 538.4778, y: 250.99454, z: 0}
m_Value: {x: 568.29144, y: 257.84183, z: 3.0044832}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -825,9 +825,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 674.65393
m_Target: 374.20465
speed: 2
m_Value: 674.65393
m_Value: 374.20465
m_Ortho:
m_Target: 1
speed: 2