Skip to content

Commit

Permalink
Merge pull request #153 from Unity-Technologies/release/v1.5.0
Browse files Browse the repository at this point in the history
release: v1.5.0
  • Loading branch information
fernando-cortez committed Dec 15, 2023
2 parents b333f4d + 315b714 commit 4787992
Show file tree
Hide file tree
Showing 43 changed files with 554 additions and 266 deletions.
61 changes: 33 additions & 28 deletions Basic/2DSpaceShooter/Assets/Prefabs/Ship.prefab
Expand Up @@ -11,10 +11,10 @@ GameObject:
- component: {fileID: 400000}
- component: {fileID: 5000000}
- component: {fileID: 5800000}
- component: {fileID: 509584576524893815}
- component: {fileID: 11400004}
- component: {fileID: 8200000}
- component: {fileID: 8200002}
- component: {fileID: 509584576524893815}
- component: {fileID: -360930162699739946}
- component: {fileID: -8406883944196582507}
- component: {fileID: 7896695181562740567}
Expand All @@ -33,6 +33,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 16.686096, y: -1.5172029, z: 0}
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
Expand All @@ -41,7 +42,6 @@ Transform:
- {fileID: 400004}
- {fileID: 1255143139002862940}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &5000000
Rigidbody2D:
Expand Down Expand Up @@ -105,6 +105,26 @@ CircleCollider2D:
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.64
--- !u!114 &509584576524893815
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: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 4192032552
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 1
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
--- !u!114 &11400004
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -173,7 +193,7 @@ MonoBehaviour:
byte0028: 0
byte0029: 0
m_Friction: {fileID: 19800002}
m_Thrust: {fileID: 19800000}
m_ThrustParticleSystem: {fileID: 19800000}
m_ShipGlow: {fileID: 5983711199006031825}
m_ShipGlowDefaultColor: {r: 1, g: 1, b: 1, a: 1}
m_UIDocument: {fileID: 7896695181562740567}
Expand Down Expand Up @@ -370,25 +390,6 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &509584576524893815
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: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier:
GlobalObjectIdHash: 951099334
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
--- !u!114 &-360930162699739946
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -485,13 +486,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
serializedVersion: 2
m_LocalRotation: {x: 0.70710284, y: 0.0023588336, z: -0.70710295, w: 0.0023588329}
m_LocalPosition: {x: -1.73, y: 0.05, z: 0.46}
m_LocalScale: {x: 1.26, y: 1.26, z: 1.26}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1255143139002862940}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!198 &19800000
ParticleSystem:
Expand Down Expand Up @@ -5287,13 +5288,15 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 0
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 0001030405
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
Expand Down Expand Up @@ -5328,13 +5331,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 1, z: 0, w: -0}
m_LocalPosition: {x: 0.45, y: -0.019937, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400000}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!198 &19800002
ParticleSystem:
Expand Down Expand Up @@ -10130,13 +10133,15 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 0
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 0001030405
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
Expand Down Expand Up @@ -10170,6 +10175,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4711364113217113794}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.27, y: 0, z: 0}
m_LocalScale: {x: 0.3890193, y: 0.3890193, z: 0.3890193}
Expand All @@ -10178,7 +10184,6 @@ Transform:
- {fileID: 389295837323142884}
- {fileID: 400002}
m_Father: {fileID: 400000}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3390849995755675818
SpriteRenderer:
Expand Down Expand Up @@ -10256,13 +10261,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6021497113750022543}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0.07}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1255143139002862940}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &5983711199006031825
SpriteRenderer:
Expand Down
29 changes: 17 additions & 12 deletions Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs
@@ -1,5 +1,4 @@
using System;
using Unity.Collections;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Assertions;
Expand Down Expand Up @@ -74,7 +73,7 @@ public class ShipControl : NetworkBehaviour
ParticleSystem m_Friction;

[SerializeField]
ParticleSystem m_Thrust;
ParticleSystem m_ThrustParticleSystem;

[SerializeField]
SpriteRenderer m_ShipGlow;
Expand Down Expand Up @@ -107,7 +106,7 @@ public class ShipControl : NetworkBehaviour
float m_OldSpin = 0;

// server movement
private NetworkVariable<float> m_Thrusting = new NetworkVariable<float>();
float m_Thrust;

float m_Spin;

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

m_ThrustMain = m_Thrust.main;
m_ThrustMain = m_ThrustParticleSystem.main;
m_ShipGlow.color = m_ShipGlowDefaultColor;
m_IsBuffed = false;

Expand Down Expand Up @@ -152,8 +151,8 @@ public override void OnNetworkSpawn()
}
Energy.OnValueChanged += OnEnergyChanged;
Health.OnValueChanged += OnHealthChanged;
OnEnergyChanged(0, Health.Value);
OnHealthChanged(0, Energy.Value);
OnEnergyChanged(0, Energy.Value);
OnHealthChanged(0, Health.Value);

SetPlayerName(PlayerName.Value.ToString().ToUpper());
}
Expand Down Expand Up @@ -194,8 +193,7 @@ public void TakeDamage(int amount)

void Fire(Vector3 direction)
{
fireSound.Play();

PlayFireSoundClientRpc();
var damage = 5;
if (QuadDamageTimer.Value > NetworkManager.ServerTime.TimeAsFloat)
{
Expand Down Expand Up @@ -271,15 +269,15 @@ void UpdateServer()
m_Rigidbody2D.angularVelocity = rotate;

// update thrust
if (m_Thrusting.Value != 0)
if (m_Thrust != 0)
{
float accel = m_Acceleration;
if (SpeedBuffTimer.Value > NetworkManager.ServerTime.TimeAsFloat)
{
accel *= 2;
}

Vector3 thrustVec = transform.right * (m_Thrusting.Value * accel);
Vector3 thrustVec = transform.right * (m_Thrust * accel);
m_Rigidbody2D.AddForce(thrustVec);

// restrict max speed
Expand Down Expand Up @@ -499,12 +497,19 @@ void OnCollisionEnter2D(Collision2D other)
}
}

// --- ClientRPCs ---

[ClientRpc]
void PlayFireSoundClientRpc()
{
fireSound.Play();
}
// --- ServerRPCs ---

[ServerRpc]
public void ThrustServerRpc(float thrusting, int spin)
{
m_Thrusting.Value = thrusting;
m_Thrust = thrusting;
m_Spin = spin;
}

Expand Down
16 changes: 8 additions & 8 deletions Basic/2DSpaceShooter/Packages/manifest.json
@@ -1,18 +1,18 @@
{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"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.ai.navigation": "1.1.5",
"com.unity.collab-proxy": "2.2.0",
"com.unity.ide.rider": "3.0.26",
"com.unity.ide.visualstudio": "2.0.22",
"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.3.0",
"com.unity.netcode.gameobjects": "1.6.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.4.0",
"com.unity.netcode.gameobjects": "1.7.1",
"com.unity.postprocessing": "3.2.2",
"com.unity.render-pipelines.universal": "14.0.8",
"com.unity.render-pipelines.universal": "14.0.9",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.5",
"com.unity.timeline": "1.7.6",
"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

0 comments on commit 4787992

Please sign in to comment.