Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Basic/2DSpaceShooter/Assets/Scripts/Asteroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void Awake()
Assert.IsNotNull(m_ObjectPool, $"{nameof(NetworkObjectPool)} not found in scene. Did you apply the {s_ObjectPoolTag} to the GameObject?");
}

// Use this for initialization
void Start()
{
numAsteroids += 1;
Expand Down Expand Up @@ -61,7 +60,7 @@ public void Explode()
var go = m_ObjectPool.GetNetworkObject(asteroidPrefab, transform.position + diff, Quaternion.identity);

var asteroid = go.GetComponent<Asteroid>();
asteroid.Size.Value = newSize;
asteroid.Size = new NetworkVariable<int>(newSize);
asteroid.asteroidPrefab = asteroidPrefab;
go.GetComponent<NetworkObject>().Spawn();
go.GetComponent<Rigidbody2D>().AddForce(diff * 10, ForceMode2D.Impulse);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
Expand Down
13 changes: 8 additions & 5 deletions Basic/2DSpaceShooter/Assets/Scripts/Spawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ void SpawnAsteroids()
go.transform.position = new Vector3(Random.Range(-40, 40), Random.Range(-40, 40));

go.transform.localScale = new Vector3(4, 4, 4);
go.GetComponent<Asteroid>().Size.Value = 4;

var asteroid = go.GetComponent<Asteroid>();
asteroid.Size = new NetworkVariable<int>(4);

float dx = Random.Range(-40, 40) / 10.0f;
float dy = Random.Range(-40, 40) / 10.0f;
float dir = Random.Range(-40, 40);
go.transform.rotation = Quaternion.Euler(0, 0, dir);
go.GetComponent<Rigidbody2D>().angularVelocity = dir;
go.GetComponent<Rigidbody2D>().velocity = new Vector2(dx, dy);
go.GetComponent<Asteroid>().asteroidPrefab = m_AsteroidPrefab;
go.GetComponent<NetworkObject>().Spawn( true); // TODO
var rigidbody2D = go.GetComponent<Rigidbody2D>();
rigidbody2D.angularVelocity = dir;
rigidbody2D.velocity = new Vector2(dx, dy);
asteroid.asteroidPrefab = m_AsteroidPrefab;
asteroid.NetworkObject.Spawn(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ MonoBehaviour:
type: 3}
objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486,
type: 3}
dataDrivenLensFlare: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92,
type: 3}
m_AssetVersion: 2
m_OpaqueLayerMask:
serializedVersion: 2
Expand Down
14 changes: 7 additions & 7 deletions Basic/2DSpaceShooter/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.ai.navigation": "1.1.3",
"com.unity.collab-proxy": "2.0.4",
"com.unity.ide.rider": "3.0.21",
"com.unity.ai.navigation": "1.1.4",
"com.unity.collab-proxy": "2.0.7",
"com.unity.ide.rider": "3.0.24",
"com.unity.ide.visualstudio": "2.0.18",
"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#v2.2.0",
"com.unity.netcode.gameobjects": "1.4.0",
"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.3.0",
"com.unity.netcode.gameobjects": "1.6.0",
"com.unity.postprocessing": "3.2.2",
"com.unity.render-pipelines.universal": "14.0.7",
"com.unity.render-pipelines.universal": "14.0.8",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.4",
"com.unity.timeline": "1.7.5",
"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",
Expand Down
44 changes: 22 additions & 22 deletions Basic/2DSpaceShooter/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {}
},
"com.unity.ai.navigation": {
"version": "1.1.3",
"version": "1.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -16,7 +16,7 @@
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.4",
"version": "1.8.8",
"depth": 1,
"source": "registry",
"dependencies": {
Expand All @@ -25,7 +25,7 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.0.4",
"version": "2.0.7",
"depth": 0,
"source": "registry",
"dependencies": {},
Expand Down Expand Up @@ -56,7 +56,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.21",
"version": "3.0.24",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -98,16 +98,16 @@
"url": "https://packages.unity.com"
},
"com.unity.multiplayer.samples.coop": {
"version": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.2.0",
"version": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.3.0",
"depth": 0,
"source": "git",
"dependencies": {
"com.unity.learn.iet-framework": "1.2.1",
"com.unity.learn.iet-framework": "3.1.3",
"com.unity.multiplayer.tools": "1.1.0",
"com.unity.netcode.gameobjects": "1.4.0",
"com.unity.services.relay": "1.0.3"
"com.unity.netcode.gameobjects": "1.6.0",
"com.unity.services.relay": "1.0.5"
},
"hash": "0cd402eaea1969d4e9f894a5bc6c90432e12ab02"
"hash": "a93b8cee21c60b890838405bb629d245cfae30e6"
},
"com.unity.multiplayer.tools": {
"version": "1.1.0",
Expand All @@ -123,12 +123,12 @@
"url": "https://packages.unity.com"
},
"com.unity.netcode.gameobjects": {
"version": "1.4.0",
"version": "1.6.0",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.nuget.mono-cecil": "1.10.1",
"com.unity.transport": "1.3.3"
"com.unity.transport": "1.3.4"
},
"url": "https://packages.unity.com"
},
Expand Down Expand Up @@ -163,7 +163,7 @@
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.core": {
"version": "14.0.7",
"version": "14.0.8",
"depth": 1,
"source": "builtin",
"dependencies": {
Expand All @@ -174,14 +174,14 @@
}
},
"com.unity.render-pipelines.universal": {
"version": "14.0.7",
"version": "14.0.8",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.mathematics": "1.2.1",
"com.unity.burst": "1.8.4",
"com.unity.render-pipelines.core": "14.0.7",
"com.unity.shadergraph": "14.0.7"
"com.unity.render-pipelines.core": "14.0.8",
"com.unity.shadergraph": "14.0.8"
}
},
"com.unity.searcher": {
Expand All @@ -192,19 +192,19 @@
"url": "https://packages.unity.com"
},
"com.unity.services.authentication": {
"version": "2.5.0",
"version": "2.7.2",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.services.core": "1.9.0",
"com.unity.services.core": "1.10.1",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.9.0",
"version": "1.11.0",
"depth": 2,
"source": "registry",
"dependencies": {
Expand All @@ -215,7 +215,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.qos": {
"version": "1.2.0",
"version": "1.2.1",
"depth": 2,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -253,11 +253,11 @@
"url": "https://packages.unity.com"
},
"com.unity.shadergraph": {
"version": "14.0.7",
"version": "14.0.8",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.render-pipelines.core": "14.0.7",
"com.unity.render-pipelines.core": "14.0.8",
"com.unity.searcher": "4.9.2"
}
},
Expand All @@ -282,7 +282,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.7.4",
"version": "1.7.5",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
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: 2727d53a542a4c1aa312905c3a02d807, type: 3}
m_Name:
m_EditorClassIdentifier:
NetworkPrefabsPath: Assets/DefaultNetworkPrefabs.asset
TempNetworkPrefabsPath: Assets/DefaultNetworkPrefabs.asset
GenerateDefaultNetworkPrefabs: 0
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ PlayerSettings:
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
dedicatedServerOptimizations: 0
bakeCollisionMeshes: 0
forceSingleInstance: 0
useFlipModelSwapchain: 1
Expand Down Expand Up @@ -125,6 +126,7 @@ PlayerSettings:
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
switchNVNGraphicsFirmwareMemory: 32
switchMaxWorkerMultiple: 8
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
Expand Down Expand Up @@ -160,6 +162,7 @@ PlayerSettings:
tvOS: com.Company.ProductName
buildNumber:
Standalone: 0
VisionOS: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 0
Expand All @@ -184,6 +187,8 @@ PlayerSettings:
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 12.0
VisionOSSdkVersion: 0
VisionOSTargetOSVersionString: 1.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
Expand Down Expand Up @@ -231,8 +236,10 @@ PlayerSettings:
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
VisionOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
tvOSManualSigningProvisioningProfileType: 0
VisionOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
Expand Down Expand Up @@ -817,6 +824,7 @@ PlayerSettings:
QNX: UNITY_POST_PROCESSING_STACK_V2
Stadia: UNITY_POST_PROCESSING_STACK_V2
Standalone: UNITY_POST_PROCESSING_STACK_V2
VisionOS: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2
Windows Store Apps: UNITY_POST_PROCESSING_STACK_V2
XboxOne: UNITY_POST_PROCESSING_STACK_V2
Expand Down Expand Up @@ -845,7 +853,6 @@ PlayerSettings:
suppressCommonWarnings: 1
allowUnsafeCode: 0
useDeterministicCompilation: 1
selectedPlatform: 0
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
Expand Down
4 changes: 2 additions & 2 deletions Basic/2DSpaceShooter/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2022.3.0f1
m_EditorVersionWithRevision: 2022.3.0f1 (fb119bb0b476)
m_EditorVersion: 2022.3.9f1
m_EditorVersionWithRevision: 2022.3.9f1 (ea401c316338)
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MonoBehaviour:
blitHDROverlay: {fileID: 4800000, guid: a89bee29cffa951418fc1e2da94d1959, type: 3}
cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3}
objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, type: 3}
dataDrivenLensFlare: {fileID: 4800000, guid: 6cda457ac28612740adb23da5d39ea92, type: 3}
m_AssetVersion: 2
m_OpaqueLayerMask:
serializedVersion: 2
Expand Down
16 changes: 8 additions & 8 deletions Basic/ClientDriven/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"dependencies": {
"com.unity.ai.navigation": "1.1.3",
"com.unity.ai.navigation": "1.1.4",
"com.unity.cinemachine": "2.9.5",
"com.unity.collab-proxy": "2.0.4",
"com.unity.ide.rider": "3.0.21",
"com.unity.collab-proxy": "2.0.7",
"com.unity.ide.rider": "3.0.24",
"com.unity.ide.visualstudio": "2.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.inputsystem": "1.5.1",
"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.2.0",
"com.unity.netcode.gameobjects": "1.4.0",
"com.unity.render-pipelines.universal": "14.0.7",
"com.unity.inputsystem": "1.7.0",
"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.3.0",
"com.unity.netcode.gameobjects": "1.6.0",
"com.unity.render-pipelines.universal": "14.0.8",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.4",
"com.unity.timeline": "1.7.5",
"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",
Expand Down
Loading