diff --git a/.yamato/project.metafile b/.yamato/project.metafile index 3d9335725..3030e604d 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -26,4 +26,8 @@ projects: - name: 2dspaceshooter path: Basic/2DSpaceShooter - name: invaders - path: Basic/Invaders \ No newline at end of file + path: Basic/Invaders + - name: clientdriven + path: Basic/ClientDriven + - name: dynamicaddressablesnetworkprefabs + path: Basic/DynamicAddressablesNetworkPrefabs \ No newline at end of file diff --git a/Basic/2DSpaceShooter/Assets/Fonts/chintzy SDF.asset b/Basic/2DSpaceShooter/Assets/Fonts/chintzy SDF.asset index 4cabcfefc..51dc1de6d 100644 --- a/Basic/2DSpaceShooter/Assets/Fonts/chintzy SDF.asset +++ b/Basic/2DSpaceShooter/Assets/Fonts/chintzy SDF.asset @@ -1076,7 +1076,7 @@ MonoBehaviour: m_GlyphIndex: 89 m_Scale: 1 - m_ElementType: 1 - m_Unicode: 45 + m_Unicode: 95 m_GlyphIndex: 14 m_Scale: 1 - m_ElementType: 1 diff --git a/Basic/2DSpaceShooter/Assets/Prefabs/Bullet.prefab b/Basic/2DSpaceShooter/Assets/Prefabs/Bullet.prefab index a263cf092..895cabb0a 100644 --- a/Basic/2DSpaceShooter/Assets/Prefabs/Bullet.prefab +++ b/Basic/2DSpaceShooter/Assets/Prefabs/Bullet.prefab @@ -14,8 +14,6 @@ GameObject: - component: {fileID: 5800000} - component: {fileID: 11400004} - component: {fileID: -4113703611147433057} - - component: {fileID: -2419440837048175228} - - component: {fileID: -7548598001898569089} m_Layer: 0 m_Name: Bullet m_TagString: Untagged @@ -33,6 +31,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 17.05494, y: -1.1583278, z: 0} m_LocalScale: {x: 0.6, y: 0.6, z: 0.6} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 6681543778280045604} - {fileID: 2541587719488337929} @@ -51,6 +50,7 @@ SpriteRenderer: m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 @@ -157,45 +157,6 @@ MonoBehaviour: AlwaysReplicateAsRoot: 0 DontDestroyWithOwner: 0 AutoObjectParentSync: 0 ---- !u!114 &-2419440837048175228 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 100000} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} - m_Name: - m_EditorClassIdentifier: - SyncPositionX: 1 - SyncPositionY: 1 - SyncPositionZ: 1 - SyncRotAngleX: 1 - SyncRotAngleY: 1 - SyncRotAngleZ: 1 - SyncScaleX: 1 - SyncScaleY: 1 - SyncScaleZ: 1 - PositionThreshold: 0.001 - RotAngleThreshold: 0.01 - ScaleThreshold: 0.01 - InLocalSpace: 0 - Interpolate: 1 - CanCommitToTransform: 0 ---- !u!114 &-7548598001898569089 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 100000} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 80d7c879794dfda4687da0e400131852, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1734169577680067239 GameObject: m_ObjectHideFlags: 0 @@ -223,6 +184,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.6666665, y: 1.6666665, z: 1.6666665} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 400000} m_RootOrder: 0 @@ -239,6 +201,7 @@ TrailRenderer: m_CastShadows: 0 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 0 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 @@ -361,6 +324,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.6784176, y: 0.6784176, z: 0.6784176} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 400000} m_RootOrder: 2 @@ -376,6 +340,7 @@ SpriteRenderer: m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 @@ -443,6 +408,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.2764332, y: 1.2764332, z: 1.2764332} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 400000} m_RootOrder: 1 @@ -459,6 +425,7 @@ TrailRenderer: m_CastShadows: 0 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 0 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 diff --git a/Basic/2DSpaceShooter/Assets/Readme.asset b/Basic/2DSpaceShooter/Assets/Readme.asset index 17b605a3b..b59207fc6 100644 --- a/Basic/2DSpaceShooter/Assets/Readme.asset +++ b/Basic/2DSpaceShooter/Assets/Readme.asset @@ -24,7 +24,10 @@ MonoBehaviour: url: https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-spaceshooter/index.html - heading: text: The entry scene for this game is the network scene. From there a game can - be hosted or an existing game can be joined. + be hosted or an existing game can be joined. Control the ship using WASD and + shoot asteroids (or other players!) using the spacebar. Fly over pickups in + the scene to get different temporary buffs for your ship (like increased fly + speed or shooting extra bullets). linkText: url: - heading: diff --git a/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs b/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs index a8bb46c14..ad398c6ed 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/Bullet.cs @@ -38,6 +38,26 @@ private void DestroyBullet() NetworkObject.Despawn(true); } + public void SetVelocity(Vector2 velocity) + { + if (IsServer) + { + var bulletRb = GetComponent(); + bulletRb.velocity = velocity; + SetVelocityClientRpc(velocity); + } + } + + [ClientRpc] + void SetVelocityClientRpc(Vector2 velocity) + { + if (!IsHost) + { + var bulletRb = GetComponent(); + bulletRb.velocity = velocity; + } + } + void OnCollisionEnter2D(Collision2D other) { var otherObject = other.gameObject; diff --git a/Basic/2DSpaceShooter/Assets/Scripts/Powerup.cs b/Basic/2DSpaceShooter/Assets/Scripts/Powerup.cs index 5a1e5a577..ecb84e322 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/Powerup.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/Powerup.cs @@ -61,21 +61,14 @@ public override void OnNetworkSpawn() { OnStartServer(); } - Color buffColor = Buff.buffColors[(int)buffType.Value]; - GetComponent().material.color = buffColor; - m_PowerUpGlow.material.SetColor("_Color", buffColor); - m_PowerUpGlow.material.SetColor("_EmissiveColor", buffColor); - m_PowerUpGlow2.material.SetColor("_Color", buffColor); - m_PowerUpGlow2.material.SetColor("_EmissiveColor", buffColor); - - m_PowerUpLabel.text = buffType.Value.ToString().ToUpper(); - - if (buffType.Value == Buff.BuffType.QuadDamage) - { - m_PowerUpLabel.text = "Quad Damage"; - } - m_PowerUpLabel.style.color = buffColor; + UpdateVisuals(buffType.Value); + buffType.OnValueChanged += OnBuffTypeChanged; + } + + public override void OnNetworkDespawn() + { + buffType.OnValueChanged -= OnBuffTypeChanged; } void OnStartClient() @@ -94,6 +87,30 @@ void OnStartServer() { numPowerUps += 1; } + + void OnBuffTypeChanged(Buff.BuffType previousValue, Buff.BuffType newValue) + { + UpdateVisuals(newValue); + } + + void UpdateVisuals(Buff.BuffType buffType) + { + var buffColor = Buff.buffColors[(int)buffType]; + GetComponent().material.color = buffColor; + m_PowerUpGlow.material.SetColor("_Color", buffColor); + m_PowerUpGlow.material.SetColor("_EmissiveColor", buffColor); + m_PowerUpGlow2.material.SetColor("_Color", buffColor); + m_PowerUpGlow2.material.SetColor("_EmissiveColor", buffColor); + + m_PowerUpLabel.text = buffType.ToString().ToUpper(); + + if (buffType == Buff.BuffType.QuadDamage) + { + m_PowerUpLabel.text = "Quad Damage"; + } + + m_PowerUpLabel.style.color = buffColor; + } void LateUpdate() { diff --git a/Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs b/Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs index 6380417ab..0bc1e338c 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs @@ -196,23 +196,24 @@ void Fire(Vector3 direction) { fireSound.Play(); - int damage = 5; + var damage = 5; if (QuadDamageTimer.Value > NetworkManager.ServerTime.TimeAsFloat) { damage = 20; } - bool bounce = BounceTimer.Value > NetworkManager.ServerTime.TimeAsFloat; + var bounce = BounceTimer.Value > NetworkManager.ServerTime.TimeAsFloat; - GameObject bullet = m_ObjectPool.GetNetworkObject(BulletPrefab).gameObject; - bullet.transform.position = transform.position + direction; + var bulletGo = m_ObjectPool.GetNetworkObject(BulletPrefab).gameObject; + bulletGo.transform.position = transform.position + direction; - var bulletRb = bullet.GetComponent(); var velocity = m_Rigidbody2D.velocity; velocity += (Vector2)(direction) * 10; - bulletRb.velocity = velocity; - bullet.GetComponent().Config(this, damage, bounce, m_BulletLifetime); - bullet.GetComponent().Spawn(true); + bulletGo.GetComponent().Spawn(true); + var bullet = bulletGo.GetComponent(); + bullet.Config(this, damage, bounce, m_BulletLifetime); + bullet.SetVelocity(velocity); + } void Update() diff --git a/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs b/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs index dd344b2df..0bede2154 100644 --- a/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs +++ b/Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs @@ -152,8 +152,8 @@ void Update() GameObject powerUp = m_ObjectPool.GetNetworkObject(m_PowerupPrefab).gameObject; powerUp.transform.position = pos; - powerUp.GetComponent().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last); powerUp.GetComponent().Spawn(true); + powerUp.GetComponent().buffType.Value = (Buff.BuffType)Random.Range(0, (int)Buff.BuffType.Last); } if (Asteroid.numAsteroids == 0) diff --git a/Basic/2DSpaceShooter/Packages/manifest.json b/Basic/2DSpaceShooter/Packages/manifest.json index 2e82c1a55..75095271d 100644 --- a/Basic/2DSpaceShooter/Packages/manifest.json +++ b/Basic/2DSpaceShooter/Packages/manifest.json @@ -1,18 +1,19 @@ { "dependencies": { "com.unity.2d.sprite": "1.0.0", - "com.unity.collab-proxy": "1.17.7", - "com.unity.ide.rider": "3.0.16", - "com.unity.ide.visualstudio": "2.0.16", + "com.unity.collab-proxy": "2.0.0", + "com.unity.ide.rider": "3.0.18", + "com.unity.ide.visualstudio": "2.0.17", "com.unity.ide.vscode": "1.2.5", "com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop", "com.unity.netcode.gameobjects": "1.2.0", "com.unity.postprocessing": "3.2.2", - "com.unity.render-pipelines.universal": "12.1.8", + "com.unity.render-pipelines.universal": "12.1.10", "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.6.4", "com.unity.ugui": "1.0.0", + "com.veriorpies.parrelsync": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync#bb3d5067e49e403d8b8ba15c036d313b4dd2c696", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/Basic/2DSpaceShooter/Packages/packages-lock.json b/Basic/2DSpaceShooter/Packages/packages-lock.json index 48bfe9353..ba77b0e5c 100644 --- a/Basic/2DSpaceShooter/Packages/packages-lock.json +++ b/Basic/2DSpaceShooter/Packages/packages-lock.json @@ -7,7 +7,7 @@ "dependencies": {} }, "com.unity.burst": { - "version": "1.7.3", + "version": "1.8.2", "depth": 1, "source": "registry", "dependencies": { @@ -16,12 +16,10 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "1.17.7", + "version": "2.0.0", "depth": 0, "source": "registry", - "dependencies": { - "com.unity.services.core": "1.0.1" - }, + "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.collections": { @@ -49,7 +47,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.16", + "version": "3.0.18", "depth": 0, "source": "registry", "dependencies": { @@ -58,7 +56,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.16", + "version": "2.0.17", "depth": 0, "source": "registry", "dependencies": { @@ -74,7 +72,7 @@ "url": "https://packages.unity.com" }, "com.unity.learn.iet-framework": { - "version": "2.2.2", + "version": "3.1.1", "depth": 1, "source": "registry", "dependencies": { @@ -156,7 +154,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "12.1.8", + "version": "12.1.10", "depth": 1, "source": "builtin", "dependencies": { @@ -166,14 +164,14 @@ } }, "com.unity.render-pipelines.universal": { - "version": "12.1.8", + "version": "12.1.10", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.7.3", - "com.unity.render-pipelines.core": "12.1.8", - "com.unity.shadergraph": "12.1.8" + "com.unity.burst": "1.8.2", + "com.unity.render-pipelines.core": "12.1.10", + "com.unity.shadergraph": "12.1.10" } }, "com.unity.searcher": { @@ -184,20 +182,20 @@ "url": "https://packages.unity.com" }, "com.unity.services.authentication": { - "version": "2.3.1", + "version": "2.4.0", "depth": 2, "source": "registry", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.services.core": "1.4.3", + "com.unity.services.core": "1.7.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.ugui": "1.0.0" }, "url": "https://packages.unity.com" }, "com.unity.services.core": { - "version": "1.6.0", - "depth": 1, + "version": "1.7.0", + "depth": 2, "source": "registry", "dependencies": { "com.unity.modules.unitywebrequest": "1.0.0", @@ -207,7 +205,7 @@ "url": "https://packages.unity.com" }, "com.unity.services.qos": { - "version": "1.0.1", + "version": "1.1.0", "depth": 2, "source": "registry", "dependencies": { @@ -215,25 +213,25 @@ "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.nuget.newtonsoft-json": "3.0.2", "com.unity.services.authentication": "2.0.0", - "com.unity.collections": "1.2.3" + "com.unity.collections": "1.2.4" }, "url": "https://packages.unity.com" }, "com.unity.services.relay": { - "version": "1.0.3", + "version": "1.0.5", "depth": 1, "source": "registry", "dependencies": { "com.unity.services.core": "1.4.0", "com.unity.services.authentication": "2.0.0", - "com.unity.services.qos": "1.0.1", + "com.unity.services.qos": "1.1.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.transport": "1.0.0" + "com.unity.transport": "1.3.0" }, "url": "https://packages.unity.com" }, @@ -245,11 +243,11 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "12.1.8", + "version": "12.1.10", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "12.1.8", + "com.unity.render-pipelines.core": "12.1.10", "com.unity.searcher": "4.9.1" } }, @@ -286,7 +284,7 @@ "url": "https://packages.unity.com" }, "com.unity.transport": { - "version": "1.3.0", + "version": "1.3.1", "depth": 1, "source": "registry", "dependencies": { @@ -305,6 +303,13 @@ "com.unity.modules.imgui": "1.0.0" } }, + "com.veriorpies.parrelsync": { + "version": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync#bb3d5067e49e403d8b8ba15c036d313b4dd2c696", + "depth": 0, + "source": "git", + "dependencies": {}, + "hash": "bb3d5067e49e403d8b8ba15c036d313b4dd2c696" + }, "com.unity.modules.ai": { "version": "1.0.0", "depth": 0, diff --git a/Basic/2DSpaceShooter/ProjectSettings/ProjectSettings.asset b/Basic/2DSpaceShooter/ProjectSettings/ProjectSettings.asset index 337d93ecc..7436c7f21 100644 --- a/Basic/2DSpaceShooter/ProjectSettings/ProjectSettings.asset +++ b/Basic/2DSpaceShooter/ProjectSettings/ProjectSettings.asset @@ -134,7 +134,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 1.1.0 + bundleVersion: 1.2.0 preloadedAssets: [] metroInputSource: 1 wsaTransparentSwapchain: 0 diff --git a/Basic/2DSpaceShooter/ProjectSettings/ProjectVersion.txt b/Basic/2DSpaceShooter/ProjectSettings/ProjectVersion.txt index eabd63377..61bfe8aab 100644 --- a/Basic/2DSpaceShooter/ProjectSettings/ProjectVersion.txt +++ b/Basic/2DSpaceShooter/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.15f1 -m_EditorVersionWithRevision: 2021.3.15f1 (e8e88683f834) +m_EditorVersion: 2021.3.18f1 +m_EditorVersionWithRevision: 2021.3.18f1 (3129e69bc0c7) diff --git a/Basic/2DSpaceShooter/README.md b/Basic/2DSpaceShooter/README.md index 277278e63..08298e10a 100644 --- a/Basic/2DSpaceShooter/README.md +++ b/Basic/2DSpaceShooter/README.md @@ -1,14 +1,44 @@ -## 2D Space Shooter +![Banner](Resources/spaceshooter_banner.png) +

-This is a UNet sample project converted to Netcode for GameObjects. +# 2D Space Shooter -## Sample Features +![UnityVersion](https://img.shields.io/badge/Unity%20Version:-2021.3%20LTS-57b9d3.svg?logo=unity&color=2196F3) +![NetcodeVersion](https://img.shields.io/badge/Netcode%20Version:-1.2.0-57b9d3.svg?logo=unity&color=2196F3) +[![LatestRelease](https://img.shields.io/badge/Latest%20%20Github%20Release:-v1.2.0-57b9d3.svg?logo=github&color=brightgreen)](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/releases/tag/v1.2.0) +

-This sample shows you: +This is a UNet sample project converted to Netcode for GameObjects. The 2DSpaceShooter sample is a bitesize sample designed to demonstrate networked 2D and physics-based character movement. +

-- Server authorative physics based movement -- Managing health and a list of buffs for your players in a multiplayer game +# Sample Overview + +In this sample, learn more about: + +- Server authorative physics based movement using Netcode for GameObject's `NetworkRigidbody2D` component +- Managing health and a list of buffs for your players in a multiplayer game with a `NetworkVariable` - How to pool network objects such as bullets and asteroids to improve performance +

+--- +### 💡 Documentation +Check out our [Bitesize Samples documentation](https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-introduction) for a more in-depth technical breakdown of our engineering decisions and why the sample works the way it does. + +--- +
+ +## Exploring the Sample + +The entry scene for this game is the network scene. From there a game can be hosted or an existing game can be joined. Control the ship using WASD and shoot asteroids (or other players!) using the spacebar. Fly over pickups in the scene to get different temporary buffs for your ship (like increased fly speed or shooting extra bullets). +

+ + +--- +### 💡 Bitesize Readme +Check out our main [Bitesize Samples GitHub Readme](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize#readme) for more documentation, resources, releases, contribution guidelines, and our feedback form. + +--- +
-## Future Work -- Add a way to assign a player name to each player. \ No newline at end of file +[![Documentation](https://img.shields.io/badge/Unity-bitesize--docs-57b9d3.svg?logo=unity&color=2196F3)](https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-introduction) +[![Forums](https://img.shields.io/badge/Unity-multiplayer--forum-57b9d3.svg?logo=unity&color=2196F3)](https://forum.unity.com/forums/multiplayer.26/) +[![Discord](https://img.shields.io/discord/449263083769036810.svg?label=discord&logo=discord&color=5865F2)](https://discord.gg/FM8SE9E) \ No newline at end of file diff --git a/Basic/2DSpaceShooter/Resources/spaceshooter_banner.png b/Basic/2DSpaceShooter/Resources/spaceshooter_banner.png new file mode 100644 index 000000000..8435b9f76 Binary files /dev/null and b/Basic/2DSpaceShooter/Resources/spaceshooter_banner.png differ diff --git a/Basic/ClientDriven/Assets/Readme.asset b/Basic/ClientDriven/Assets/Readme.asset index c887a327d..f3952e9ea 100644 --- a/Basic/ClientDriven/Assets/Readme.asset +++ b/Basic/ClientDriven/Assets/Readme.asset @@ -26,7 +26,10 @@ MonoBehaviour: url: https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-clientdriven/index.html - heading: text: The entry scene for this game is the Bootstrap scene. From there a game - can be hosted or an existing game can be joined. + can be hosted or an existing game can be joined. Run around the scene using + WASD, and pick up orbs using the spacebar. Convert orbs from one color to another + by dropping them in the converters in the middle of the level. Deposit orbs + into the drop spots of the same color to earn points. linkText: url: - heading: diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG b/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG deleted file mode 100644 index 3e36294e6..000000000 Binary files a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG and /dev/null differ diff --git a/Basic/ClientDriven/Packages/manifest.json b/Basic/ClientDriven/Packages/manifest.json index 10aceeacf..b4ea9b4c2 100644 --- a/Basic/ClientDriven/Packages/manifest.json +++ b/Basic/ClientDriven/Packages/manifest.json @@ -1,14 +1,14 @@ { "dependencies": { "com.unity.cinemachine": "2.8.9", - "com.unity.collab-proxy": "1.17.7", - "com.unity.ide.rider": "3.0.16", - "com.unity.ide.visualstudio": "2.0.16", + "com.unity.collab-proxy": "2.0.0", + "com.unity.ide.rider": "3.0.18", + "com.unity.ide.visualstudio": "2.0.17", "com.unity.ide.vscode": "1.2.5", "com.unity.inputsystem": "1.4.4", "com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop", "com.unity.netcode.gameobjects": "1.2.0", - "com.unity.render-pipelines.universal": "12.1.8", + "com.unity.render-pipelines.universal": "12.1.10", "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.6.4", diff --git a/Basic/ClientDriven/Packages/packages-lock.json b/Basic/ClientDriven/Packages/packages-lock.json index d7b1ef16b..3527b012a 100644 --- a/Basic/ClientDriven/Packages/packages-lock.json +++ b/Basic/ClientDriven/Packages/packages-lock.json @@ -1,7 +1,7 @@ { "dependencies": { "com.unity.burst": { - "version": "1.7.3", + "version": "1.8.2", "depth": 1, "source": "registry", "dependencies": { @@ -19,12 +19,10 @@ "url": "https://packages.unity.com" }, "com.unity.collab-proxy": { - "version": "1.17.7", + "version": "2.0.0", "depth": 0, "source": "registry", - "dependencies": { - "com.unity.services.core": "1.0.1" - }, + "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.collections": { @@ -52,7 +50,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.16", + "version": "3.0.18", "depth": 0, "source": "registry", "dependencies": { @@ -61,7 +59,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.16", + "version": "2.0.17", "depth": 0, "source": "registry", "dependencies": { @@ -86,7 +84,7 @@ "url": "https://packages.unity.com" }, "com.unity.learn.iet-framework": { - "version": "2.2.2", + "version": "3.1.1", "depth": 1, "source": "registry", "dependencies": { @@ -159,7 +157,7 @@ "url": "https://packages.unity.com" }, "com.unity.render-pipelines.core": { - "version": "12.1.8", + "version": "12.1.10", "depth": 1, "source": "builtin", "dependencies": { @@ -169,14 +167,14 @@ } }, "com.unity.render-pipelines.universal": { - "version": "12.1.8", + "version": "12.1.10", "depth": 0, "source": "builtin", "dependencies": { "com.unity.mathematics": "1.2.1", - "com.unity.burst": "1.7.3", - "com.unity.render-pipelines.core": "12.1.8", - "com.unity.shadergraph": "12.1.8" + "com.unity.burst": "1.8.2", + "com.unity.render-pipelines.core": "12.1.10", + "com.unity.shadergraph": "12.1.10" } }, "com.unity.searcher": { @@ -187,20 +185,20 @@ "url": "https://packages.unity.com" }, "com.unity.services.authentication": { - "version": "2.3.1", + "version": "2.4.0", "depth": 2, "source": "registry", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.services.core": "1.4.3", + "com.unity.services.core": "1.7.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.ugui": "1.0.0" }, "url": "https://packages.unity.com" }, "com.unity.services.core": { - "version": "1.6.0", - "depth": 1, + "version": "1.7.0", + "depth": 2, "source": "registry", "dependencies": { "com.unity.modules.unitywebrequest": "1.0.0", @@ -210,7 +208,7 @@ "url": "https://packages.unity.com" }, "com.unity.services.qos": { - "version": "1.0.1", + "version": "1.1.0", "depth": 2, "source": "registry", "dependencies": { @@ -218,25 +216,25 @@ "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.nuget.newtonsoft-json": "3.0.2", "com.unity.services.authentication": "2.0.0", - "com.unity.collections": "1.2.3" + "com.unity.collections": "1.2.4" }, "url": "https://packages.unity.com" }, "com.unity.services.relay": { - "version": "1.0.3", + "version": "1.0.5", "depth": 1, "source": "registry", "dependencies": { "com.unity.services.core": "1.4.0", "com.unity.services.authentication": "2.0.0", - "com.unity.services.qos": "1.0.1", + "com.unity.services.qos": "1.1.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.transport": "1.0.0" + "com.unity.transport": "1.3.0" }, "url": "https://packages.unity.com" }, @@ -248,11 +246,11 @@ "url": "https://packages.unity.com" }, "com.unity.shadergraph": { - "version": "12.1.8", + "version": "12.1.10", "depth": 1, "source": "builtin", "dependencies": { - "com.unity.render-pipelines.core": "12.1.8", + "com.unity.render-pipelines.core": "12.1.10", "com.unity.searcher": "4.9.1" } }, @@ -289,7 +287,7 @@ "url": "https://packages.unity.com" }, "com.unity.transport": { - "version": "1.3.0", + "version": "1.3.1", "depth": 1, "source": "registry", "dependencies": { diff --git a/Basic/ClientDriven/ProjectSettings/ProjectSettings.asset b/Basic/ClientDriven/ProjectSettings/ProjectSettings.asset index 7673ad1be..35c6ddccd 100644 --- a/Basic/ClientDriven/ProjectSettings/ProjectSettings.asset +++ b/Basic/ClientDriven/ProjectSettings/ProjectSettings.asset @@ -134,7 +134,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 1.1.0 + bundleVersion: 1.2.0 preloadedAssets: - {fileID: 11400000, guid: 9e7be553448fa2546aea5752021cbcf7, type: 2} metroInputSource: 0 diff --git a/Basic/ClientDriven/ProjectSettings/ProjectVersion.txt b/Basic/ClientDriven/ProjectSettings/ProjectVersion.txt index eabd63377..61bfe8aab 100644 --- a/Basic/ClientDriven/ProjectSettings/ProjectVersion.txt +++ b/Basic/ClientDriven/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.15f1 -m_EditorVersionWithRevision: 2021.3.15f1 (e8e88683f834) +m_EditorVersion: 2021.3.18f1 +m_EditorVersionWithRevision: 2021.3.18f1 (3129e69bc0c7) diff --git a/Basic/ClientDriven/README.md b/Basic/ClientDriven/README.md index 9f083356a..d7b5d003b 100644 --- a/Basic/ClientDriven/README.md +++ b/Basic/ClientDriven/README.md @@ -1,9 +1,43 @@ +![Banner](Resources/clientdriven_banner.png) +

+ # Client Driven -This is a sample project oriented to Client Driven behaviour using Netcode for GameObjects. In this sample you will learn more about Client driven movements, networked physics, spawning vs statically placed objects, object reparenting +![UnityVersion](https://img.shields.io/badge/Unity%20Version:-2021.3%20LTS-57b9d3.svg?logo=unity&color=2196F3) +![NetcodeVersion](https://img.shields.io/badge/Netcode%20Version:-1.2.0-57b9d3.svg?logo=unity&color=2196F3) +[![LatestRelease](https://img.shields.io/badge/Latest%20%20Github%20Release:-v1.2.0-57b9d3.svg?logo=github&color=brightgreen)](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/releases/tag/v1.2.0) +

+ +The ClientDriven sample is a sample project made with Netcode for GameObjects designed to demonstrate responsive 3rd-person WASD character movements even under unfavourable network conditions. +

+ +# Sample Overview + +In this sample, learn more about: + +- Client driven movements +- Networked physics +- Spawning vs in-scene placed `NetworkObjects` +- `NetworkObject` parenting (client side object detection with server side pickup) +

+--- +### 💡 Documentation +Check out our [Bitesize Samples documentation](https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-introduction) for a more in-depth technical breakdown of our engineering decisions and why the sample works the way it does. + +--- +
+ +## Exploring the Sample +The entry scene for this game is the Bootstrap scene. From there a game can be hosted or an existing game can be joined. Run around the scene using WASD, and pick up orbs using the spacebar. Convert orbs from one color to another by dropping them in the converters in the middle of the level. Deposit orbs into the drop spots of the same color to earn points. +

+ +--- +### 💡 Bitesize Readme +Check out our main [Bitesize Samples GitHub Readme](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize#readme) for more documentation, resources, releases, contribution guidelines, and our feedback form. -## Sample feature +--- +
-Making movements feel responsive while staying consistent over multiple game executables is a challenge for many networked games. ClientDriven's aim is to create a quick sample to show responsive character movements that don't feel sluggish, even under bad network conditions. -It also provides a client side object detection with server side pickup, showing client driven patterns and networked object reparenting. -These physics objects are spawned server side at regular intervals and can be pushed around by client driven players. +[![Documentation](https://img.shields.io/badge/Unity-bitesize--docs-57b9d3.svg?logo=unity&color=2196F3)](https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-introduction) +[![Forums](https://img.shields.io/badge/Unity-multiplayer--forum-57b9d3.svg?logo=unity&color=2196F3)](https://forum.unity.com/forums/multiplayer.26/) +[![Discord](https://img.shields.io/discord/449263083769036810.svg?label=discord&logo=discord&color=5865F2)](https://discord.gg/FM8SE9E) diff --git a/Basic/ClientDriven/Resources/clientdriven_banner.png b/Basic/ClientDriven/Resources/clientdriven_banner.png new file mode 100644 index 000000000..14c53807a Binary files /dev/null and b/Basic/ClientDriven/Resources/clientdriven_banner.png differ diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData.meta similarity index 77% rename from Basic/ClientDriven/Assets/StarterAssets/TutorialInfo.meta rename to Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData.meta index 32cf2dbc4..4f7fc9d9b 100644 --- a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo.meta +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d9b1ba53f81715d4a8405a40b0a1e2c1 +guid: 22077c3838cc042d5b0af5b1c3eb0a25 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset new file mode 100644 index 000000000..dfd58117e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -0,0 +1,105 @@ +%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: 468a46d0ae32c3544b7d98094e6448a9, type: 3} + m_Name: AddressableAssetSettings + m_EditorClassIdentifier: + m_DefaultGroup: ddcc0dd3c2e3149309486ece76cf498a + m_CachedHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_OptimizeCatalogSize: 0 + m_BuildRemoteCatalog: 0 + m_BundleLocalCatalog: 0 + m_CatalogRequestsTimeout: 0 + m_DisableCatalogUpdateOnStart: 0 + m_IgnoreUnsupportedFilesInBuild: 0 + m_UniqueBundleIds: 0 + m_NonRecursiveBuilding: 1 + m_CCDEnabled: 0 + m_maxConcurrentWebRequests: 500 + m_ContiguousBundles: 1 + m_StripUnityVersionFromBundleBuild: 0 + m_DisableVisibleSubAssetRepresentations: 0 + m_ShaderBundleNaming: 0 + m_ShaderBundleCustomNaming: + m_MonoScriptBundleNaming: 0 + m_MonoScriptBundleCustomNaming: + m_RemoteCatalogBuildPath: + m_Id: + m_RemoteCatalogLoadPath: + m_Id: + m_ContentStateBuildPath: + m_BuildAddressablesWithPlayerBuild: 0 + m_overridePlayerVersion: + m_GroupAssets: + - {fileID: 11400000, guid: 4bbc2ada2ba60435f91762231964eb25, type: 2} + - {fileID: 11400000, guid: 897b1409d53154034b6a05860f1e6b4f, type: 2} + m_BuildSettings: + m_CompileScriptsInVirtualMode: 0 + m_CleanupStreamingAssetsAfterBuilds: 1 + m_LogResourceManagerExceptions: 1 + m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles + m_ProfileSettings: + m_Profiles: + - m_InheritedParent: + m_Id: a4b90b0a8cc424e7da02d4d3e55d4c22 + m_ProfileName: Default + m_Values: + - m_Id: 42e357a6791bc4ae1babce0c6d730d4b + m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]' + - m_Id: 33af78b843da944489448f41af32c66a + m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]' + - m_Id: 15a3422a5bd3d437ea3dcecc042cfb31 + m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]' + - m_Id: fe74951be5c66486e92421ce17bda605 + m_Value: ServerData/[BuildTarget] + - m_Id: 16db9ee51233d4dcc93f75ac164266f5 + m_Value: http://[PrivateIpAddress]:[HostingServicePort] + m_ProfileEntryNames: + - m_Id: 42e357a6791bc4ae1babce0c6d730d4b + m_Name: BuildTarget + m_InlineUsage: 0 + - m_Id: 33af78b843da944489448f41af32c66a + m_Name: Local.BuildPath + m_InlineUsage: 0 + - m_Id: 15a3422a5bd3d437ea3dcecc042cfb31 + m_Name: Local.LoadPath + m_InlineUsage: 0 + - m_Id: fe74951be5c66486e92421ce17bda605 + m_Name: Remote.BuildPath + m_InlineUsage: 0 + - m_Id: 16db9ee51233d4dcc93f75ac164266f5 + m_Name: Remote.LoadPath + m_InlineUsage: 0 + m_ProfileVersion: 1 + m_LabelTable: + m_LabelNames: + - default + m_SchemaTemplates: [] + m_GroupTemplateObjects: + - {fileID: 11400000, guid: 91a93decb448d4d51b591a8c15ea2e17, type: 2} + m_InitializationObjects: [] + m_CertificateHandlerType: + m_AssemblyName: + m_ClassName: + m_ActivePlayerDataBuilderIndex: 3 + m_DataBuilders: + - {fileID: 11400000, guid: b3b595ddb85c143cb9ccd245a2bcddc1, type: 2} + - {fileID: 11400000, guid: 2bd2714d617ac48c9961fda53af2ae0f, type: 2} + - {fileID: 11400000, guid: 724d64d7e32614fe89b435597b3d69ca, type: 2} + - {fileID: 11400000, guid: 82d09a1d0170f461b94b084e30c591d3, type: 2} + m_ActiveProfileId: a4b90b0a8cc424e7da02d4d3e55d4c22 + m_HostingServicesManager: + m_HostingServiceInfos: [] + m_Settings: {fileID: 11400000} + m_NextInstanceId: 0 + m_RegisteredServiceTypeRefs: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta new file mode 100644 index 000000000..3f74437ed --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AddressableAssetSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eba030a8967cd41c2b351a2d35a779c2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates.meta similarity index 77% rename from Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons.meta rename to Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates.meta index 1cf0f7df1..406e98ec2 100644 --- a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons.meta +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bf2b09552ecf8f04294975e07f8da67e +guid: f67dd2e1c31f34f0b8df2d861b8e194d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset new file mode 100644 index 000000000..44ae5fa72 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2333981389699923654 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: + m_ClassName: + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: + m_LoadPath: + m_Id: + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: + m_ClassName: + m_BundleNaming: 0 + m_AssetLoadMode: 0 +--- !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: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3} + m_Name: Packed Assets + m_EditorClassIdentifier: + m_SchemaObjects: + - {fileID: -2333981389699923654} + - {fileID: 8439535091112053196} + m_Description: Pack assets into asset bundles. + m_Settings: {fileID: 0} +--- !u!114 &8439535091112053196 +MonoBehaviour: + m_ObjectHideFlags: 1 + 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: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 0} + m_StaticContent: 0 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta new file mode 100644 index 000000000..0bd0432ec --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroupTemplates/Packed Assets.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91a93decb448d4d51b591a8c15ea2e17 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups.meta new file mode 100644 index 000000000..fb191e397 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ffdd67184ceac428b9e79d0a82621b5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset new file mode 100644 index 000000000..0a42ec69e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset @@ -0,0 +1,32 @@ +%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: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Built In Data + m_EditorClassIdentifier: + m_GroupName: Built In Data + m_Data: + m_SerializedData: [] + m_GUID: 78ca99454d75a4cf8ab1b4919d288a3d + m_SerializeEntries: + - m_GUID: Resources + m_Address: Resources + m_ReadOnly: 1 + m_SerializedLabels: [] + - m_GUID: EditorSceneList + m_Address: EditorSceneList + m_ReadOnly: 1 + m_SerializedLabels: [] + m_ReadOnly: 1 + m_Settings: {fileID: 11400000, guid: eba030a8967cd41c2b351a2d35a779c2, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: 65678e9ce7646493db44859d98c363ec, type: 2} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset.meta new file mode 100644 index 000000000..0a00917da --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bbc2ada2ba60435f91762231964eb25 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset new file mode 100644 index 000000000..87ab080a2 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -0,0 +1,53 @@ +%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: bbb281ee3bf0b054c82ac2347e9e782c, type: 3} + m_Name: Default Local Group + m_EditorClassIdentifier: + m_GroupName: Default Local Group + m_Data: + m_SerializedData: [] + m_GUID: ddcc0dd3c2e3149309486ece76cf498a + m_SerializeEntries: + - m_GUID: e8635bd8fc0fa44f7ba16885494477e4 + m_Address: DynamicPrefabTest 7 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: 580f343244c5d495aa8df840a4ef1050 + m_Address: DynamicPrefabTest 6 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: df2e29fad7ea5480ebbd89c15ffe415e + m_Address: DynamicPrefabTest 4 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: a4d5ae4542ecc49f5b2e96f39e93c0c4 + m_Address: DynamicPrefabTest 3 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: 86d863718b86d4ae69be9e4e22feceb6 + m_Address: DynamicPrefabTest 2 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: 75a53913d13db4777b0d97d1c009b6b2 + m_Address: DynamicPrefabTest 1 + m_ReadOnly: 0 + m_SerializedLabels: [] + - m_GUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_Address: DynamicPrefabTest + m_ReadOnly: 0 + m_SerializedLabels: [] + m_ReadOnly: 0 + m_Settings: {fileID: 11400000, guid: eba030a8967cd41c2b351a2d35a779c2, type: 2} + m_SchemaSet: + m_Schemas: + - {fileID: 11400000, guid: c6e1543797fc94e248c1d3797ef45dd0, type: 2} + - {fileID: 11400000, guid: c99a9e8cb460a45128d179fca741744a, type: 2} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta new file mode 100644 index 000000000..0b2c9136d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 897b1409d53154034b6a05860f1e6b4f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas.meta new file mode 100644 index 000000000..b2d843b0c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e93d5d8cd2cdb4bb5a65d70190223fe3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset new file mode 100644 index 000000000..2d4d4e8a7 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset @@ -0,0 +1,17 @@ +%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: b1487f5d688e4f94f828f879d599dbdc, type: 3} + m_Name: Built In Data_PlayerDataGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 4bbc2ada2ba60435f91762231964eb25, type: 2} + m_IncludeResourcesFolders: 1 + m_IncludeBuildSettingsScenes: 1 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta new file mode 100644 index 000000000..1dcbc7acd --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65678e9ce7646493db44859d98c363ec +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset new file mode 100644 index 000000000..b3fe9585f --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset @@ -0,0 +1,45 @@ +%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: e5d17a21594effb4e9591490b009e7aa, type: 3} + m_Name: Default Local Group_BundledAssetGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 897b1409d53154034b6a05860f1e6b4f, type: 2} + m_InternalBundleIdMode: 1 + m_Compression: 1 + m_IncludeAddressInCatalog: 1 + m_IncludeGUIDInCatalog: 1 + m_IncludeLabelsInCatalog: 1 + m_InternalIdNamingMode: 0 + m_CacheClearBehavior: 0 + m_IncludeInBuild: 1 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_ForceUniqueProvider: 0 + m_UseAssetBundleCache: 1 + m_UseAssetBundleCrc: 1 + m_UseAssetBundleCrcForCachedBundles: 1 + m_UseUWRForLocalBundles: 0 + m_Timeout: 0 + m_ChunkedTransfer: 0 + m_RedirectLimit: -1 + m_RetryCount: 0 + m_BuildPath: + m_Id: 33af78b843da944489448f41af32c66a + m_LoadPath: + m_Id: 15a3422a5bd3d437ea3dcecc042cfb31 + m_BundleMode: 0 + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider + m_BundleNaming: 0 + m_AssetLoadMode: 0 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta new file mode 100644 index 000000000..8522ddc29 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_BundledAssetGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c99a9e8cb460a45128d179fca741744a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset new file mode 100644 index 000000000..edccb566e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset @@ -0,0 +1,16 @@ +%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: 5834b5087d578d24c926ce20cd31e6d6, type: 3} + m_Name: Default Local Group_ContentUpdateGroupSchema + m_EditorClassIdentifier: + m_Group: {fileID: 11400000, guid: 897b1409d53154034b6a05860f1e6b4f, type: 2} + m_StaticContent: 0 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta new file mode 100644 index 000000000..5260fc17f --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/AssetGroups/Schemas/Default Local Group_ContentUpdateGroupSchema.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6e1543797fc94e248c1d3797ef45dd0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders.meta new file mode 100644 index 000000000..aba6242c8 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b25ac81636d0f4d4da00b12e24972a6b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset new file mode 100644 index 000000000..50d30dc58 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset @@ -0,0 +1,20 @@ +%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: 88d21199f5d473f4db36845f2318f180, type: 3} + m_Name: BuildScriptFastMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta new file mode 100644 index 000000000..1d6eb21d6 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptFastMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3b595ddb85c143cb9ccd245a2bcddc1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset new file mode 100644 index 000000000..ec875f943 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset @@ -0,0 +1,20 @@ +%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: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3} + m_Name: BuildScriptPackedMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta new file mode 100644 index 000000000..78f1ed39b --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82d09a1d0170f461b94b084e30c591d3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset new file mode 100644 index 000000000..762884519 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset @@ -0,0 +1,20 @@ +%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: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3} + m_Name: BuildScriptPackedPlayMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta new file mode 100644 index 000000000..9269bf1f9 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptPackedPlayMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 724d64d7e32614fe89b435597b3d69ca +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset new file mode 100644 index 000000000..dfb2d5825 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset @@ -0,0 +1,20 @@ +%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: bb0e4994b34add1409fd8ccaf4a82de5, type: 3} + m_Name: BuildScriptVirtualMode + m_EditorClassIdentifier: + instanceProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider + sceneProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta new file mode 100644 index 000000000..d253a8842 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DataBuilders/BuildScriptVirtualMode.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2bd2714d617ac48c9961fda53af2ae0f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset new file mode 100644 index 000000000..0f60864bb --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset @@ -0,0 +1,15 @@ +%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: 3a189bb168d8d90478a09ea08c2f3d72, type: 3} + m_Name: DefaultObject + m_EditorClassIdentifier: + m_AddressableAssetSettingsGuid: eba030a8967cd41c2b351a2d35a779c2 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset.meta new file mode 100644 index 000000000..0471f204e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/AddressableAssetsData/DefaultObject.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1ddf61b298f54d599a3d954101e1b69 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials.meta new file mode 100644 index 000000000..2bb87567e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9507bc1f53145084eb7efab80c4dcc22 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat new file mode 100644 index 000000000..2d4e5966f --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blue + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.30400002, g: 0.4315999, b: 1, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat.meta new file mode 100644 index 000000000..0a5ca0c9e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Blue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2eb4870b74dc4280815e4f295b427d4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat new file mode 100644 index 000000000..5e2f50421 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Cyan + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.31800002, g: 0.906392, b: 1, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat.meta new file mode 100644 index 000000000..d89b1ada7 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Cyan.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18ff04bb8dcf54245aac49b8bff16123 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat new file mode 100644 index 000000000..29c7399c5 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Green + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.31800002, g: 1, b: 0.34207055, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat.meta new file mode 100644 index 000000000..c756bc849 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Green.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6e216a5f524b4422b6fcac409747221 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat new file mode 100644 index 000000000..4d179bb2e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grey + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.18867922, g: 0.18867922, b: 0.18867922, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat.meta new file mode 100644 index 000000000..b48335303 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Grey.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cbd04cf18f48f40a3adc1b755bb182fc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat new file mode 100644 index 000000000..311f53e78 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Magenta + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0.36799997, b: 0.9578667, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat.meta new file mode 100644 index 000000000..f4150322d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Magenta.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a78e36738c42416aaf2569d7c0a4a36 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat new file mode 100644 index 000000000..60749dbd3 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Red + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0.148, b: 0.16470604, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat.meta new file mode 100644 index 000000000..79b5294c4 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Red.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a13e1944c4fc4105a58f40db84fde97 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat new file mode 100644 index 000000000..e92989975 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Yellow + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: + - _EMISSION + m_InvalidKeywords: [] + m_LightmapFlags: 2 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0.91423535, b: 0.19, a: 1} + - _EmissionColor: {r: 0.076160006, g: 0.076160006, b: 0.128, a: 1} + m_BuildTextureStacks: [] diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat.meta new file mode 100644 index 000000000..9b7fe23e7 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Materials/Yellow.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3db0ddc3e34e144fe8ef657ef935c0b0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs.meta new file mode 100644 index 000000000..0c29b4630 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33b444a8328b04438947d485732011da +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab new file mode 100644 index 000000000..879860726 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab @@ -0,0 +1,50 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5737377586247081931 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3432682422254998110} + - component: {fileID: -4564065145618460974} + m_Layer: 0 + m_Name: ConnectionManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3432682422254998110 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5737377586247081931} + 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!114 &-4564065145618460974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5737377586247081931} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: + networkManager: {fileID: 0} + maxConnectedPlayers: 4 + connectAddress: + port: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab.meta new file mode 100644 index 000000000..b1a8e88d6 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/ConnectionManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 778b8b3b1127f7f45a2b7f632070b792 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab new file mode 100644 index 000000000..d518b5c88 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab @@ -0,0 +1,96 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4320737046193768508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4320737046193768510} + - component: {fileID: 4320737046193768511} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4320737046193768510 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4320737046193768508} + m_LocalRotation: {x: 0.4214967, y: -0.06598225, z: 0.030768152, w: 0.9039028} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -8.35, z: 0} +--- !u!108 &4320737046193768511 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4320737046193768508} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab.meta new file mode 100644 index 000000000..a862448c9 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Directional Light.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3732511884c29b1468473f76f4161b35 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab new file mode 100644 index 000000000..114e3da89 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &9192980064803986540 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9192980064803986537} + - component: {fileID: 9192980064803986542} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9192980064803986537 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9192980064803986540} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -20} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &9192980064803986542 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9192980064803986540} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.05, g: 0.05, b: 0.05, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 30 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab.meta new file mode 100644 index 000000000..063dec5dc --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/Main Camera.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bd3e10498a229a84bb341cff1e33f20c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs.meta new file mode 100644 index 000000000..c0bec9ce3 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7ceca2a7df31de42a0db369d37f9c2e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab new file mode 100644 index 000000000..69c504565 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: BluePrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a2eb4870b74dc4280815e4f295b427d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab.meta new file mode 100644 index 000000000..318391ae2 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/BluePrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a4d5ae4542ecc49f5b2e96f39e93c0c4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab new file mode 100644 index 000000000..5e7d21b99 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: CyanPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 18ff04bb8dcf54245aac49b8bff16123, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab.meta new file mode 100644 index 000000000..5d18190cb --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/CyanPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 580f343244c5d495aa8df840a4ef1050 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab new file mode 100644 index 000000000..0cae94742 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: GrayPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: cbd04cf18f48f40a3adc1b755bb182fc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab.meta new file mode 100644 index 000000000..81f388d0e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GrayPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 05ea0814e604c4acf8ae3b7e0a5dfb07 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab new file mode 100644 index 000000000..14dd5a52e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: GreenPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c6e216a5f524b4422b6fcac409747221, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab.meta new file mode 100644 index 000000000..bd1ab0270 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/GreenPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e8635bd8fc0fa44f7ba16885494477e4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab new file mode 100644 index 000000000..aa6ceb4e1 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: MagentaPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a78e36738c42416aaf2569d7c0a4a36, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab.meta new file mode 100644 index 000000000..bb4b7f747 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/MagentaPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 75a53913d13db4777b0d97d1c009b6b2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab new file mode 100644 index 000000000..8bc33508d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: RedPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2a13e1944c4fc4105a58f40db84fde97, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab.meta new file mode 100644 index 000000000..0c3f0ac12 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/RedPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 86d863718b86d4ae69be9e4e22feceb6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab new file mode 100644 index 000000000..aa7578012 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2002272676026143831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3105858385568892332} + - component: {fileID: 1618708695352556688} + - component: {fileID: 1618708695352556687} + m_Layer: 0 + m_Name: YellowPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3105858385568892332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + 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: 6047369245460250749} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1618708695352556688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 951099334 + AlwaysReplicateAsRoot: 1 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &1618708695352556687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2002272676026143831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3} + m_Name: + m_EditorClassIdentifier: + SyncPositionX: 1 + SyncPositionY: 1 + SyncPositionZ: 1 + SyncRotAngleX: 1 + SyncRotAngleY: 1 + SyncRotAngleZ: 1 + SyncScaleX: 1 + SyncScaleY: 1 + SyncScaleZ: 1 + PositionThreshold: 0.001 + RotAngleThreshold: 0.01 + ScaleThreshold: 0.01 + InLocalSpace: 0 + Interpolate: 1 +--- !u!1 &6169323490332737807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6047369245460250749} + - component: {fileID: 7951404474696023296} + - component: {fileID: 8970186281398297407} + m_Layer: 0 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6047369245460250749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3105858385568892332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7951404474696023296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8970186281398297407 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169323490332737807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3db0ddc3e34e144fe8ef657ef935c0b0, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab.meta new file mode 100644 index 000000000..96acfa6d6 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/SpawnedPrefabs/YellowPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: df2e29fad7ea5480ebbd89c15ffe415e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab new file mode 100644 index 000000000..ce7583f62 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab @@ -0,0 +1,267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4061078000728451377 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4484396944538767948} + - component: {fileID: 1868617790277435607} + m_Layer: 0 + m_Name: ConnectionType + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4484396944538767948 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4061078000728451377} + 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: 5916229021262027593} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1868617790277435607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4061078000728451377} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: c023b7db6d50c9e45b6a080ccc23874f, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 720681dc71c9789408a1fab0f21e0f93, type: 3} + m_SortingOrder: 1 +--- !u!1 &5916229021262027592 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5916229021262027593} + - component: {fileID: 1216736892} + - component: {fileID: 1085470603439750153} + m_Layer: 0 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5916229021262027593 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229021262027592} + 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: 5916229021887624318} + - {fileID: 5916229022476518943} + - {fileID: 5916229022061089010} + - {fileID: 4484396944538767948} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1216736892 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229021262027592} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ConnectionsUIDoc: {fileID: 5916229021887624317} + m_InGameUIDoc: {fileID: 5916229022476518942} + m_ConnectionTemplatePrefab: {fileID: 9197481963319205126, guid: 559dc6bda8f869d4b828b29a963e1e89, type: 3} + m_RowTemplatePrefab: {fileID: 9197481963319205126, guid: e61c0a6ba4a28444da358d17a074172f, type: 3} + m_ShowArtificialDelaySlider: -1 + m_ShowNetworkSpawnTimeoutSlider: 1 + m_ShowApiControls: 1 + m_ShowLoadAllAsyncButton: 1 + m_ShowTrySpawnSynchronouslyButton: 1 + m_ShowSpawnUsingVisibilityButton: 1 +--- !u!114 &1085470603439750153 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229021262027592} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IPMenuUIDocument: {fileID: 5916229022061089011} + m_ConnectionTypeUIDocument: {fileID: 1868617790277435607} +--- !u!1 &5916229021887624316 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5916229021887624318} + - component: {fileID: 5916229021887624317} + m_Layer: 0 + m_Name: Connections + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5916229021887624318 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229021887624316} + 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: 5916229021262027593} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5916229021887624317 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229021887624316} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: c023b7db6d50c9e45b6a080ccc23874f, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: aa2f8502baa527549a2a096d7db99736, type: 3} + m_SortingOrder: 1 +--- !u!1 &5916229022061089009 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5916229022061089010} + - component: {fileID: 5916229022061089011} + m_Layer: 0 + m_Name: IPMenu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5916229022061089010 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229022061089009} + 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: 5916229021262027593} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5916229022061089011 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229022061089009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: c023b7db6d50c9e45b6a080ccc23874f, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: f34559e6fa10dd7498466b9da1869b6d, type: 3} + m_SortingOrder: 0 +--- !u!1 &5916229022476518941 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5916229022476518943} + - component: {fileID: 5916229022476518942} + m_Layer: 0 + m_Name: InGameUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5916229022476518943 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229022476518941} + 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: 5916229021262027593} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5916229022476518942 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5916229022476518941} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: c023b7db6d50c9e45b6a080ccc23874f, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 16051812210b8ab4bb7c93577ca1410b, type: 3} + m_SortingOrder: 1 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab.meta new file mode 100644 index 000000000..a6a1ff2a3 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Prefabs/UI.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: efffbf0d4e88eee4c8782180ff1ce1a2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset new file mode 100644 index 000000000..27516e74a --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset @@ -0,0 +1,83 @@ +%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: 5ce0e387261ddc34ba81ca7f2f1f7f73, type: 3} + m_Name: Readme + m_EditorClassIdentifier: + icon: {fileID: 2800000, guid: 06a678a9706d69242bc9e034adc27168, type: 3} + title: 'Dynamic Prefabs: A Bitesize Sample' + sections: + - heading: + text: + linkText: + url: + - heading: 'Exploring the Sample:' + text: + linkText: + url: + - heading: + text: 'The Dynamic Prefabs sample showcases the available use-cases for the dynamic + prefab system, which allows us to add new spawnable prefabs at runtime. ' + linkText: + url: + - heading: + text: Each scene in the project showcases a different, isolated feature of the + API, allowing for easy extraction into other projects. We suggest exploring + them in sequential order to get an understanding of the flow of dynamically + loading and spawning network prefabs. + linkText: + url: + - heading: + text: Scenes 00-04 showcase example use-cases for the Dynamic Prefabs system, + and scene 05 serves as an API playground to test how all of the use-cases in + can work tandem. Please see our code comments for implemetation details on + each use-case. + linkText: + url: + - heading: ' ' + text: + linkText: + url: + - heading: + text: This sample also uses in-game UI (created using UI Toolkit) to interface + with the dynamic prefabs system with configurable options like artificial latency + and network spawn timeout for easy testing. + linkText: + url: + - heading: ' ' + text: + linkText: + url: + - heading: 'To Learn More:' + text: + linkText: + url: + - heading: + text: For more information about this bitesize sample, check out the + linkText: Dynamic Prefabs bitesize sample documentation, + url: https://docs-multiplayer.unity3d.com/netcode/current/learn/bitesize/bitesize-dynamicprefabs/index.html + - heading: + text: 'as well as the GitHub repo Readme from the ' + linkText: Bitesize Samples public GitHub repository. + url: https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize + - heading: + text: Read more about Netcode and its built-in features from the + linkText: Netcode documentation. + url: https://docs-multiplayer.unity3d.com/ + - heading: ' ' + text: + linkText: + url: + - heading: + text: Also, check out our + linkText: Multiplayer Discord! + url: https://discord.gg/FM8SE9E + loadedLayout: 1 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset.meta new file mode 100644 index 000000000..b03b53044 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Readme.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9dc759e946e7974a9c7d423ecfea830 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes.meta new file mode 100644 index 000000000..83c741b22 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ea315d0fd7389c41b19996891e99ae3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity new file mode 100644 index 000000000..31eeb0693 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity @@ -0,0 +1,575 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &284569498 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 1199602851} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424450} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &989424450 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8c82d08ffbd524a6799d466e7997b6a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DynamicPrefabReference: + m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_NetworkManager: {fileID: 2054638265} +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 284569498} + m_IPMenuUI: {fileID: 2126407233} + m_InGameUI: {fileID: 2126407234} +--- !u!1001 &1199602851 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1001 &1330159501 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!1001 &1611465026 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowApiControls + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowLoadAllAsyncButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowArtificialDelaySlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowNetworkSpawnTimeoutSlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowSpawnUsingVisibilityButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowTrySpawnSynchronouslyButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 0 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2063526821 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!114 &2126407233 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 1611465026} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &2126407234 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 1611465026} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity.meta new file mode 100644 index 000000000..952bd1e9e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/00_Preloading Dynamic Prefabs.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9fc0d4010bbf28b4594072e72b8655ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity new file mode 100644 index 000000000..f715a018e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity @@ -0,0 +1,601 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &148847504 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!1001 &268667588 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!114 &320186046 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 1759026482} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424453} + - component: {fileID: 989424454} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 3392392990 + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &989424453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 320186046} + m_IPMenuUI: {fileID: 2080964977} + m_InGameUI: {fileID: 2080964978} +--- !u!114 &989424454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 46115653413e2ed4c9163c4e5350e569, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_AssetReferenceGameObject: + m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_InGameUI: {fileID: 2080964978} +--- !u!1001 &1759026482 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: networkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: dynamicPrefabManager + value: + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 1 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2080964976 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowApiControls + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowLoadAllAsyncButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowArtificialDelaySlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowNetworkSpawnTimeoutSlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowSpawnUsingVisibilityButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowTrySpawnSynchronouslyButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!114 &2080964977 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 2080964976} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &2080964978 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 2080964976} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity.meta new file mode 100644 index 000000000..382152a3b --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/01_Connection Approval Required For Late Joining.unity.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7b6923b024b9f56478b4080b24977311 +timeCreated: 1666715239 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity new file mode 100644 index 000000000..2be1d4b7a --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity @@ -0,0 +1,609 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &91789800 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: networkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1001 &289951353 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!1001 &465179654 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowNetworkSpawnTimeoutSlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowSpawnUsingVisibilityButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowTrySpawnSynchronouslyButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!114 &465179655 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 465179654} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &465179656 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 465179654} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &819111534 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 91789800} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &822146312 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424453} + - component: {fileID: 989424454} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 3033738229 + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &989424453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 819111534} + m_IPMenuUI: {fileID: 465179655} + m_InGameUI: {fileID: 465179656} +--- !u!114 &989424454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dfcd3408d3cf98c41a414b4f63e473fc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_DynamicPrefabReferences: + - m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 75a53913d13db4777b0d97d1c009b6b2 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 86d863718b86d4ae69be9e4e22feceb6 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: a4d5ae4542ecc49f5b2e96f39e93c0c4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: df2e29fad7ea5480ebbd89c15ffe415e + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 580f343244c5d495aa8df840a4ef1050 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: e8635bd8fc0fa44f7ba16885494477e4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_InGameUI: {fileID: 465179656} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 0 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity.meta new file mode 100644 index 000000000..966c2827b --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/02_Server Authoritative Preload All Prefabs Asynchronously.unity.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a4b10a79c91b64ba4863188ca77f36e8 +timeCreated: 1666715239 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity new file mode 100644 index 000000000..777fe58ed --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity @@ -0,0 +1,609 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &188886738 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!114 &320186046 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 1759026482} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424453} + - component: {fileID: 989424454} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 1707886193 + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &989424453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 320186046} + m_IPMenuUI: {fileID: 1254918731} + m_InGameUI: {fileID: 1254918732} +--- !u!114 &989424454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f128f9485fb85914989ea62eb4ca46c6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_DynamicPrefabReferences: + - m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 75a53913d13db4777b0d97d1c009b6b2 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 86d863718b86d4ae69be9e4e22feceb6 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: a4d5ae4542ecc49f5b2e96f39e93c0c4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: df2e29fad7ea5480ebbd89c15ffe415e + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 580f343244c5d495aa8df840a4ef1050 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: e8635bd8fc0fa44f7ba16885494477e4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_InGameUI: {fileID: 1254918732} +--- !u!1001 &1189774028 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!1001 &1254918730 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowLoadAllAsyncButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowSpawnUsingVisibilityButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!114 &1254918731 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 1254918730} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1254918732 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 1254918730} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1759026482 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: networkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: dynamicPrefabManager + value: + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 1 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity.meta new file mode 100644 index 000000000..0f348e8be --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/03_Server Authoritative Try Spawn Synchronously.unity.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4be06c926fab45343a99eec4b150b830 +timeCreated: 1666715239 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity new file mode 100644 index 000000000..58870fa68 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity @@ -0,0 +1,613 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &154419167 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowLoadAllAsyncButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowNetworkSpawnTimeoutSlider + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_ShowTrySpawnSynchronouslyButton + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!114 &154419168 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 154419167} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &154419169 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 154419167} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &320186046 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 1759026482} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424453} + - component: {fileID: 989424454} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 571851207 + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &989424453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 320186046} + m_IPMenuUI: {fileID: 154419168} + m_InGameUI: {fileID: 154419169} +--- !u!114 &989424454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a695c6b1fd4ab594e875d5dea4cc9fae, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_DynamicPrefabReferences: + - m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 75a53913d13db4777b0d97d1c009b6b2 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 86d863718b86d4ae69be9e4e22feceb6 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: a4d5ae4542ecc49f5b2e96f39e93c0c4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: df2e29fad7ea5480ebbd89c15ffe415e + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 580f343244c5d495aa8df840a4ef1050 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: e8635bd8fc0fa44f7ba16885494477e4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_InGameUI: {fileID: 154419169} +--- !u!1001 &1654418545 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!1001 &1753552740 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!1001 &1759026482 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: networkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: dynamicPrefabManager + value: + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 0 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity.meta new file mode 100644 index 000000000..41467a5fe --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/04_Server Authoritative Spawn Dynamic Prefab Using Network Visibility.unity.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a081f6a35639f4949bd9d20f656cb357 +timeCreated: 1666715239 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity new file mode 100644 index 000000000..a4c49bfea --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity @@ -0,0 +1,605 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657576, g: 0.49641198, b: 0.57481617, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &320186046 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + m_PrefabInstance: {fileID: 1759026482} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1d33480f8492cae4ea5d133f701bc398, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &989424449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 989424451} + - component: {fileID: 989424452} + - component: {fileID: 989424453} + - component: {fileID: 989424454} + m_Layer: 0 + m_Name: AppController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &989424451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + 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!114 &989424452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + GlobalObjectIdHash: 2152691048 + AlwaysReplicateAsRoot: 0 + DontDestroyWithOwner: 0 + AutoObjectParentSync: 1 +--- !u!114 &989424453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5dd989004df436d9e1f8777007d25a5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_ConnectionManager: {fileID: 320186046} + m_IPMenuUI: {fileID: 994065491} + m_InGameUI: {fileID: 994065490} +--- !u!114 &989424454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989424449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 06f0d49321026254cbd9420e0a8a1f38, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NetworkManager: {fileID: 2054638265} + m_DynamicPrefabReferences: + - m_AssetGUID: 05ea0814e604c4acf8ae3b7e0a5dfb07 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 75a53913d13db4777b0d97d1c009b6b2 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 86d863718b86d4ae69be9e4e22feceb6 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: a4d5ae4542ecc49f5b2e96f39e93c0c4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: df2e29fad7ea5480ebbd89c15ffe415e + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: 580f343244c5d495aa8df840a4ef1050 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + - m_AssetGUID: e8635bd8fc0fa44f7ba16885494477e4 + m_SubObjectName: + m_SubObjectType: + m_EditorAssetChanged: 0 + m_InGameUI: {fileID: 994065490} +--- !u!1001 &994065489 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: showArtificialDelay + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027592, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5916229021262027593, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} +--- !u!114 &994065490 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1216736892, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 994065489} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c1ed03cc3b245b4ca88b95ef9bea14e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &994065491 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 1085470603439750153, guid: efffbf0d4e88eee4c8782180ff1ce1a2, type: 3} + m_PrefabInstance: {fileID: 994065489} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ada9189cf150a904bb8090bcb9e80a6c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1004879451 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4320737046193768508, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_Name + value: Directional Light + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.y + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9039028 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.x + value: 0.4214967 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.y + value: -0.06598225 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalRotation.z + value: 0.030768152 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.35 + objectReference: {fileID: 0} + - target: {fileID: 4320737046193768510, guid: 3732511884c29b1468473f76f4161b35, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3732511884c29b1468473f76f4161b35, type: 3} +--- !u!1001 &1116426201 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalPosition.z + value: -20 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986537, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9192980064803986540, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bd3e10498a229a84bb341cff1e33f20c, type: 3} +--- !u!1001 &1759026482 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: networkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_NetworkManager + value: + objectReference: {fileID: 2054638265} + - target: {fileID: -4564065145618460974, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: dynamicPrefabManager + value: + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3432682422254998110, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5737377586247081931, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} + propertyPath: m_Name + value: ConnectionManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 778b8b3b1127f7f45a2b7f632070b792, type: 3} +--- !u!1 &2054638263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2054638266} + - component: {fileID: 2054638265} + - component: {fileID: 2054638264} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2054638264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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 &2054638265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3} + m_Name: + m_EditorClassIdentifier: + RunInBackground: 1 + LogLevel: 1 + NetworkConfig: + ProtocolVersion: 0 + NetworkTransport: {fileID: 2054638264} + PlayerPrefab: {fileID: 0} + NetworkPrefabs: [] + TickRate: 30 + ClientConnectionBufferTimeout: 10 + ConnectionApproval: 1 + ConnectionData: + EnableTimeResync: 0 + TimeResyncInterval: 30 + EnsureNetworkVariableLengthSafety: 0 + EnableSceneManagement: 1 + ForceSamePrefabs: 1 + RecycleNetworkIds: 1 + NetworkIdRecycleDelay: 120 + RpcHashSize: 0 + LoadSceneTimeOut: 120 + SpawnTimeout: 1 + EnableNetworkLogs: 1 +--- !u!4 &2054638266 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2054638263} + 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: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity.meta new file mode 100644 index 000000000..2ae9849c0 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scenes/05_API Playground Showcasing All Post-Connection Use-Cases.unity.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7abfc934ee13b5a4cb68dfd571ecb4c6 +timeCreated: 1666715239 \ No newline at end of file diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts.meta similarity index 77% rename from Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts.meta rename to Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts.meta index 30786fad7..08e91b8b1 100644 --- a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts.meta +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 00e1a3ea601874740b954664a078e551 +guid: 433f39aaea1224b9aaa3a65b8f32cc43 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading.meta new file mode 100644 index 000000000..0dcc46484 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ff7f41903c874c7cafc2e967fb48930 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs new file mode 100644 index 000000000..bceb33eed --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs @@ -0,0 +1,58 @@ +using System; +using System.Threading.Tasks; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace Game.Preloading +{ + /// + /// This is the simplest case of a dynamic prefab - we instruct all game instances to load a network prefab (it can + /// be just one, it could also be a set of network prefabs) and inject them to NetworkManager's NetworkPrefabs list + /// before starting the server. What's important is that it doesn't really matter where the prefab comes from. It + /// could be a simple prefab or it could be an Addressable - it's all the same. + /// + /// + /// Here, we're serializing the AssetReferenceGameObject to this class, but ideally you'd want to authenticate + /// players when your game starts up and have them fetch network prefabs from services such as UGS (see Remote + /// Config). It should also be noted that this is a technique that could serve to decrease the install size of your + /// application, since you'd be streaming in networked game assets dynamically. + /// + public sealed class Preloading : MonoBehaviour + { + [SerializeField] AssetReferenceGameObject m_DynamicPrefabReference; + + [SerializeField] NetworkManager m_NetworkManager; + + async void Start() + { + await PreloadDynamicPlayerPrefab(); + //after we've waited for the prefabs to load - we can start the host or the client + } + + // It's important to note that this isn't limited to PlayerPrefab, despite the method name you can add any + // prefab to the list of prefabs that will be spawned. + async Task PreloadDynamicPlayerPrefab() + { + Debug.Log($"Started to load addressable with GUID: {m_DynamicPrefabReference.AssetGUID}"); + var op = Addressables.LoadAssetAsync(m_DynamicPrefabReference); + var prefab = await op.Task; + Addressables.Release(op); + + //it's important to actually add the player prefab to the list of network prefabs - it doesn't happen + //automatically + m_NetworkManager.AddNetworkPrefab(prefab); + Debug.Log($"Loaded prefab has been assigned to NetworkManager's PlayerPrefab"); + + // at this point we can easily change the PlayerPrefab + m_NetworkManager.NetworkConfig.PlayerPrefab = prefab; + + // Forcing all game instances to load a set of network prefabs and having each game instance inject network + // prefabs to NetworkManager's NetworkPrefabs list pre-connection time guarantees that all players will have + // matching NetworkConfigs. This is why NetworkManager.ForceSamePrefabs is set to true. We let Netcode for + // GameObjects validate the matching NetworkConfigs between clients and the server. If this is set to false + // on the server, clients may join with a mismatching NetworkPrefabs list from the server. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = true; + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs.meta new file mode 100644 index 000000000..bf9fffe71 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/00_Preloading/Preloading.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c82d08ffbd524a6799d466e7997b6a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval.meta new file mode 100644 index 000000000..d44f0f356 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a94bc61944601e849b4d1c95f15a3290 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs new file mode 100644 index 000000000..3763cadb0 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs @@ -0,0 +1,166 @@ +using Game.UI; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace Game.ConnectionApproval +{ + /// + /// A class that walks through what a server would need to validate from a client when dynamically loading network + /// prefabs. This is another simple use-case scenario, as this is just the implementation of the connection approval + /// callback, which is an optional feature from Netcode for GameObjects. To enable it, make sure the "Connection + /// Approval" toggle is enabled on the NetworkManager in your scene. Other use-cases don't allow for reconciliation + /// after the server has loaded a prefab dynamically, whereas this one enables that functionality. To see it all in + /// harmony, see , where all post-connection techniques are showcased in one scene. + /// + public sealed class ConnectionApproval : NetworkBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] + AssetReferenceGameObject m_AssetReferenceGameObject; + + [SerializeField] InGameUI m_InGameUI; + + const int k_MaxConnectedClientCount = 4; + + const int k_MaxConnectPayload = 1024; + + void Start() + { + DynamicPrefabLoadingUtilities.Init(m_NetworkManager); + + // In the use-cases where connection approval is implemented, the server can begin to validate a user's + // connection payload, and either approve or deny connection to the joining client. + m_NetworkManager.NetworkConfig.ConnectionApproval = true; + + // Here, we keep ForceSamePrefabs disabled. This will allow us to dynamically add network prefabs to Netcode + // for GameObject after establishing a connection. In this implementation of the connection approval + // callback, the server validates the client's connection payload based on the hash of their dynamic prefabs + // loaded, and either approves or denies connection to the joining client. If a client is denied connection, + // the server provides a disconnection payload through NetworkManager's DisconnectReason, so that a + // late-joining client can load dynamic prefabs locally and reattempt connection. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = false; + m_NetworkManager.ConnectionApprovalCallback += ConnectionApprovalCallback; + + // to force a simple connection approval on all joining clients, the server will load a dynamic prefab as + // soon as the server is started + // for more complex use-cases where the server must wait for all connected clients to load the same network + // prefab, see the other use-cases inside this sample + m_NetworkManager.OnServerStarted += LoadAPrefab; + } + + async void LoadAPrefab() + { + var assetGuid = new AddressableGUID() { Value = m_AssetReferenceGameObject.AssetGUID }; + + // server is starting to load a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, + assetGuid.GetHashCode(), + "Undefined", + InGameUI.LoadStatus.Loading); + + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, 0); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + } + + public override void OnDestroy() + { + m_NetworkManager.ConnectionApprovalCallback -= ConnectionApprovalCallback; + m_NetworkManager.OnServerStarted -= LoadAPrefab; + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + base.OnDestroy(); + } + + void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) + { + Debug.Log($"Client {request.ClientNetworkId} is trying to connect "); + var connectionData = request.Payload; + var clientId = request.ClientNetworkId; + + if (clientId == m_NetworkManager.LocalClientId) + { + //allow the host to connect + Approve(); + return; + } + + // A sample-specific denial on clients after k_MaxConnectedClientCount clients have been connected + if (m_NetworkManager.ConnectedClientsList.Count >= k_MaxConnectedClientCount) + { + ImmediateDeny(); + return; + } + + if (connectionData.Length > k_MaxConnectPayload) + { + // If connectionData is too big, deny immediately to avoid wasting time on the server. This is intended as + // a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage. + ImmediateDeny(); + return; + } + + if (DynamicPrefabLoadingUtilities.LoadedPrefabCount == 0) + { + //immediately approve the connection if we haven't loaded any prefabs yet + Approve(); + return; + } + + var payload = System.Text.Encoding.UTF8.GetString(connectionData); + var connectionPayload = JsonUtility.FromJson(payload); // https://docs.unity3d.com/2020.2/Documentation/Manual/JSONSerialization.html + + int clientPrefabHash = connectionPayload.hashOfDynamicPrefabGUIDs; + int serverPrefabHash = DynamicPrefabLoadingUtilities.HashOfDynamicPrefabGUIDs; + + //if the client has the same prefabs as the server - approve the connection + if (clientPrefabHash == serverPrefabHash) + { + Approve(); + + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAllPrefabs(clientId); + + return; + } + + // In order for clients to not just get disconnected with no feedback, the server needs to tell the client + // why it disconnected it. This could happen after an auth check on a service or because of gameplay + // reasons (server full, wrong build version, etc). + // The server can do so via the DisconnectReason in the ConnectionApprovalResponse. The guids of the prefabs + // the client will need to load will be sent, such that the client loads the needed prefabs, and reconnects. + + // A note: DisconnectReason will not be written to if the string is too large in size. This should be used + // only to tell the client "why" it failed -- the client should instead use services like UGS to fetch the + // relevant data it needs to fetch & download. + + DynamicPrefabLoadingUtilities.RefreshLoadedPrefabGuids(); + + response.Reason = DynamicPrefabLoadingUtilities.GenerateDisconnectionPayload(); + + ImmediateDeny(); + + // A note: sending large strings through Netcode is not ideal -- you'd usually want to use REST services to + // accomplish this instead. UGS services like Lobby can be a useful alternative. Another route may be to + // set ConnectionApprovalResponse's Pending flag to true, and send a CustomMessage containing the array of + // GUIDs to a client, which the client would load and reattempt a reconnection. + + void Approve() + { + Debug.Log($"Client {clientId} approved"); + response.Approved = true; + response.CreatePlayerObject = false; //we're not going to spawn a player object for this sample + } + + void ImmediateDeny() + { + Debug.Log($"Client {clientId} denied connection"); + response.Approved = false; + response.CreatePlayerObject = false; + } + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs.meta new file mode 100644 index 000000000..d502943b9 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/01_Connection Approval/ConnectionApproval.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46115653413e2ed4c9163c4e5350e569 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async.meta new file mode 100644 index 000000000..c17d4fb55 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3a34ed4b12e58324d9bb1201751560d9 +timeCreated: 1667392114 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs new file mode 100644 index 000000000..418886026 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs @@ -0,0 +1,244 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Game.UI; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace Game.ServerAuthoritativeLoadAllAsync +{ + /// + /// A simple use-case where the server notifies all clients to preload a collection of network prefabs. The server + /// will not invoke a spawn in this use-case, and will incrementally load each dynamic prefab, one prefab at a time. + /// + /// + /// A gameplay scenario where this technique would be useful: clients and host are connected, the host arrives at a + /// point in the game where they know some prefabs will be needed soon, and so the server instructs all clients to + /// preemptively load those prefabs. Some time later in the same session, the server needs to perform a spawn, and + /// can do so without making sure all clients have loaded said dynamic prefab, since it already did so preemptively. + /// This allows for simple spawn management. + /// + public sealed class ServerAuthoritativeLoadAllAsync : NetworkBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] List m_DynamicPrefabReferences; + + [SerializeField] + InGameUI m_InGameUI; + + const int k_MaxConnectedClientCount = 4; + + const int k_MaxConnectPayload = 1024; + + void Start() + { + DynamicPrefabLoadingUtilities.Init(m_NetworkManager); + + // In the use-cases where connection approval is implemented, the server can begin to validate a user's + // connection payload, and either approve or deny connection to the joining client. + // Note: we will define a very simplistic connection approval below, which will effectively deny all + // late-joining clients unless the server has not loaded any dynamic prefabs. You could choose to not define + // a connection approval callback, but late-joining clients will have mismatching NetworkConfigs (and + // potentially different world versions if the server has spawned a dynamic prefab). + m_NetworkManager.NetworkConfig.ConnectionApproval = true; + + // Here, we keep ForceSamePrefabs disabled. This will allow us to dynamically add network prefabs to Netcode + // for GameObject after establishing a connection. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = false; + + // This is a simplistic use-case of a connection approval callback. To see how a connection approval should + // be used to validate a user's connection payload, see the connection approval use-case, or the + // APIPlayground, where all post-connection techniques are used in harmony. + m_NetworkManager.ConnectionApprovalCallback += ConnectionApprovalCallback; + + // hooking up UI callbacks + m_InGameUI.LoadAllAsyncButtonPressed += OnClickedPreload; + } + + public override void OnDestroy() + { + m_NetworkManager.ConnectionApprovalCallback -= ConnectionApprovalCallback; + if (m_InGameUI) + { + m_InGameUI.LoadAllAsyncButtonPressed -= OnClickedPreload; + } + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + base.OnDestroy(); + } + + void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) + { + Debug.Log("Client is trying to connect " + request.ClientNetworkId); + var connectionData = request.Payload; + var clientId = request.ClientNetworkId; + + if (clientId == m_NetworkManager.LocalClientId) + { + // allow the host to connect + Approve(); + return; + } + + // A sample-specific denial on clients after k_MaxConnectedClientCount clients have been connected + if (m_NetworkManager.ConnectedClientsList.Count >= k_MaxConnectedClientCount) + { + ImmediateDeny(); + return; + } + + if (connectionData.Length > k_MaxConnectPayload) + { + // If connectionData is too big, deny immediately to avoid wasting time on the server. This is intended as + // a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage. + ImmediateDeny(); + return; + } + + // simple approval if the server has not loaded any dynamic prefabs yet + if (DynamicPrefabLoadingUtilities.LoadedPrefabCount == 0) + { + Approve(); + } + else + { + ImmediateDeny(); + } + + void Approve() + { + Debug.Log($"Client {clientId} approved"); + response.Approved = true; + response.CreatePlayerObject = false; //we're not going to spawn a player object for this sample + } + + void ImmediateDeny() + { + Debug.Log($"Client {clientId} denied connection"); + response.Approved = false; + response.CreatePlayerObject = false; + } + } + + // invoked by UI + public void OnClickedPreload() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + PreloadPrefabs(); + } + + async void PreloadPrefabs() + { + var tasks = new List(); + foreach (var p in m_DynamicPrefabReferences) + { + tasks.Add(PreloadDynamicPrefabOnServerAndStartLoadingOnAllClients(p.AssetGUID)); + } + + await Task.WhenAll(tasks); + } + + /// + /// This call preloads the dynamic prefab on the server and sends a client rpc to all the clients to do the same. + /// + /// + async Task PreloadDynamicPrefabOnServerAndStartLoadingOnAllClients(string guid) + { + if (m_NetworkManager.IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + if (DynamicPrefabLoadingUtilities.IsPrefabLoadedOnAllClients(assetGuid)) + { + Debug.Log("Prefab is already loaded by all peers"); + return; + } + + // update UI for each client that is requested to load a certain prefab + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + } + + Debug.Log("Loading dynamic prefab on the clients..."); + LoadAddressableClientRpc(assetGuid); + + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + + // every client loaded dynamic prefab, their respective ClientUIs in case they loaded first + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, + assetGuid.GetHashCode(), + loadedGameObject.Result.name, + InGameUI.LoadStatus.Loading); + } + } + } + + [ClientRpc] + void LoadAddressableClientRpc(AddressableGUID guid, ClientRpcParams rpcParams = default) + { + if (!IsHost) + { + Load(guid); + } + + async void Load(AddressableGUID assetGuid) + { + // loading prefab as a client, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + Debug.Log("Loading dynamic prefab on the client..."); + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + Debug.Log("Client loaded dynamic prefab"); + + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + AcknowledgeSuccessfulPrefabLoadServerRpc(assetGuid.GetHashCode()); + } + } + + [ServerRpc(RequireOwnership = false)] + void AcknowledgeSuccessfulPrefabLoadServerRpc(int prefabHash, ServerRpcParams rpcParams = default) + { + Debug.Log($"Client acknowledged successful prefab load with hash: {prefabHash}"); + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAPrefab(prefabHash, rpcParams.Receive.SenderClientId); + + // a quick way to grab a matching prefab reference's name via its prefabHash + var loadedPrefabName = "Undefined"; + foreach (var prefabReference in m_DynamicPrefabReferences) + { + var prefabReferenceGuid = new AddressableGUID() { Value = prefabReference.AssetGUID }; + if (prefabReferenceGuid.GetHashCode() == prefabHash) + { + // found the matching prefab reference + if (DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.TryGetValue( + prefabReferenceGuid, + out var loadedGameObject)) + { + // if it is loaded on the server, update the name on the ClientUI + loadedPrefabName = loadedGameObject.Result.name; + } + break; + } + } + + // client has successfully loaded a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(rpcParams.Receive.SenderClientId, prefabHash, loadedPrefabName, InGameUI.LoadStatus.Loaded); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs.meta new file mode 100644 index 000000000..5c17d768d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/02_Server Authoritative Load All Async/ServerAuthoritativeLoadAllAsync.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfcd3408d3cf98c41a414b4f63e473fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning.meta new file mode 100644 index 000000000..99dc91fb3 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5cda589957d9d8b4a9a4e47fa2c08ad8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs new file mode 100644 index 000000000..38d1ed5be --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs @@ -0,0 +1,292 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Game.UI; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; +using Random = UnityEngine.Random; + +namespace Game.ServerAuthoritativeSynchronousSpawning +{ + /// + /// A dynamic prefab loading use-case where the server instructs all clients to load a single network prefab, and + /// will only invoke a spawn once all clients have successfully completed their respective loads of said prefab. The + /// server will initially send a ClientRpc to all clients, begin loading the prefab on the server, will await + /// acknowledgement of a load via ServerRpcs from each client, and will only spawn the prefab over the network once + /// it has received an acknowledgement from every client, within m_SynchronousSpawnTimeoutTimer seconds. + /// + /// + /// This use-case is recommended for scenarios where you'd want to guarantee the same world version across all + /// connected clients. Since the server will wait until all clients have loaded the same dynamic prefab, the spawn + /// of said dynamic prefab will be synchronous. Thus, we recommend using this technique for spawning game-changing + /// gameplay elements, assuming you'd want all clients to be able to interact with said gameplay elements from the + /// same point forward. For example, you wouldn't want to have an enemy only be visible (network side and/or + /// visually) to some clients and not others -- you'd want to delay the enemy's spawn until all clients have + /// dynamically loaded it and are able to see it before spawning it server side. + /// + public sealed class ServerAuthoritativeSynchronousSpawning : NetworkBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] List m_DynamicPrefabReferences; + + [SerializeField] InGameUI m_InGameUI; + + const int k_MaxConnectedClientCount = 4; + + const int k_MaxConnectPayload = 1024; + + float m_SynchronousSpawnTimeoutTimer; + + int m_SynchronousSpawnAckCount = 0; + + void Start() + { + DynamicPrefabLoadingUtilities.Init(m_NetworkManager); + + // In the use-cases where connection approval is implemented, the server can begin to validate a user's + // connection payload, and either approve or deny connection to the joining client. + // Note: we will define a very simplistic connection approval below, which will effectively deny all + // late-joining clients unless the server has not loaded any dynamic prefabs. You could choose to not define + // a connection approval callback, but late-joining clients will have mismatching NetworkConfigs (and + // potentially different world versions if the server has spawned a dynamic prefab). + m_NetworkManager.NetworkConfig.ConnectionApproval = true; + + // Here, we keep ForceSamePrefabs disabled. This will allow us to dynamically add network prefabs to Netcode + // for GameObject after establishing a connection. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = false; + + // This is a simplistic use-case of a connection approval callback. To see how a connection approval should + // be used to validate a user's connection payload, see the connection approval use-case, or the + // APIPlayground, where all post-connection techniques are used in harmony. + m_NetworkManager.ConnectionApprovalCallback += ConnectionApprovalCallback; + + // hooking up UI callbacks + m_InGameUI.TrySpawnSynchronouslyButtonPressed += OnClickedTrySpawnSynchronously; + } + + public override void OnDestroy() + { + m_NetworkManager.ConnectionApprovalCallback -= ConnectionApprovalCallback; + if (m_InGameUI) + { + m_InGameUI.TrySpawnSynchronouslyButtonPressed -= OnClickedTrySpawnSynchronously; + } + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + base.OnDestroy(); + } + + void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) + { + Debug.Log("Client is trying to connect " + request.ClientNetworkId); + var connectionData = request.Payload; + var clientId = request.ClientNetworkId; + + if (clientId == m_NetworkManager.LocalClientId) + { + // allow the host to connect + Approve(); + return; + } + + // A sample-specific denial on clients after k_MaxConnectedClientCount clients have been connected + if (m_NetworkManager.ConnectedClientsList.Count >= k_MaxConnectedClientCount) + { + ImmediateDeny(); + return; + } + + if (connectionData.Length > k_MaxConnectPayload) + { + // If connectionData is too big, deny immediately to avoid wasting time on the server. This is intended as + // a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage. + ImmediateDeny(); + return; + } + + // simple approval if the server has not loaded any dynamic prefabs yet + if (DynamicPrefabLoadingUtilities.LoadedPrefabCount == 0) + { + Approve(); + } + else + { + ImmediateDeny(); + } + + void Approve() + { + Debug.Log($"Client {clientId} approved"); + response.Approved = true; + response.CreatePlayerObject = false; //we're not going to spawn a player object for this sample + } + + void ImmediateDeny() + { + Debug.Log($"Client {clientId} denied connection"); + response.Approved = false; + response.CreatePlayerObject = false; + } + } + + // invoked by UI + void OnClickedTrySpawnSynchronously() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + TrySpawnSynchronously(); + } + + async void TrySpawnSynchronously() + { + var randomPrefab = m_DynamicPrefabReferences[Random.Range(0, m_DynamicPrefabReferences.Count)]; + await TrySpawnDynamicPrefabSynchronously(randomPrefab.AssetGUID, Random.insideUnitCircle * 5, Quaternion.identity); + } + + /// + /// This call attempts to spawn a prefab by it's addressable guid - it ensures that all the clients have loaded the prefab before spawning it, + /// and if the clients fail to acknowledge that they've loaded a prefab - the spawn will fail. + /// + /// + /// + async Task<(bool Success, NetworkObject Obj)> TrySpawnDynamicPrefabSynchronously(string guid, Vector3 position, Quaternion rotation) + { + if (IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + if (DynamicPrefabLoadingUtilities.IsPrefabLoadedOnAllClients(assetGuid)) + { + Debug.Log("Prefab is already loaded by all peers, we can spawn it immediately"); + var obj = Spawn(assetGuid); + return (true, obj); + } + + m_SynchronousSpawnAckCount = 0; + m_SynchronousSpawnTimeoutTimer = 0; + + Debug.Log("Loading dynamic prefab on the clients..."); + LoadAddressableClientRpc(assetGuid); + + // server is starting to load a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + //load the prefab on the server, so that any late-joiner will need to load that prefab also + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + var requiredAcknowledgementsCount = IsHost ? m_NetworkManager.ConnectedClients.Count - 1 : + m_NetworkManager.ConnectedClients.Count; + + while (m_SynchronousSpawnTimeoutTimer < m_InGameUI.NetworkSpawnTimeoutSeconds) + { + if (m_SynchronousSpawnAckCount >= requiredAcknowledgementsCount) + { + Debug.Log($"All clients have loaded the prefab in {m_SynchronousSpawnTimeoutTimer} seconds, spawning the prefab on the server..."); + var obj = Spawn(assetGuid); + return (true, obj); + } + + m_SynchronousSpawnTimeoutTimer += Time.deltaTime; + await Task.Yield(); + } + + // left to the reader: you'll need to be reactive to clients failing to load -- you should either have + // the offending client try again or disconnect it after a predetermined amount of failed attempts + Debug.LogError("Failed to spawn dynamic prefab - timeout"); + return (false, null); + } + + return (false, null); + + NetworkObject Spawn(AddressableGUID assetGuid) + { + if (!DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var prefab)) + { + Debug.LogWarning($"GUID {assetGuid} is not a GUID of a previously loaded prefab. Failed to spawn a prefab."); + return null; + } + var obj = Instantiate(prefab.Result, position, rotation).GetComponent(); + obj.Spawn(); + Debug.Log("Spawned dynamic prefab"); + + // every client loaded dynamic prefab, their respective ClientUIs in case they loaded first + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, + assetGuid.GetHashCode(), + prefab.Result.name, + InGameUI.LoadStatus.Loading); + } + + return obj; + } + } + + [ClientRpc] + void LoadAddressableClientRpc(AddressableGUID guid, ClientRpcParams rpcParams = default) + { + if (!IsHost) + { + Load(guid); + } + + async void Load(AddressableGUID assetGuid) + { + // loading prefab as a client, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + Debug.Log("Loading dynamic prefab on the client..."); + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + Debug.Log("Client loaded dynamic prefab"); + + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + AcknowledgeSuccessfulPrefabLoadServerRpc(assetGuid.GetHashCode()); + } + } + + [ServerRpc(RequireOwnership = false)] + void AcknowledgeSuccessfulPrefabLoadServerRpc(int prefabHash, ServerRpcParams rpcParams = default) + { + m_SynchronousSpawnAckCount++; + Debug.Log($"Client acknowledged successful prefab load with hash: {prefabHash}"); + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAPrefab(prefabHash, + rpcParams.Receive.SenderClientId); + + // a quick way to grab a matching prefab reference's name via its prefabHash + var loadedPrefabName = "Undefined"; + foreach (var prefabReference in m_DynamicPrefabReferences) + { + var prefabReferenceGuid = new AddressableGUID() { Value = prefabReference.AssetGUID }; + if (prefabReferenceGuid.GetHashCode() == prefabHash) + { + // found the matching prefab reference + if (DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.TryGetValue( + prefabReferenceGuid, + out var loadedGameObject)) + { + // if it is loaded on the server, update the name on the ClientUI + loadedPrefabName = loadedGameObject.Result.name; + } + break; + } + } + + // client has successfully loaded a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(rpcParams.Receive.SenderClientId, prefabHash, loadedPrefabName, InGameUI.LoadStatus.Loaded); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs.meta new file mode 100644 index 000000000..a827ec46d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/03_Server Authoritative Synchronous Spawning/ServerAuthoritativeSynchronousSpawning.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f128f9485fb85914989ea62eb4ca46c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning.meta new file mode 100644 index 000000000..d7f0bb793 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4fd4a4c5142f468f9b009e5c9cf6a2be +timeCreated: 1667392114 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs new file mode 100644 index 000000000..4b391df2b --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Game.UI; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; +using Random = UnityEngine.Random; + +namespace Game.ServerAuthoritativeNetworkVisibilitySpawning +{ + /// + /// A dynamic prefab loading use-case where the server instructs all clients to load a single network prefab via a + /// ClientRpc, will spawn said prefab as soon as it is loaded on the server, and will mark it as network-visible + /// only to clients that have already loaded that same prefab. As soon as a client loads the prefab locally, it + /// sends an acknowledgement ServerRpc, and the server will mark that spawned NetworkObject as network-visible to + /// that client. + /// + /// + /// An important implementation detail to note about this technique: the server will not wait until all clients have + /// loaded a dynamic prefab before spawning the corresponding NetworkObject. Thus, this means that a NetworkObject + /// will become network-visible for a connected client as soon as it has loaded it as well -- a client is not + /// blocked by the loading operation of another client (which may be loading the asset slower or may have failed to + /// load it at all). A consequence of this asynchronous loading technique is that clients may experience differing + /// world versions momentarily. Therefore, we don't recommend using this technique for spawning game-changing + /// gameplay elements (like a boss fight for example) assuming you'd want all clients to interact with the spawned + /// NetworkObject as soon as it is spawned on the server. + /// + public sealed class ServerAuthoritativeNetworkVisibilitySpawning : NetworkBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] List m_DynamicPrefabReferences; + + [SerializeField] InGameUI m_InGameUI; + + const int k_MaxConnectedClientCount = 4; + + const int k_MaxConnectPayload = 1024; + + //A storage where we keep association between prefab (hash of it's GUID) and the spawned network objects that use it + Dictionary> m_PrefabHashToNetworkObjectId = new Dictionary>(); + + void Start() + { + DynamicPrefabLoadingUtilities.Init(m_NetworkManager); + + // In the use-cases where connection approval is implemented, the server can begin to validate a user's + // connection payload, and either approve or deny connection to the joining client. + // Note: we will define a very simplistic connection approval below, which will effectively deny all + // late-joining clients unless the server has not loaded any dynamic prefabs. You could choose to not define + // a connection approval callback, but late-joining clients will have mismatching NetworkConfigs (and + // potentially different world versions if the server has spawned a dynamic prefab). + m_NetworkManager.NetworkConfig.ConnectionApproval = true; + + // Here, we keep ForceSamePrefabs disabled. This will allow us to dynamically add network prefabs to Netcode + // for GameObject after establishing a connection. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = false; + + // This is a simplistic use-case of a connection approval callback. To see how a connection approval should + // be used to validate a user's connection payload, see the connection approval use-case, or the + // APIPlayground, where all post-connection techniques are used in harmony. + m_NetworkManager.ConnectionApprovalCallback += ConnectionApprovalCallback; + + // hooking up UI callbacks + m_InGameUI.SpawnUsingVisibilityButtonPressed += OnClickedTrySpawnInvisible; + } + + public override void OnDestroy() + { + m_NetworkManager.ConnectionApprovalCallback -= ConnectionApprovalCallback; + if (m_InGameUI) + { + m_InGameUI.SpawnUsingVisibilityButtonPressed -= OnClickedTrySpawnInvisible; + } + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + base.OnDestroy(); + } + + void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) + { + Debug.Log("Client is trying to connect " + request.ClientNetworkId); + var connectionData = request.Payload; + var clientId = request.ClientNetworkId; + + if (clientId == m_NetworkManager.LocalClientId) + { + // allow the host to connect + Approve(); + return; + } + + // A sample-specific denial on clients after k_MaxConnectedClientCount clients have been connected + if (m_NetworkManager.ConnectedClientsList.Count >= k_MaxConnectedClientCount) + { + ImmediateDeny(); + return; + } + + if (connectionData.Length > k_MaxConnectPayload) + { + // If connectionData is too big, deny immediately to avoid wasting time on the server. This is intended as + // a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage. + ImmediateDeny(); + return; + } + + // simple approval if the server has not loaded any dynamic prefabs yet + if (DynamicPrefabLoadingUtilities.LoadedPrefabCount == 0) + { + Approve(); + } + else + { + ImmediateDeny(); + } + + void Approve() + { + Debug.Log($"Client {clientId} approved"); + response.Approved = true; + response.CreatePlayerObject = false; //we're not going to spawn a player object for this sample + } + + void ImmediateDeny() + { + Debug.Log($"Client {clientId} denied connection"); + response.Approved = false; + response.CreatePlayerObject = false; + } + } + + // invoked by UI + void OnClickedTrySpawnInvisible() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + TrySpawnInvisible(); + } + + async void TrySpawnInvisible() + { + var randomPrefab = m_DynamicPrefabReferences[Random.Range(0, m_DynamicPrefabReferences.Count)]; + await SpawnImmediatelyAndHideUntilPrefabIsLoadedOnClient(randomPrefab.AssetGUID, Random.insideUnitCircle * 5, Quaternion.identity); + } + + /// + /// This call spawns an addressable prefab by it's guid. It does not ensure that all the clients have loaded the + /// prefab before spawning it. All spawned objects are network-invisible to clients that don't have the prefab + /// loaded. The server tells the clients that lack the preloaded prefab to load it and acknowledge that they've + /// loaded it, and then the server makes the object network-visible to that client. + /// + /// + /// + async Task SpawnImmediatelyAndHideUntilPrefabIsLoadedOnClient(string guid, Vector3 position, Quaternion rotation) + { + if (IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + return await Spawn(assetGuid); + } + + return null; + + async Task Spawn(AddressableGUID assetGuid) + { + // server is starting to load a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + var prefab = await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, + m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + var obj = Instantiate(prefab, position, rotation).GetComponent(); + + if (m_PrefabHashToNetworkObjectId.TryGetValue(assetGuid.GetHashCode(), out var networkObjectIds)) + { + networkObjectIds.Add(obj); + } + else + { + m_PrefabHashToNetworkObjectId.Add(assetGuid.GetHashCode(), new HashSet() {obj}); + } + + // This gets called on spawn and makes sure clients currently syncing and receiving spawns have the + // appropriate network visibility settings automatically. This can happen on late join, on spawn, on + // scene switch, etc. + obj.CheckObjectVisibility = (clientId) => + { + if (clientId == NetworkManager.ServerClientId) + { + // object is loaded on the server, no need to validate for visibility + return true; + } + + //if the client has already loaded the prefab - we can make the object network-visible to them + if (DynamicPrefabLoadingUtilities.HasClientLoadedPrefab(clientId, assetGuid.GetHashCode())) + { + return true; + } + + // client is loading a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(clientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + //otherwise the clients need to load the prefab, and after they ack - the ShowHiddenObjectsToClient + LoadAddressableClientRpc(assetGuid, new ClientRpcParams(){Send = new ClientRpcSendParams(){TargetClientIds = new ulong[]{clientId}}}); + return false; + }; + + obj.Spawn(); + + return obj; + } + } + + void ShowHiddenObjectsToClient(int prefabHash, ulong clientId) + { + if (m_PrefabHashToNetworkObjectId.TryGetValue(prefabHash, out var networkObjects)) + { + foreach (var obj in networkObjects) + { + if (!obj.IsNetworkVisibleTo(clientId)) + { + obj.NetworkShow(clientId); + } + } + } + } + + [ClientRpc] + void LoadAddressableClientRpc(AddressableGUID guid, ClientRpcParams rpcParams = default) + { + if (!IsHost) + { + Load(guid); + } + + async void Load(AddressableGUID assetGuid) + { + // loading prefab as a client, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + Debug.Log("Loading dynamic prefab on the client..."); + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + Debug.Log("Client loaded dynamic prefab"); + + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + AcknowledgeSuccessfulPrefabLoadServerRpc(assetGuid.GetHashCode()); + } + } + + [ServerRpc(RequireOwnership = false)] + void AcknowledgeSuccessfulPrefabLoadServerRpc(int prefabHash, ServerRpcParams rpcParams = default) + { + Debug.Log($"Client acknowledged successful prefab load with hash: {prefabHash}"); + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAPrefab(prefabHash, + rpcParams.Receive.SenderClientId); + + //the server has all the objects network-visible, no need to do anything + if (rpcParams.Receive.SenderClientId != m_NetworkManager.LocalClientId) + { + // Note: there's a potential security risk here if this technique is tied with gameplay that uses + // a NetworkObject's Show() and Hide() methods. For example, a malicious player could invoke a similar + // ServerRpc with the guids of enemy players, and it would make those enemies visible (network side + // and/or visually) to that player, giving them a potential advantage. + ShowHiddenObjectsToClient(prefabHash, rpcParams.Receive.SenderClientId); + } + + // a quick way to grab a matching prefab reference's name via its prefabHash + var loadedPrefabName = "Undefined"; + foreach (var prefabReference in m_DynamicPrefabReferences) + { + var prefabReferenceGuid = new AddressableGUID() { Value = prefabReference.AssetGUID }; + if (prefabReferenceGuid.GetHashCode() == prefabHash) + { + // found the matching prefab reference + if (DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.TryGetValue( + prefabReferenceGuid, + out var loadedGameObject)) + { + // if it is loaded on the server, update the name on the ClientUI + loadedPrefabName = loadedGameObject.Result.name; + } + break; + } + } + + // client has successfully loaded a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(rpcParams.Receive.SenderClientId, prefabHash, loadedPrefabName, InGameUI.LoadStatus.Loaded); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs.meta new file mode 100644 index 000000000..2a72f98ef --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/04_Server Authoritative Network-Visibility Spawning/ServerAuthoritativeNetworkVisibilitySpawning.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a695c6b1fd4ab594e875d5dea4cc9fae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground.meta new file mode 100644 index 000000000..ebc0c6b87 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: af9f34bc59b364f4692a37f9d1325df0 +timeCreated: 1667392114 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs new file mode 100644 index 000000000..431617032 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs @@ -0,0 +1,505 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Game.UI; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; +using Random = UnityEngine.Random; + +namespace Game.APIPlayground +{ + /// + /// This class serves as the playground of the dynamic prefab loading use-cases. It integrates API from this sample + /// to use at post-connection time such as: connection approval for syncing late-joining clients, dynamically + /// loading a collection of network prefabs on the host and all connected clients, synchronously spawning a + /// dynamically loaded network prefab across connected clients, and spawning a dynamically loaded network prefab as + /// network-invisible for all clients until they load the prefab locally (in which case it becomes network-visible + /// to the client). + /// + /// + /// For more details on the API usage, see the in-project readme (which includes links to further resources, + /// including the project's technical document). + /// + public sealed class APIPlayground : NetworkBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] List m_DynamicPrefabReferences; + + [SerializeField] InGameUI m_InGameUI; + + const int k_MaxConnectedClientCount = 4; + + const int k_MaxConnectPayload = 1024; + + //A storage where we keep association between prefab (hash of it's GUID) and the spawned network objects that use it + Dictionary> m_PrefabHashToNetworkObjectId = new Dictionary>(); + + float m_SynchronousSpawnTimeoutTimer; + + int m_SynchronousSpawnAckCount = 0; + + void Start() + { + DynamicPrefabLoadingUtilities.Init(m_NetworkManager); + + // In the use-cases where connection approval is implemented, the server can begin to validate a user's + // connection payload, and either approve or deny connection to the joining client. + m_NetworkManager.NetworkConfig.ConnectionApproval = true; + + // Here, we keep ForceSamePrefabs disabled. This will allow us to dynamically add network prefabs to Netcode + // for GameObject after establishing a connection. + m_NetworkManager.NetworkConfig.ForceSamePrefabs = false; + m_NetworkManager.ConnectionApprovalCallback += ConnectionApprovalCallback; + + // hooking up UI callbacks + m_InGameUI.LoadAllAsyncButtonPressed += OnClickedPreload; + m_InGameUI.TrySpawnSynchronouslyButtonPressed += OnClickedTrySpawnSynchronously; + m_InGameUI.SpawnUsingVisibilityButtonPressed += OnClickedTrySpawnInvisible; + } + + public override void OnDestroy() + { + m_NetworkManager.ConnectionApprovalCallback -= ConnectionApprovalCallback; + if (m_InGameUI) + { + m_InGameUI.LoadAllAsyncButtonPressed -= OnClickedPreload; + m_InGameUI.TrySpawnSynchronouslyButtonPressed -= OnClickedTrySpawnSynchronously; + m_InGameUI.SpawnUsingVisibilityButtonPressed -= OnClickedTrySpawnInvisible; + } + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + base.OnDestroy(); + } + + void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) + { + Debug.Log("Client is trying to connect " + request.ClientNetworkId); + var connectionData = request.Payload; + var clientId = request.ClientNetworkId; + + if (clientId == m_NetworkManager.LocalClientId) + { + //allow the host to connect + Approve(); + return; + } + + // A sample-specific denial on clients after k_MaxConnectedClientCount clients have been connected + if (m_NetworkManager.ConnectedClientsList.Count >= k_MaxConnectedClientCount) + { + ImmediateDeny(); + return; + } + + if (connectionData.Length > k_MaxConnectPayload) + { + // If connectionData is too big, deny immediately to avoid wasting time on the server. This is intended as + // a bit of light protection against DOS attacks that rely on sending silly big buffers of garbage. + ImmediateDeny(); + return; + } + + if (DynamicPrefabLoadingUtilities.LoadedPrefabCount == 0) + { + //immediately approve the connection if we haven't loaded any prefabs yet + Approve(); + return; + } + + var payload = System.Text.Encoding.UTF8.GetString(connectionData); + var connectionPayload = JsonUtility.FromJson(payload); // https://docs.unity3d.com/2020.2/Documentation/Manual/JSONSerialization.html + + int clientPrefabHash = connectionPayload.hashOfDynamicPrefabGUIDs; + int serverPrefabHash = DynamicPrefabLoadingUtilities.HashOfDynamicPrefabGUIDs; + + //if the client has the same prefabs as the server - approve the connection + if (clientPrefabHash == serverPrefabHash) + { + Approve(); + + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAllPrefabs(clientId); + + return; + } + + // In order for clients to not just get disconnected with no feedback, the server needs to tell the client + // why it disconnected it. This could happen after an auth check on a service or because of gameplay + // reasons (server full, wrong build version, etc). + // The server can do so via the DisconnectReason in the ConnectionApprovalResponse. The guids of the prefabs + // the client will need to load will be sent, such that the client loads the needed prefabs, and reconnects. + + // A note: DisconnectReason will not be written to if the string is too large in size. This should be used + // only to tell the client "why" it failed -- the client should instead use services like UGS to fetch the + // relevant data it needs to fetch & download. + + DynamicPrefabLoadingUtilities.RefreshLoadedPrefabGuids(); + + response.Reason = DynamicPrefabLoadingUtilities.GenerateDisconnectionPayload(); + + ImmediateDeny(); + + // A note: sending large strings through Netcode is not ideal -- you'd usually want to use REST services to + // accomplish this instead. UGS services like Lobby can be a useful alternative. Another route may be to + // set ConnectionApprovalResponse's Pending flag to true, and send a CustomMessage containing the array of + // GUIDs to a client, which the client would load and reattempt a reconnection. + + void Approve() + { + Debug.Log($"Client {clientId} approved"); + response.Approved = true; + response.CreatePlayerObject = false; //we're not going to spawn a player object for this sample + } + + void ImmediateDeny() + { + Debug.Log($"Client {clientId} denied connection"); + response.Approved = false; + response.CreatePlayerObject = false; + } + } + + // invoked by UI + void OnClickedPreload() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + PreloadPrefabs(); + } + + // invoked by UI + void OnClickedTrySpawnSynchronously() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + TrySpawnSynchronously(); + } + + // invoked by UI + void OnClickedTrySpawnInvisible() + { + if (!m_NetworkManager.IsServer) + { + return; + } + + TrySpawnInvisible(); + } + + async void PreloadPrefabs() + { + var tasks = new List(); + foreach (var p in m_DynamicPrefabReferences) + { + tasks.Add(PreloadDynamicPrefabOnServerAndStartLoadingOnAllClients(p.AssetGUID)); + } + + await Task.WhenAll(tasks); + } + + /// + /// This call preloads the dynamic prefab on the server and sends a client rpc to all the clients to do the same. + /// + /// + async Task PreloadDynamicPrefabOnServerAndStartLoadingOnAllClients(string guid) + { + if (m_NetworkManager.IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + if (DynamicPrefabLoadingUtilities.IsPrefabLoadedOnAllClients(assetGuid)) + { + Debug.Log("Prefab is already loaded by all peers"); + return; + } + + // update UI for each client that is requested to load a certain prefab + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, + assetGuid.GetHashCode(), + "Undefined", + InGameUI.LoadStatus.Loading); + } + + Debug.Log("Loading dynamic prefab on the clients..."); + LoadAddressableClientRpc(assetGuid); + + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + + // every client loaded dynamic prefab, their respective ClientUIs in case they loaded first + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, + assetGuid.GetHashCode(), + loadedGameObject.Result.name, + InGameUI.LoadStatus.Loading); + } + } + } + + async void TrySpawnSynchronously() + { + var randomPrefab = m_DynamicPrefabReferences[Random.Range(0, m_DynamicPrefabReferences.Count)]; + await TrySpawnDynamicPrefabSynchronously(randomPrefab.AssetGUID, Random.insideUnitCircle * 5, Quaternion.identity); + } + + /// + /// This call attempts to spawn a prefab by it's addressable guid - it ensures that all the clients have loaded the prefab before spawning it, + /// and if the clients fail to acknowledge that they've loaded a prefab - the spawn will fail. + /// + /// + /// + async Task<(bool Success, NetworkObject Obj)> TrySpawnDynamicPrefabSynchronously(string guid, Vector3 position, Quaternion rotation) + { + if (IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + if (DynamicPrefabLoadingUtilities.IsPrefabLoadedOnAllClients(assetGuid)) + { + Debug.Log("Prefab is already loaded by all peers, we can spawn it immediately"); + var obj = Spawn(assetGuid); + return (true, obj); + } + + m_SynchronousSpawnAckCount = 0; + m_SynchronousSpawnTimeoutTimer = 0; + + Debug.Log("Loading dynamic prefab on the clients..."); + LoadAddressableClientRpc(assetGuid); + + // server is starting to load a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + //load the prefab on the server, so that any late-joiner will need to load that prefab also + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + var requiredAcknowledgementsCount = IsHost ? m_NetworkManager.ConnectedClients.Count - 1 : + m_NetworkManager.ConnectedClients.Count; + + while (m_SynchronousSpawnTimeoutTimer < m_InGameUI.NetworkSpawnTimeoutSeconds) + { + if (m_SynchronousSpawnAckCount >= requiredAcknowledgementsCount) + { + Debug.Log($"All clients have loaded the prefab in {m_SynchronousSpawnTimeoutTimer} seconds, spawning the prefab on the server..."); + var obj = Spawn(assetGuid); + return (true, obj); + } + + m_SynchronousSpawnTimeoutTimer += Time.deltaTime; + await Task.Yield(); + } + + // left to the reader: you'll need to be reactive to clients failing to load -- you should either have + // the offending client try again or disconnect it after a predetermined amount of failed attempts + Debug.LogError("Failed to spawn dynamic prefab - timeout"); + return (false, null); + } + + return (false, null); + + NetworkObject Spawn(AddressableGUID assetGuid) + { + if (!DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var prefab)) + { + Debug.LogWarning($"GUID {assetGuid} is not a GUID of a previously loaded prefab. Failed to spawn a prefab."); + return null; + } + + var obj = Instantiate(prefab.Result, position, rotation).GetComponent(); + obj.Spawn(); + Debug.Log("Spawned dynamic prefab"); + + // every client loaded dynamic prefab, their respective ClientUIs in case they loaded first + foreach (var client in m_NetworkManager.ConnectedClients.Keys) + { + m_InGameUI.ClientLoadedPrefabStatusChanged(client, + assetGuid.GetHashCode(), + prefab.Result.name, + InGameUI.LoadStatus.Loading); + } + + return obj; + } + } + + async void TrySpawnInvisible() + { + var randomPrefab = m_DynamicPrefabReferences[Random.Range(0, m_DynamicPrefabReferences.Count)]; + await SpawnImmediatelyAndHideUntilPrefabIsLoadedOnClient(randomPrefab.AssetGUID, Random.insideUnitCircle * 5, Quaternion.identity); + } + + /// + /// This call spawns an addressable prefab by it's guid. It does not ensure that all the clients have loaded the + /// prefab before spawning it. All spawned objects are network-invisible to clients that don't have the prefab + /// loaded. The server tells the clients that lack the preloaded prefab to load it and acknowledge that they've + /// loaded it, and then the server makes the object network-visible to that client. + /// + /// + /// + async Task SpawnImmediatelyAndHideUntilPrefabIsLoadedOnClient(string guid, Vector3 position, Quaternion rotation) + { + if (IsServer) + { + var assetGuid = new AddressableGUID() + { + Value = guid + }; + + return await Spawn(assetGuid); + } + + return null; + + async Task Spawn(AddressableGUID assetGuid) + { + // server is starting to load a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + var prefab = await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, + m_InGameUI.ArtificialDelayMilliseconds); + + // server loaded a prefab, update UI with the loaded asset's name + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(NetworkManager.ServerClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + var obj = Instantiate(prefab, position, rotation).GetComponent(); + + if (m_PrefabHashToNetworkObjectId.TryGetValue(assetGuid.GetHashCode(), out var networkObjectIds)) + { + networkObjectIds.Add(obj); + } + else + { + m_PrefabHashToNetworkObjectId.Add(assetGuid.GetHashCode(), new HashSet() {obj}); + } + + obj.CheckObjectVisibility = (clientId) => + { + if (clientId == NetworkManager.ServerClientId) + { + // object is loaded on the server, no need to validate for visibility + return true; + } + + //if the client has already loaded the prefab - we can make the object network-visible to them + if (DynamicPrefabLoadingUtilities.HasClientLoadedPrefab(clientId, assetGuid.GetHashCode())) + { + return true; + } + + // client is loading a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(clientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + //otherwise the client need to load the prefab, and after they ack - the ShowHiddenObjectsToClient + LoadAddressableClientRpc(assetGuid, new ClientRpcParams(){Send = new ClientRpcSendParams(){TargetClientIds = new ulong[]{clientId}}}); + return false; + }; + + obj.Spawn(); + + return obj; + } + } + + void ShowHiddenObjectsToClient(int prefabHash, ulong clientId) + { + if (m_PrefabHashToNetworkObjectId.TryGetValue(prefabHash, out var networkObjects)) + { + foreach (var obj in networkObjects) + { + if (!obj.IsNetworkVisibleTo(clientId)) + { + obj.NetworkShow(clientId); + } + } + } + } + + [ClientRpc] + void LoadAddressableClientRpc(AddressableGUID guid, ClientRpcParams rpcParams = default) + { + if (!IsHost) + { + Load(guid); + } + + async void Load(AddressableGUID assetGuid) + { + // loading prefab as a client, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), "Undefined", InGameUI.LoadStatus.Loading); + + Debug.Log("Loading dynamic prefab on the client..."); + await DynamicPrefabLoadingUtilities.LoadDynamicPrefab(assetGuid, m_InGameUI.ArtificialDelayMilliseconds); + Debug.Log("Client loaded dynamic prefab"); + + DynamicPrefabLoadingUtilities.TryGetLoadedGameObjectFromGuid(assetGuid, out var loadedGameObject); + m_InGameUI.ClientLoadedPrefabStatusChanged(m_NetworkManager.LocalClientId, assetGuid.GetHashCode(), loadedGameObject.Result.name, InGameUI.LoadStatus.Loaded); + + AcknowledgeSuccessfulPrefabLoadServerRpc(assetGuid.GetHashCode()); + } + } + + [ServerRpc(RequireOwnership = false)] + void AcknowledgeSuccessfulPrefabLoadServerRpc(int prefabHash, ServerRpcParams rpcParams = default) + { + m_SynchronousSpawnAckCount++; + Debug.Log($"Client acknowledged successful prefab load with hash: {prefabHash}"); + DynamicPrefabLoadingUtilities.RecordThatClientHasLoadedAPrefab(prefabHash, + rpcParams.Receive.SenderClientId); + + //the server has all the objects network-visible, no need to do anything + if (rpcParams.Receive.SenderClientId != m_NetworkManager.LocalClientId) + { + // Note: there's a potential security risk here if this technique is tied with gameplay that uses + // a NetworkObject's Show() and Hide() methods. For example, a malicious player could invoke a similar + // ServerRpc with the guids of enemy players, and it would make those enemies visible (network side + // and/or visually) to that player, giving them a potential advantage. + ShowHiddenObjectsToClient(prefabHash, rpcParams.Receive.SenderClientId); + } + + // a quick way to grab a matching prefab reference's name via its prefabHash + var loadedPrefabName = "Undefined"; + foreach (var prefabReference in m_DynamicPrefabReferences) + { + var prefabReferenceGuid = new AddressableGUID() { Value = prefabReference.AssetGUID }; + if (prefabReferenceGuid.GetHashCode() == prefabHash) + { + // found the matching prefab reference + if (DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.TryGetValue( + prefabReferenceGuid, + out var loadedGameObject)) + { + // if it is loaded on the server, update the name on the ClientUI + loadedPrefabName = loadedGameObject.Result.name; + } + break; + } + } + + // client has successfully loaded a prefab, update UI + m_InGameUI.ClientLoadedPrefabStatusChanged(rpcParams.Receive.SenderClientId, prefabHash, loadedPrefabName, InGameUI.LoadStatus.Loaded); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs.meta new file mode 100644 index 000000000..761069d4b --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/05_API Playground/APIPlayground.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06f0d49321026254cbd9420e0a8a1f38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme.meta new file mode 100644 index 000000000..cb7e6386c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c24ea5d585cf03c4288399e8770bd7a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts/Editor.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor.meta similarity index 77% rename from Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts/Editor.meta rename to Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor.meta index 2b590d91a..29c52e041 100644 --- a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Scripts/Editor.meta +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 254f8f69c2bb6464cbd208f418928aab +guid: 52946d0b900eb9e48874410656f8e713 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs new file mode 100644 index 000000000..0587edb51 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs @@ -0,0 +1,186 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.IO; +using System.Reflection; + +/// +/// Custom readme editor window based on the readme created for URP. For more context, see: +/// https://github.com/Unity-Technologies/Graphics/tree/master/com.unity.template-universal +/// + +namespace Game.Readme +{ + [CustomEditor(typeof(Readme))] + [InitializeOnLoad] + public class ReadmeEditor : UnityEditor.Editor + { + const string k_ShowedReadmeSessionStateName = "ReadmeEditor.showedReadme"; + + const float k_Space = 16f; + + bool m_Initialized; + + [SerializeField] + GUIStyle m_LinkStyle; + + GUIStyle LinkStyle + { + get { return m_LinkStyle; } + } + + [SerializeField] + GUIStyle m_TitleStyle; + + GUIStyle TitleStyle + { + get { return m_TitleStyle; } + } + + [SerializeField] + GUIStyle m_HeadingStyle; + + GUIStyle HeadingStyle + { + get { return m_HeadingStyle; } + } + + [SerializeField] + GUIStyle m_BodyStyle; + + GUIStyle BodyStyle + { + get { return m_BodyStyle; } + } + + static ReadmeEditor() + { + EditorApplication.delayCall += SelectReadmeAutomatically; + } + + static void SelectReadmeAutomatically() + { + if (!SessionState.GetBool(k_ShowedReadmeSessionStateName, false)) + { + var readme = SelectReadme(); + SessionState.SetBool(k_ShowedReadmeSessionStateName, true); + + if (readme && !readme.loadedLayout) + { + LoadLayout(); + readme.loadedLayout = true; + } + } + } + + static void LoadLayout() + { + var assembly = typeof(EditorApplication).Assembly; + var windowLayoutType = assembly.GetType("UnityEditor.WindowLayout", true); + var method = windowLayoutType.GetMethod("LoadWindowLayout", BindingFlags.Public | BindingFlags.Static); + method?.Invoke(null, new object[] {Path.Combine(Application.dataPath, "TutorialInfo/Layout.wlt"), false}); + } + + [MenuItem("Sample/Show Sample Instructions")] + static Readme SelectReadme() + { + var ids = AssetDatabase.FindAssets("Readme t:Readme"); + if (ids.Length == 1) + { + var readmeObject = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); + + Selection.objects = new UnityEngine.Object[] {readmeObject}; + + return (Readme) readmeObject; + } + else + { + Debug.Log("Couldn't find a readme"); + return null; + } + } + + protected override void OnHeaderGUI() + { + var readme = (Readme) target; + Init(); + + var iconWidth = Mathf.Min(EditorGUIUtility.currentViewWidth / 3f - 20f, 128f); + + GUILayout.BeginHorizontal("In BigTitle"); + { + GUILayout.Label(readme.icon, GUILayout.Width(iconWidth), GUILayout.Height(iconWidth)); + GUILayout.Label(readme.title, TitleStyle); + } + GUILayout.EndHorizontal(); + } + + public override void OnInspectorGUI() + { + var readme = (Readme) target; + Init(); + + foreach (var section in readme.sections) + { + if (!string.IsNullOrEmpty(section.heading)) + { + GUILayout.Label(section.heading, HeadingStyle); + } + + if (!string.IsNullOrEmpty(section.text)) + { + GUILayout.Label(section.text, BodyStyle); + } + + if (!string.IsNullOrEmpty(section.linkText)) + { + if (LinkLabel(new GUIContent(section.linkText))) + { + Application.OpenURL(section.url); + } + } + + GUILayout.Space(k_Space); + } + } + + void Init() + { + if (m_Initialized) + return; + m_BodyStyle = new GUIStyle(EditorStyles.label); + m_BodyStyle.wordWrap = true; + m_BodyStyle.fontSize = 14; + + m_TitleStyle = new GUIStyle(m_BodyStyle); + m_TitleStyle.fontSize = 26; + + m_HeadingStyle = new GUIStyle(m_BodyStyle); + m_HeadingStyle.fontSize = 18; + + m_LinkStyle = new GUIStyle(m_BodyStyle); + m_LinkStyle.wordWrap = false; + + // Match selection color which works nicely for both light and dark skins + m_LinkStyle.normal.textColor = new Color(0x00 / 255f, 0x78 / 255f, 0xDA / 255f, 1f); + m_LinkStyle.stretchWidth = false; + + m_Initialized = true; + } + + bool LinkLabel(GUIContent label, params GUILayoutOption[] options) + { + var position = GUILayoutUtility.GetRect(label, LinkStyle, options); + + Handles.BeginGUI(); + Handles.color = LinkStyle.normal.textColor; + Handles.DrawLine(new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax)); + Handles.color = Color.white; + Handles.EndGUI(); + + EditorGUIUtility.AddCursorRect(position, MouseCursor.Link); + + return GUI.Button(position, label, LinkStyle); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs.meta new file mode 100644 index 000000000..6d6c13f54 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Editor/ReadmeEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fab904a2239c0154c88b5fc1eb15a624 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs new file mode 100644 index 000000000..b79af9b1c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs @@ -0,0 +1,30 @@ +using System; +using UnityEngine; + +/// +/// Custom readme class based on the readme created for URP. For more context, see: +/// https://github.com/Unity-Technologies/Graphics/tree/master/com.unity.template-universal +/// + +namespace Game.Readme +{ + [CreateAssetMenu] + public class Readme : ScriptableObject + { + public Texture2D icon; + public string title; + public Section[] sections; + public bool loadedLayout; + + [Serializable] + public class Section + { + public string heading; + public string text; + public string linkText; + public string url; + } + } +} + + diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs.meta new file mode 100644 index 000000000..7608d3888 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/Readme.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ce0e387261ddc34ba81ca7f2f1f7f73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png new file mode 100644 index 000000000..f61360734 Binary files /dev/null and b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png differ diff --git a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png.meta similarity index 69% rename from Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG.meta rename to Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png.meta index bdf1d4230..59db6a053 100644 --- a/Basic/ClientDriven/Assets/StarterAssets/TutorialInfo/Icons/ReadMeImg.PNG.meta +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Readme/ReadmeImage.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 44a17a5b205fcd349a24700e6f5615bd +guid: 06a678a9706d69242bc9e034adc27168 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 11 + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 1 @@ -24,6 +24,7 @@ TextureImporter: streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,12 +33,12 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: -1 - wrapV: -1 - wrapW: -1 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 nPOTScale: 1 lightmap: 0 compressionQuality: 50 @@ -62,6 +63,7 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform @@ -75,6 +77,30 @@ TextureImporter: overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] @@ -88,6 +114,7 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] + nameFileIdTable: {} spritePackingTag: pSDRemoveMatte: 0 pSDShowRemoveMatteOption: 0 diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared.meta new file mode 100644 index 000000000..b4e3c022e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84a484f47da8f1d49b05c62dbed738f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs new file mode 100644 index 000000000..f2c916a72 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using Unity.Collections; +using Unity.Netcode; + +namespace Game +{ + /// + /// A class that captures the value of an Addressable's AssetGUID into a string that is serializable/deserializable + /// by Netcode for GameObjects. This is heavily involved in ClientRpcs/ServerRpcs containing Addressable AssetGUIDs. + /// + public struct AddressableGUID : INetworkSerializable + { + // could use a byte or a short if client and server has the same list in the same order (use the index in the list instead of the actualy 128 bits for a full GUID) + public FixedString128Bytes Value; + + public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter + { + serializer.SerializeValue(ref Value); + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + public override string ToString() + { + return Value.ToString(); + } + } + + /// + /// A class that implements IEqualityComparer, for AddressableGUID comparisons that don't allocate memory since it + /// compares integer values instead of strings. + /// + public class AddressableGUIDEqualityComparer : IEqualityComparer + { + public int GetHashCode(AddressableGUID addressableGUID) + { + return addressableGUID.GetHashCode(); + } + + public bool Equals(AddressableGUID x, AddressableGUID y) + { + return x.GetHashCode().Equals(y.GetHashCode()); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs.meta new file mode 100644 index 000000000..4282f6280 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AddressableGUID.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f410356c134346e5a5b85b9235533eb1 +timeCreated: 1669644910 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs new file mode 100644 index 000000000..a6a840fa8 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs @@ -0,0 +1,138 @@ +using System; +using System.Linq; +using Game.UI; +using Unity.Netcode; +using UnityEngine; + +namespace Game +{ + /// + /// A class to bind UI events to invocations from , where client and host + /// connection requests are initiated. This class also listens for status updates from Netcode for GameObjects to + /// then display the appropriate UI elements. + /// + public sealed class AppController : MonoBehaviour + { + [SerializeField] + NetworkManager m_NetworkManager; + + [SerializeField] + OptionalConnectionManager m_ConnectionManager; + + [SerializeField] + IPMenuUI m_IPMenuUI; + + [SerializeField] + InGameUI m_InGameUI; + + void Awake() + { + DontDestroyOnLoad(this); + } + + void Start() + { + m_IPMenuUI.ResetUI(); + m_InGameUI.Hide(); + + m_NetworkManager.OnClientConnectedCallback += OnClientConnected; + m_NetworkManager.OnClientDisconnectCallback += OnClientDisconnect; + + m_IPMenuUI.HostButtonPressed += StartHost; + m_IPMenuUI.ClientButtonPressed += StartClient; + m_IPMenuUI.DisconnectButtonPressed += Disconnect; + } + + void OnDestroy() + { + m_NetworkManager.OnClientConnectedCallback -= OnClientConnected; + m_NetworkManager.OnClientDisconnectCallback -= OnClientDisconnect; + + if (m_IPMenuUI) + { + m_IPMenuUI.HostButtonPressed -= StartHost; + m_IPMenuUI.ClientButtonPressed -= StartClient; + m_IPMenuUI.DisconnectButtonPressed -= Disconnect; + } + } + + void OnClientConnected(ulong clientId) + { + m_IPMenuUI.HideIPConnectionMenu(); + + // for host + if (m_NetworkManager.IsHost) + { + if (clientId == m_NetworkManager.LocalClientId) + { + m_IPMenuUI.HostStarted(); + m_InGameUI.Show(InGameUI.ButtonVisibility.Server); + m_InGameUI.AddConnectionUIInstance(clientId, new int[] { }, new string[] { }); + } + else + { + // grab all loaded prefabs and represent that on the newly joined client + var loadedHashes = DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.Keys.Select(value => value.GetHashCode()).ToArray(); + var loadedNames = DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.Values.Select(value => value.Result.name).ToArray(); + m_InGameUI.AddConnectionUIInstance(clientId, loadedHashes, loadedNames); + } + } + else if (m_NetworkManager.IsClient) + { + // for clients that are not host + if (clientId == m_NetworkManager.LocalClientId) + { + m_IPMenuUI.ClientStarted(); + m_InGameUI.Show(InGameUI.ButtonVisibility.Client); + + // grab all locally loaded prefabs and represent that on local client + var loadedHashes = DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.Keys.Select(value => value.GetHashCode()).ToArray(); + var loadedNames = DynamicPrefabLoadingUtilities.LoadedDynamicPrefabResourceHandles.Values.Select(value => value.Result.name).ToArray(); + m_InGameUI.AddConnectionUIInstance(clientId, loadedHashes, loadedNames); + } + } + } + + void OnClientDisconnect(ulong clientId) + { + // when a connected client disconnects, remove their UI + if (m_NetworkManager.IsServer && clientId != NetworkManager.ServerClientId) + { + // if a connected client disconnects on the host + m_InGameUI.RemoveConnectionUIInstance(clientId); + } + else + { + // show connection UI only when the local client disconnects + m_IPMenuUI.ResetUI(); + m_InGameUI.RemoveConnectionUIInstance(m_NetworkManager.LocalClientId); + m_InGameUI.Hide(); + } + } + + void StartHost() + { + Debug.Log(nameof(StartHost)); + m_ConnectionManager.StartHostIp(m_IPMenuUI.IpAddress, m_IPMenuUI.Port); + } + + void StartClient() + { + Debug.Log(nameof(StartClient)); + m_ConnectionManager.StartClientIp(m_IPMenuUI.IpAddress, m_IPMenuUI.Port); + } + + public void Disconnect() + { + Debug.Log(nameof(Disconnect)); + m_ConnectionManager.RequestShutdown(); + m_InGameUI.DisconnectRequested(); + m_IPMenuUI.DisconnectRequested(); + } + + void OnApplicationQuit() + { + Disconnect(); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs.meta new file mode 100644 index 000000000..02dc8bcb8 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/AppController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a5dd989004df436d9e1f8777007d25a5 +timeCreated: 1667392139 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs new file mode 100644 index 000000000..82cc6d632 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Game +{ + /// + /// For the purposes of this sample, a hash representing the list of loaded network prefabs will be sent at a + /// connection request from a client to the server. + /// + [Serializable] + public class ConnectionPayload + { + public int hashOfDynamicPrefabGUIDs; + } + + /// + /// For the purposes of this sample, this class will be serialized inside of Netcode for GameObject's + /// DisconnectReason string, and sent to clients which failed to connect. It contains the reason enum, and the list + /// of Addressable GUIDs to load before reconnecting. + /// + [Serializable] + public class DisconnectionPayload + { + public DisconnectReason reason; + public List guids; + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs.meta new file mode 100644 index 000000000..e55d8fdf6 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionPayload.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fd1b26d10d6b4c4aa35539d26a7790ba +timeCreated: 1669644897 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs new file mode 100644 index 000000000..ff58a826c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs @@ -0,0 +1,31 @@ +using System; +using UnityEngine; + +namespace Game +{ + /// + /// Base class representing a connection state. + /// + abstract class ConnectionState + { + protected OptionalConnectionManager m_ConnectionManager; + + public abstract void Enter(); + + public abstract void Exit(); + + public virtual void OnClientConnected(ulong clientId) { } + + public virtual void OnClientDisconnect(ulong clientId) { } + + public virtual void OnServerStarted() { } + + public virtual void StartClientIP(string ipaddress, ushort port) { } + + public virtual void StartHostIP(string ipaddress, ushort port) { } + + public virtual void OnUserRequestedShutdown() { } + + public virtual void OnTransportFailure() { } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs.meta new file mode 100644 index 000000000..537ef5c6a --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d615c411030f0fe4ca225fa5694c9c31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates.meta new file mode 100644 index 000000000..35eef12ff --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b2138d9458cdcf45ae28870553a130c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs new file mode 100644 index 000000000..c1ee6c6e4 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to a connected client. When being disconnected, it transitions to the Offline + /// state. + /// + class ClientConnectedState : ConnectionState + { + public ClientConnectedState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() { } + + public override void Exit() { } + + public override void OnUserRequestedShutdown() + { + m_ConnectionManager.m_NetworkManager.Shutdown(); + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + + public override void OnClientDisconnect(ulong clientId) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs.meta new file mode 100644 index 000000000..492b2fd30 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectedState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bf62738d2748114a8ffafd28cc35f13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs new file mode 100644 index 000000000..2448ba137 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs @@ -0,0 +1,70 @@ +using System; +using Unity.Netcode.Transports.UTP; +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to when a client is attempting to connect to a server. Starts the client when + /// entering. If successful, transitions to the ClientConnected state. If not, transitions to the Offline state. + /// + class ClientConnectingState : ConnectionState + { + public ClientConnectingState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() + { + StartClient(); + } + + public override void Exit() { } + + void StartClient() + { + var transport = m_ConnectionManager.m_NetworkManager.GetComponent(); + transport.SetConnectionData(m_ConnectionManager.m_ConnectAddress, m_ConnectionManager.m_Port); + m_ConnectionManager.m_NetworkManager.NetworkConfig.ConnectionData = + DynamicPrefabLoadingUtilities.GenerateRequestPayload(); + m_ConnectionManager.m_NetworkManager.StartClient(); + } + + public override void OnClientConnected(ulong _) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_ClientConnected); + } + + public override void OnClientDisconnect(ulong _) + { + // client ID is for sure ours here + var disconnectReason = m_ConnectionManager.m_NetworkManager.DisconnectReason; + if (string.IsNullOrEmpty(disconnectReason)) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + else + { + var disconnectionPayload = JsonUtility.FromJson(disconnectReason); + + switch (disconnectionPayload.reason) + { + case DisconnectReason.Undefined: + Debug.Log("Disconnect reason is undefined"); + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + break; + case DisconnectReason.ClientNeedsToPreload: + { + Debug.Log("Client needs to preload"); + m_ConnectionManager.m_ClientPreloading.disconnectionPayload = disconnectionPayload; + m_ConnectionManager.ChangeState(m_ConnectionManager.m_ClientPreloading); + } + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs.meta new file mode 100644 index 000000000..31c74886c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientConnectingState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5be7272840fa61d4db96f1f4074be30d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs new file mode 100644 index 000000000..fabce9db0 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs @@ -0,0 +1,41 @@ +using System; +using System.Linq; +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to a client attempting to reconnect to a server once the server has determined + /// that the client needs to preload assets locally. This state handles parsing the information stored inside + /// the DisconnectionPayload received from NetworkManager and initiating the asynchronous process to preload assets. + /// Once the assets have been loaded locally, it will transition to the ClientConnecting state to reattempt a + /// connection. If the DisconnectReason is for whatever reason invalid, it will transition directly to the Offline + /// state. + /// + class ClientPreloadingState : ConnectionState + { + public DisconnectionPayload disconnectionPayload; + + public ClientPreloadingState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() + { + m_ConnectionManager.m_NetworkManager.Shutdown(); + HandleDisconnectReason(); + } + + async void HandleDisconnectReason() + { + var guids = disconnectionPayload.guids.Select(item => new AddressableGUID() { Value = item }).ToArray(); + + await DynamicPrefabLoadingUtilities.LoadDynamicPrefabs(guids); + Debug.Log("Restarting client"); + m_ConnectionManager.ChangeState(m_ConnectionManager.m_ClientConnecting); + } + + public override void Exit() { } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs.meta new file mode 100644 index 000000000..842b3631d --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/ClientPreloadingState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b461713133cc039449ff55dd75eaa182 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs new file mode 100644 index 000000000..10c6ba4b1 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to a listening host. Handles incoming client connections. When shutting down or + /// being timed out, transitions to the Offline state. + /// + class HostingState : ConnectionState + { + public HostingState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() { } + + public override void Exit() { } + + public override void OnUserRequestedShutdown() + { + m_ConnectionManager.m_NetworkManager.Shutdown(); + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + + public override void OnClientConnected(ulong clientId) + { + Debug.Log($"Client {clientId} connected"); + } + + public override void OnClientDisconnect(ulong clientId) + { + if (clientId == m_ConnectionManager.m_NetworkManager.LocalClientId) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + else + { + Debug.Log($"Client {clientId} disconnected"); + } + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs.meta new file mode 100644 index 000000000..436c60284 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/HostingState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f4702e033321534e8e35b9011a151da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs new file mode 100644 index 000000000..f43e45c25 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to when the NetworkManager is shut down. Also, all loaded prefabs are cleared + /// from memory, and NetworkManager's NetworkPrefabs array is cleared. From this state we can transition to the + /// ClientConnecting sate, if starting as a client, or the StartingHost state, if starting as a host. + /// + class OfflineState : ConnectionState + { + public OfflineState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() + { + DynamicPrefabLoadingUtilities.UnloadAndReleaseAllDynamicPrefabs(); + m_ConnectionManager.m_NetworkManager.Shutdown(); + } + + public override void Exit() { } + + public override void StartClientIP(string ipaddress, ushort port) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_ClientConnecting); + } + + public override void StartHostIP(string ipaddress, ushort port) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_StartingHost); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs.meta new file mode 100644 index 000000000..0194c4872 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/OfflineState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90494c0256cb9b146993db72c980c8b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs new file mode 100644 index 000000000..985b66804 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs @@ -0,0 +1,44 @@ +using Unity.Netcode.Transports.UTP; +using UnityEngine; + +namespace Game +{ + /// + /// Connection state corresponding to a host starting up. Starts the host when entering the state. If successful, + /// transitions to the Hosting state, if not, transitions back to the Offline state. + /// + class StartingHostState : ConnectionState + { + public StartingHostState(OptionalConnectionManager connectionManager) + { + m_ConnectionManager = connectionManager; + } + + public override void Enter() + { + StartHost(); + } + + public override void Exit() { } + + void StartHost() + { + var transport = m_ConnectionManager.m_NetworkManager.GetComponent(); + transport.SetConnectionData(m_ConnectionManager.m_ConnectAddress, m_ConnectionManager.m_Port); + m_ConnectionManager.m_NetworkManager.StartHost(); + } + + public override void OnClientDisconnect(ulong clientId) + { + if (clientId == m_ConnectionManager.m_NetworkManager.LocalClientId) + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline); + } + } + + public override void OnServerStarted() + { + m_ConnectionManager.ChangeState(m_ConnectionManager.m_Hosting); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs.meta new file mode 100644 index 000000000..070d37981 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/ConnectionStates/StartingHostState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4e4efdb05a4b0e48bfb3fc6a63f2960 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs new file mode 100644 index 000000000..b510e3867 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs @@ -0,0 +1,14 @@ +using System; + +namespace Game +{ + /// + /// Enum describing the reason a client was disconnected from the server. For the purposes of this sample, it will + /// be used mostly at connection request time, when the client needs to preload dynamic prefabs. + /// + public enum DisconnectReason + { + Undefined, + ClientNeedsToPreload, //client needs to preload the dynamic prefabs before connecting + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs.meta new file mode 100644 index 000000000..fcfa6b2a1 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DisconnectReason.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ff77e7705deb44c080bae09fa9c0968b +timeCreated: 1669644923 \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs new file mode 100644 index 000000000..630bb14a8 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs @@ -0,0 +1,200 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Unity.Netcode; +using UnityEngine; +using UnityEngine.AddressableAssets; +using UnityEngine.ResourceManagement.AsyncOperations; + +namespace Game +{ + /// + /// A utilities class to handle the loading, tracking, and disposing of loaded network prefabs. Connection and + /// disconnection payloads can be easily accessed from this class as well. + /// + /// + /// Artificial delay to the loading of a network prefab is disabled by default. To enable it, make sure to add + /// ENABLE_ARTIFICIAL_DELAY as a scripting define symbol to your project's Player settings. + /// + public static class DynamicPrefabLoadingUtilities + { + const int k_EmptyDynamicPrefabHash = -1; + + public static int HashOfDynamicPrefabGUIDs { get; private set; } = k_EmptyDynamicPrefabHash; + + static Dictionary> s_LoadedDynamicPrefabResourceHandles = new Dictionary>(new AddressableGUIDEqualityComparer()); + + static List s_DynamicPrefabGUIDs = new List(); //cached list to avoid GC + + //A storage where we keep the association between the dynamic prefab (hash of it's GUID) and the clients that have it loaded + static Dictionary> s_PrefabHashToClientIds = new Dictionary>(); + + public static bool HasClientLoadedPrefab(ulong clientId, int prefabHash) => + s_PrefabHashToClientIds.TryGetValue(prefabHash, out var clientIds) && clientIds.Contains(clientId); + + public static bool IsPrefabLoadedOnAllClients(AddressableGUID assetGuid) => + s_LoadedDynamicPrefabResourceHandles.ContainsKey(assetGuid); + + public static bool TryGetLoadedGameObjectFromGuid(AddressableGUID assetGuid, out AsyncOperationHandle loadedGameObject) + { + return s_LoadedDynamicPrefabResourceHandles.TryGetValue(assetGuid, out loadedGameObject); + } + + public static Dictionary> LoadedDynamicPrefabResourceHandles => s_LoadedDynamicPrefabResourceHandles; + + public static int LoadedPrefabCount => s_LoadedDynamicPrefabResourceHandles.Count; + + static NetworkManager s_NetworkManager; + + static DynamicPrefabLoadingUtilities() { } + + public static void Init(NetworkManager networkManager) + { + s_NetworkManager = networkManager; + } + + /// + /// This is not the most optimal algorithm for big quantities of Addressables, but easy enough to maintain for a + /// small number like in this sample. One could use a "client dirty" algorithm to mark clients needing loading + /// or not instead, but that would require more complex dirty management. + /// + public static void RecordThatClientHasLoadedAllPrefabs(ulong clientId) + { + foreach (var dynamicPrefabGUID in s_DynamicPrefabGUIDs) + { + RecordThatClientHasLoadedAPrefab(dynamicPrefabGUID.GetHashCode(), clientId); + } + } + + public static void RecordThatClientHasLoadedAPrefab(int assetGuidHash, ulong clientId) + { + if (s_PrefabHashToClientIds.TryGetValue(assetGuidHash, out var clientIds)) + { + clientIds.Add(clientId); + } + else + { + s_PrefabHashToClientIds.Add(assetGuidHash, new HashSet() { clientId }); + } + } + + public static byte[] GenerateRequestPayload() + { + var payload = JsonUtility.ToJson(new ConnectionPayload() + { + hashOfDynamicPrefabGUIDs = HashOfDynamicPrefabGUIDs + }); + + return System.Text.Encoding.UTF8.GetBytes(payload); + } + + /// + /// Testing showed that with the current implementation, Netcode for GameObjects will send the DisconnectReason + /// message as a non-fragmented message, meaning that the upper limit of this message in bytes is exactly + /// NON_FRAGMENTED_MESSAGE_MAX_SIZE bytes (1300 at the time of writing), defined inside of + /// . + /// For this reason, DisconnectReason should only be used to instruct the user "why" a connection failed, and + /// "where" to fetch the relevant connection data. We recommend using services like UGS to fetch larger batches + /// of data. + /// + public static string GenerateDisconnectionPayload() + { + var rejectionPayload = new DisconnectionPayload() + { + reason = DisconnectReason.ClientNeedsToPreload, + guids = s_DynamicPrefabGUIDs.Select(item => item.ToString()).ToList() + }; + + return JsonUtility.ToJson(rejectionPayload); + } + + public static async Task LoadDynamicPrefab(AddressableGUID guid, int artificialDelayMilliseconds, + bool recomputeHash = true) + { + if (s_LoadedDynamicPrefabResourceHandles.ContainsKey(guid)) + { + Debug.Log($"Prefab has already been loaded, skipping loading this time | {guid}"); + return s_LoadedDynamicPrefabResourceHandles[guid].Result; + } + + Debug.Log($"Loading dynamic prefab {guid.Value}"); + var op = Addressables.LoadAssetAsync(guid.ToString()); + var prefab = await op.Task; + +#if ENABLE_ARTIFICIAL_DELAY + // THIS IS FOR EDUCATIONAL PURPOSES AND SHOULDN'T BE INCLUDED IN YOUR PROJECT + await Task.Delay(artificialDelayMilliseconds); +#endif + + s_NetworkManager.AddNetworkPrefab(prefab); + s_LoadedDynamicPrefabResourceHandles.Add(guid, op); + + if (recomputeHash) + { + CalculateDynamicPrefabArrayHash(); + } + + return prefab; + } + + public static async Task> LoadDynamicPrefabs(AddressableGUID[] guids, + int artificialDelaySeconds = 0) + { + var tasks = new List>(); + + foreach (var guid in guids) + { + tasks.Add( LoadDynamicPrefab(guid, artificialDelaySeconds, recomputeHash:false)); + } + + var prefabs = await Task.WhenAll(tasks); + CalculateDynamicPrefabArrayHash(); + + return prefabs; + } + + public static void RefreshLoadedPrefabGuids() + { + s_DynamicPrefabGUIDs.Clear(); + s_DynamicPrefabGUIDs.AddRange(s_LoadedDynamicPrefabResourceHandles.Keys); + } + + static void CalculateDynamicPrefabArrayHash() + { + //we need to sort the array so that the hash is consistent across clients + //it's possible to use an order-independent hashing algorithm for some potential performance gains + RefreshLoadedPrefabGuids(); + s_DynamicPrefabGUIDs.Sort((a, b) => a.Value.CompareTo(b.Value)); + HashOfDynamicPrefabGUIDs = k_EmptyDynamicPrefabHash; + + //a simple hash combination algorithm suggested by Jon Skeet, + //found here: https://stackoverflow.com/questions/1646807/quick-and-simple-hash-code-combinations + //we can't use C# HashCode combine because it is unreliable across different processes (by design) + unchecked + { + int hash = 17; + for (var i = 0; i < s_DynamicPrefabGUIDs.Count; ++i) + { + hash = hash * 31 + s_DynamicPrefabGUIDs[i].GetHashCode(); + } + + HashOfDynamicPrefabGUIDs = hash; + } + + Debug.Log($"Calculated hash of dynamic prefabs: {HashOfDynamicPrefabGUIDs}"); + } + + public static void UnloadAndReleaseAllDynamicPrefabs() + { + HashOfDynamicPrefabGUIDs = k_EmptyDynamicPrefabHash; + + foreach (var handle in s_LoadedDynamicPrefabResourceHandles.Values) + { + s_NetworkManager.RemoveNetworkPrefab(handle.Result); + Addressables.Release(handle); + } + + s_LoadedDynamicPrefabResourceHandles.Clear(); + } + } +} diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs.meta new file mode 100644 index 000000000..258cd724e --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/DynamicPrefabLoadingUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c0fb606625053c43a0fd7769ac5d1a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs new file mode 100644 index 000000000..99d75103c --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs @@ -0,0 +1,117 @@ +using System; +using Unity.Netcode; +using UnityEngine; + +namespace Game +{ + /// + /// A state machine to track a client's connection state. + /// Note: this class is not absolutely necessary for dynamic prefab loading. It is simply added to for simpler + /// navigation of code through the different states of connection, particularly client reconnection and late join. + /// support. For more details, see the use-case. + /// + public class OptionalConnectionManager : MonoBehaviour + { + [SerializeField] + internal NetworkManager m_NetworkManager; + + ConnectionState m_CurrentState; + + internal OfflineState m_Offline; + + internal ClientConnectingState m_ClientConnecting; + + internal ClientConnectedState m_ClientConnected; + + internal ClientPreloadingState m_ClientPreloading; + + internal StartingHostState m_StartingHost; + + internal HostingState m_Hosting; + + internal string m_ConnectAddress; + + internal ushort m_Port; + + void Awake() + { + DontDestroyOnLoad(this); + } + + void Start() + { + m_Offline = new OfflineState(this); + m_ClientConnecting = new ClientConnectingState(this); + m_ClientConnected = new ClientConnectedState(this); + m_ClientPreloading = new ClientPreloadingState(this); + m_StartingHost = new StartingHostState(this); + m_Hosting = new HostingState(this); + + m_CurrentState = m_Offline; + + m_NetworkManager.OnClientConnectedCallback += OnClientConnectedCallback; + m_NetworkManager.OnClientDisconnectCallback += OnClientDisconnectCallback; + m_NetworkManager.OnServerStarted += OnServerStarted; + m_NetworkManager.OnTransportFailure += OnTransportFailure; + } + + void OnDestroy() + { + m_NetworkManager.OnClientConnectedCallback -= OnClientConnectedCallback; + m_NetworkManager.OnClientDisconnectCallback -= OnClientDisconnectCallback; + m_NetworkManager.OnServerStarted -= OnServerStarted; + m_NetworkManager.OnTransportFailure -= OnTransportFailure; + } + + void OnClientConnectedCallback(ulong clientId) + { + m_CurrentState.OnClientConnected(clientId); + } + + void OnClientDisconnectCallback(ulong clientId) + { + m_CurrentState.OnClientDisconnect(clientId); + } + + void OnServerStarted() + { + m_CurrentState.OnServerStarted(); + } + + void OnTransportFailure() + { + m_CurrentState.OnTransportFailure(); + } + + internal void ChangeState(ConnectionState nextState) + { + Debug.Log($"{name}: Changed connection state from {m_CurrentState.GetType().Name} to {nextState.GetType().Name}."); + + if (m_CurrentState != null) + { + m_CurrentState.Exit(); + } + m_CurrentState = nextState; + m_CurrentState.Enter(); + } + + public void StartClientIp(string ipaddress, ushort port) + { + m_ConnectAddress = ipaddress; + m_Port = port; + m_CurrentState.StartClientIP(ipaddress, port); + } + + public void StartHostIp(string ipaddress, ushort port) + { + m_ConnectAddress = ipaddress; + m_Port = port; + m_CurrentState.StartHostIP(ipaddress, port); + } + + public void RequestShutdown() + { + m_CurrentState.OnUserRequestedShutdown(); + } + } +} \ No newline at end of file diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs.meta new file mode 100644 index 000000000..837a065a2 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/Shared/OptionalConnectionManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d33480f8492cae4ea5d133f701bc398 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI.meta b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI.meta new file mode 100644 index 000000000..17a573621 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 311dfd29d74e0644693df66b0db992d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI/IPMenuUI.cs b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI/IPMenuUI.cs new file mode 100644 index 000000000..17124cbe7 --- /dev/null +++ b/Basic/DynamicAddressablesNetworkPrefabs/Assets/Scripts/UI/IPMenuUI.cs @@ -0,0 +1,166 @@ +using System; +using System.Text.RegularExpressions; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Game.UI +{ + public class IPMenuUI : MonoBehaviour + { + // UI Documents + [SerializeField] + UIDocument m_IPMenuUIDocument; + [SerializeField] + UIDocument m_ConnectionTypeUIDocument; + + // UI Roots + VisualElement m_IPMenuUIRoot; + VisualElement m_ConnectionTypeUIRoot; + + // UI Elements + TextField m_IPInputField; + TextField m_PortInputField; + Button m_ButtonHost; + Button m_ButtonClient; + Button m_ButtonDisconnect; + Label m_ConnectionTypeLabel; + + public string IpAddress { get; private set; } = "127.0.0.1"; + public ushort Port { get; private set; } = 9998; + + public event Action HostButtonPressed; + + public event Action ClientButtonPressed; + + public event Action DisconnectButtonPressed; + + void Awake() + { + SetupIPInputUI(); + + // register UI elements to methods using callbacks for when they're clicked + m_ButtonHost.clickable.clicked += OnHostButtonPressed; + m_ButtonClient.clickable.clicked += OnClientButtonPressed; + m_ButtonDisconnect.clickable.clicked += OnDisconnectButtonPressed; + m_IPInputField.RegisterValueChangedCallback(OnIpAddressChanged); + m_PortInputField.RegisterValueChangedCallback(OnPortChanged); + } + + void OnDestroy() + { + // un-register UI elements from methods using callbacks for when they're clicked + m_ButtonHost.clickable.clicked -= OnHostButtonPressed; + m_ButtonClient.clickable.clicked -= OnClientButtonPressed; + m_ButtonDisconnect.clickable.clicked -= OnDisconnectButtonPressed; + m_IPInputField.UnregisterValueChangedCallback(OnIpAddressChanged); + m_PortInputField.UnregisterValueChangedCallback(OnPortChanged); + } + + void Start() + { + ResetUI(); + m_IPInputField.value = IpAddress; + m_PortInputField.value = Port.ToString(); + } + + void OnHostButtonPressed() + { + HostButtonPressed?.Invoke(); + } + + void OnClientButtonPressed() + { + ClientButtonPressed?.Invoke(); + } + + void OnDisconnectButtonPressed() + { + DisconnectButtonPressed?.Invoke(); + } + + public void HostStarted() + { + SwitchToInGameUI("Host"); + } + + public void ClientStarted() + { + SwitchToInGameUI("Client"); + } + + public void HideIPConnectionMenu() + { + SetUIElementVisibility(m_IPMenuUIRoot, false); + } + + void SwitchToInGameUI(string connectionType) + { + SetUIElementVisibility(m_IPMenuUIRoot, false); + SetUIElementVisibility(m_ConnectionTypeUIRoot, true); + m_ConnectionTypeLabel.text = connectionType; + } + + public void DisconnectRequested() + { + ResetUI(); + } + + public void ResetUI() + { + SetUIElementVisibility(m_IPMenuUIRoot, true); + SetUIElementVisibility(m_ConnectionTypeUIRoot, false); + } + + void OnIpAddressChanged(ChangeEvent ipAddress) + { + SanitizeAndSetIpAddress(ipAddress.newValue); + } + + void OnPortChanged(ChangeEvent port) + { + SanitizeAndSetPort(port.newValue); + } + + void SanitizeAndSetPort(string portToSanitize) + { + var sanitizedPort = Sanitize(portToSanitize); + m_PortInputField.value = sanitizedPort; + ushort.TryParse(sanitizedPort, out var parsedPort); + Port = parsedPort; + m_PortInputField.value = Port.ToString(); + } + + void SanitizeAndSetIpAddress(string ipAddressToSanitize) + { + IpAddress = Sanitize(ipAddressToSanitize); + m_IPInputField.value = IpAddress; + } + + /// + /// Sanitize user port InputField box allowing only alphanumerics and '.' + /// + /// string to sanitize. + /// Sanitized text string. + string Sanitize(string stringToBeSanitized) + { + return Regex.Replace(stringToBeSanitized, "[^A-Za-z0-9.]", ""); + } + + void SetUIElementVisibility(VisualElement element, bool isVisible) + { + element.style.display = isVisible ? DisplayStyle.Flex : DisplayStyle.None; + } + + void SetupIPInputUI() + { + m_IPMenuUIRoot = m_IPMenuUIDocument.rootVisualElement; + m_ConnectionTypeUIRoot = m_ConnectionTypeUIDocument.rootVisualElement; + m_IPInputField = m_IPMenuUIRoot.Q("IPAddressField"); + m_PortInputField = m_IPMenuUIRoot.Q("PortField"); + m_ButtonHost = m_IPMenuUIRoot.Q