Skip to content

Commit 4787992

Browse files
Merge pull request #153 from Unity-Technologies/release/v1.5.0
release: v1.5.0
2 parents b333f4d + 315b714 commit 4787992

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+554
-266
lines changed

Basic/2DSpaceShooter/Assets/Prefabs/Ship.prefab

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ GameObject:
1111
- component: {fileID: 400000}
1212
- component: {fileID: 5000000}
1313
- component: {fileID: 5800000}
14+
- component: {fileID: 509584576524893815}
1415
- component: {fileID: 11400004}
1516
- component: {fileID: 8200000}
1617
- component: {fileID: 8200002}
17-
- component: {fileID: 509584576524893815}
1818
- component: {fileID: -360930162699739946}
1919
- component: {fileID: -8406883944196582507}
2020
- component: {fileID: 7896695181562740567}
@@ -33,6 +33,7 @@ Transform:
3333
m_PrefabInstance: {fileID: 0}
3434
m_PrefabAsset: {fileID: 0}
3535
m_GameObject: {fileID: 100000}
36+
serializedVersion: 2
3637
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
3738
m_LocalPosition: {x: 16.686096, y: -1.5172029, z: 0}
3839
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
@@ -41,7 +42,6 @@ Transform:
4142
- {fileID: 400004}
4243
- {fileID: 1255143139002862940}
4344
m_Father: {fileID: 0}
44-
m_RootOrder: 0
4545
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
4646
--- !u!50 &5000000
4747
Rigidbody2D:
@@ -105,6 +105,26 @@ CircleCollider2D:
105105
m_Offset: {x: 0, y: 0}
106106
serializedVersion: 2
107107
m_Radius: 0.64
108+
--- !u!114 &509584576524893815
109+
MonoBehaviour:
110+
m_ObjectHideFlags: 0
111+
m_CorrespondingSourceObject: {fileID: 0}
112+
m_PrefabInstance: {fileID: 0}
113+
m_PrefabAsset: {fileID: 0}
114+
m_GameObject: {fileID: 100000}
115+
m_Enabled: 1
116+
m_EditorHideFlags: 0
117+
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
118+
m_Name:
119+
m_EditorClassIdentifier:
120+
GlobalObjectIdHash: 4192032552
121+
AlwaysReplicateAsRoot: 0
122+
SynchronizeTransform: 1
123+
ActiveSceneSynchronization: 0
124+
SceneMigrationSynchronization: 1
125+
SpawnWithObservers: 1
126+
DontDestroyWithOwner: 0
127+
AutoObjectParentSync: 1
108128
--- !u!114 &11400004
109129
MonoBehaviour:
110130
m_ObjectHideFlags: 0
@@ -173,7 +193,7 @@ MonoBehaviour:
173193
byte0028: 0
174194
byte0029: 0
175195
m_Friction: {fileID: 19800002}
176-
m_Thrust: {fileID: 19800000}
196+
m_ThrustParticleSystem: {fileID: 19800000}
177197
m_ShipGlow: {fileID: 5983711199006031825}
178198
m_ShipGlowDefaultColor: {r: 1, g: 1, b: 1, a: 1}
179199
m_UIDocument: {fileID: 7896695181562740567}
@@ -370,25 +390,6 @@ AudioSource:
370390
m_PreInfinity: 2
371391
m_PostInfinity: 2
372392
m_RotationOrder: 4
373-
--- !u!114 &509584576524893815
374-
MonoBehaviour:
375-
m_ObjectHideFlags: 0
376-
m_CorrespondingSourceObject: {fileID: 0}
377-
m_PrefabInstance: {fileID: 0}
378-
m_PrefabAsset: {fileID: 0}
379-
m_GameObject: {fileID: 100000}
380-
m_Enabled: 1
381-
m_EditorHideFlags: 0
382-
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
383-
m_Name:
384-
m_EditorClassIdentifier:
385-
GlobalObjectIdHash: 951099334
386-
AlwaysReplicateAsRoot: 0
387-
SynchronizeTransform: 1
388-
ActiveSceneSynchronization: 0
389-
SceneMigrationSynchronization: 1
390-
DontDestroyWithOwner: 0
391-
AutoObjectParentSync: 1
392393
--- !u!114 &-360930162699739946
393394
MonoBehaviour:
394395
m_ObjectHideFlags: 0
@@ -485,13 +486,13 @@ Transform:
485486
m_PrefabInstance: {fileID: 0}
486487
m_PrefabAsset: {fileID: 0}
487488
m_GameObject: {fileID: 100002}
489+
serializedVersion: 2
488490
m_LocalRotation: {x: 0.70710284, y: 0.0023588336, z: -0.70710295, w: 0.0023588329}
489491
m_LocalPosition: {x: -1.73, y: 0.05, z: 0.46}
490492
m_LocalScale: {x: 1.26, y: 1.26, z: 1.26}
491493
m_ConstrainProportionsScale: 0
492494
m_Children: []
493495
m_Father: {fileID: 1255143139002862940}
494-
m_RootOrder: 1
495496
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
496497
--- !u!198 &19800000
497498
ParticleSystem:
@@ -5287,13 +5288,15 @@ ParticleSystemRenderer:
52875288
m_RenderAlignment: 0
52885289
m_Pivot: {x: 0, y: 0, z: 0}
52895290
m_Flip: {x: 0, y: 0, z: 0}
5290-
m_UseCustomVertexStreams: 0
52915291
m_EnableGPUInstancing: 0
52925292
m_ApplyActiveColorSpace: 0
52935293
m_AllowRoll: 1
52945294
m_FreeformStretching: 0
52955295
m_RotateWithStretchDirection: 1
5296+
m_UseCustomVertexStreams: 0
52965297
m_VertexStreams: 0001030405
5298+
m_UseCustomTrailVertexStreams: 0
5299+
m_TrailVertexStreams: 00010304
52975300
m_Mesh: {fileID: 0}
52985301
m_Mesh1: {fileID: 0}
52995302
m_Mesh2: {fileID: 0}
@@ -5328,13 +5331,13 @@ Transform:
53285331
m_PrefabInstance: {fileID: 0}
53295332
m_PrefabAsset: {fileID: 0}
53305333
m_GameObject: {fileID: 100004}
5334+
serializedVersion: 2
53315335
m_LocalRotation: {x: 0, y: 1, z: 0, w: -0}
53325336
m_LocalPosition: {x: 0.45, y: -0.019937, z: 0}
53335337
m_LocalScale: {x: 1, y: 1, z: 1}
53345338
m_ConstrainProportionsScale: 0
53355339
m_Children: []
53365340
m_Father: {fileID: 400000}
5337-
m_RootOrder: 0
53385341
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
53395342
--- !u!198 &19800002
53405343
ParticleSystem:
@@ -10130,13 +10133,15 @@ ParticleSystemRenderer:
1013010133
m_RenderAlignment: 0
1013110134
m_Pivot: {x: 0, y: 0, z: 0}
1013210135
m_Flip: {x: 0, y: 0, z: 0}
10133-
m_UseCustomVertexStreams: 0
1013410136
m_EnableGPUInstancing: 0
1013510137
m_ApplyActiveColorSpace: 0
1013610138
m_AllowRoll: 1
1013710139
m_FreeformStretching: 0
1013810140
m_RotateWithStretchDirection: 1
10141+
m_UseCustomVertexStreams: 0
1013910142
m_VertexStreams: 0001030405
10143+
m_UseCustomTrailVertexStreams: 0
10144+
m_TrailVertexStreams: 00010304
1014010145
m_Mesh: {fileID: 0}
1014110146
m_Mesh1: {fileID: 0}
1014210147
m_Mesh2: {fileID: 0}
@@ -10170,6 +10175,7 @@ Transform:
1017010175
m_PrefabInstance: {fileID: 0}
1017110176
m_PrefabAsset: {fileID: 0}
1017210177
m_GameObject: {fileID: 4711364113217113794}
10178+
serializedVersion: 2
1017310179
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1017410180
m_LocalPosition: {x: 0.27, y: 0, z: 0}
1017510181
m_LocalScale: {x: 0.3890193, y: 0.3890193, z: 0.3890193}
@@ -10178,7 +10184,6 @@ Transform:
1017810184
- {fileID: 389295837323142884}
1017910185
- {fileID: 400002}
1018010186
m_Father: {fileID: 400000}
10181-
m_RootOrder: 1
1018210187
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1018310188
--- !u!212 &3390849995755675818
1018410189
SpriteRenderer:
@@ -10256,13 +10261,13 @@ Transform:
1025610261
m_PrefabInstance: {fileID: 0}
1025710262
m_PrefabAsset: {fileID: 0}
1025810263
m_GameObject: {fileID: 6021497113750022543}
10264+
serializedVersion: 2
1025910265
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
1026010266
m_LocalPosition: {x: -0, y: 0, z: 0.07}
1026110267
m_LocalScale: {x: 1, y: 1, z: 1}
1026210268
m_ConstrainProportionsScale: 0
1026310269
m_Children: []
1026410270
m_Father: {fileID: 1255143139002862940}
10265-
m_RootOrder: 0
1026610271
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1026710272
--- !u!212 &5983711199006031825
1026810273
SpriteRenderer:

Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using Unity.Collections;
1+
using Unity.Collections;
32
using Unity.Netcode;
43
using UnityEngine;
54
using UnityEngine.Assertions;
@@ -74,7 +73,7 @@ public class ShipControl : NetworkBehaviour
7473
ParticleSystem m_Friction;
7574

7675
[SerializeField]
77-
ParticleSystem m_Thrust;
76+
ParticleSystem m_ThrustParticleSystem;
7877

7978
[SerializeField]
8079
SpriteRenderer m_ShipGlow;
@@ -107,7 +106,7 @@ public class ShipControl : NetworkBehaviour
107106
float m_OldSpin = 0;
108107

109108
// server movement
110-
private NetworkVariable<float> m_Thrusting = new NetworkVariable<float>();
109+
float m_Thrust;
111110

112111
float m_Spin;
113112

@@ -119,7 +118,7 @@ void Awake()
119118
m_ObjectPool = GameObject.FindWithTag(s_ObjectPoolTag).GetComponent<NetworkObjectPool>();
120119
Assert.IsNotNull(m_ObjectPool, $"{nameof(NetworkObjectPool)} not found in scene. Did you apply the {s_ObjectPoolTag} to the GameObject?");
121120

122-
m_ThrustMain = m_Thrust.main;
121+
m_ThrustMain = m_ThrustParticleSystem.main;
123122
m_ShipGlow.color = m_ShipGlowDefaultColor;
124123
m_IsBuffed = false;
125124

@@ -152,8 +151,8 @@ public override void OnNetworkSpawn()
152151
}
153152
Energy.OnValueChanged += OnEnergyChanged;
154153
Health.OnValueChanged += OnHealthChanged;
155-
OnEnergyChanged(0, Health.Value);
156-
OnHealthChanged(0, Energy.Value);
154+
OnEnergyChanged(0, Energy.Value);
155+
OnHealthChanged(0, Health.Value);
157156

158157
SetPlayerName(PlayerName.Value.ToString().ToUpper());
159158
}
@@ -194,8 +193,7 @@ public void TakeDamage(int amount)
194193

195194
void Fire(Vector3 direction)
196195
{
197-
fireSound.Play();
198-
196+
PlayFireSoundClientRpc();
199197
var damage = 5;
200198
if (QuadDamageTimer.Value > NetworkManager.ServerTime.TimeAsFloat)
201199
{
@@ -271,15 +269,15 @@ void UpdateServer()
271269
m_Rigidbody2D.angularVelocity = rotate;
272270

273271
// update thrust
274-
if (m_Thrusting.Value != 0)
272+
if (m_Thrust != 0)
275273
{
276274
float accel = m_Acceleration;
277275
if (SpeedBuffTimer.Value > NetworkManager.ServerTime.TimeAsFloat)
278276
{
279277
accel *= 2;
280278
}
281279

282-
Vector3 thrustVec = transform.right * (m_Thrusting.Value * accel);
280+
Vector3 thrustVec = transform.right * (m_Thrust * accel);
283281
m_Rigidbody2D.AddForce(thrustVec);
284282

285283
// restrict max speed
@@ -499,12 +497,19 @@ void OnCollisionEnter2D(Collision2D other)
499497
}
500498
}
501499

500+
// --- ClientRPCs ---
501+
502+
[ClientRpc]
503+
void PlayFireSoundClientRpc()
504+
{
505+
fireSound.Play();
506+
}
502507
// --- ServerRPCs ---
503508

504509
[ServerRpc]
505510
public void ThrustServerRpc(float thrusting, int spin)
506511
{
507-
m_Thrusting.Value = thrusting;
512+
m_Thrust = thrusting;
508513
m_Spin = spin;
509514
}
510515

Basic/2DSpaceShooter/Packages/manifest.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"dependencies": {
33
"com.unity.2d.sprite": "1.0.0",
4-
"com.unity.ai.navigation": "1.1.4",
5-
"com.unity.collab-proxy": "2.0.7",
6-
"com.unity.ide.rider": "3.0.24",
7-
"com.unity.ide.visualstudio": "2.0.18",
4+
"com.unity.ai.navigation": "1.1.5",
5+
"com.unity.collab-proxy": "2.2.0",
6+
"com.unity.ide.rider": "3.0.26",
7+
"com.unity.ide.visualstudio": "2.0.22",
88
"com.unity.ide.vscode": "1.2.5",
9-
"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",
10-
"com.unity.netcode.gameobjects": "1.6.0",
9+
"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop#v2.4.0",
10+
"com.unity.netcode.gameobjects": "1.7.1",
1111
"com.unity.postprocessing": "3.2.2",
12-
"com.unity.render-pipelines.universal": "14.0.8",
12+
"com.unity.render-pipelines.universal": "14.0.9",
1313
"com.unity.test-framework": "1.1.33",
1414
"com.unity.textmeshpro": "3.0.6",
15-
"com.unity.timeline": "1.7.5",
15+
"com.unity.timeline": "1.7.6",
1616
"com.unity.ugui": "1.0.0",
1717
"com.veriorpies.parrelsync": "https://github.com/VeriorPies/ParrelSync.git?path=/ParrelSync#bb3d5067e49e403d8b8ba15c036d313b4dd2c696",
1818
"com.unity.modules.ai": "1.0.0",

0 commit comments

Comments
 (0)