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
45 changes: 31 additions & 14 deletions Basic/2DSpaceShooter/Assets/Scripts/Powerup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,14 @@ public override void OnNetworkSpawn()
{
OnStartServer();
}
Color buffColor = Buff.buffColors[(int)buffType.Value];
GetComponent<Renderer>().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()
Expand All @@ -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<Renderer>().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()
{
Expand Down
9 changes: 5 additions & 4 deletions Basic/2DSpaceShooter/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
55 changes: 30 additions & 25 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.burst": {
"version": "1.7.3",
"version": "1.8.2",
"depth": 1,
"source": "registry",
"dependencies": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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",
Expand All @@ -207,33 +205,33 @@
"url": "https://packages.unity.com"
},
"com.unity.services.qos": {
"version": "1.0.1",
"version": "1.1.0",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.4.0",
"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"
},
Expand All @@ -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"
}
},
Expand Down Expand Up @@ -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": {
Expand All @@ -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,
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: 2021.3.15f1
m_EditorVersionWithRevision: 2021.3.15f1 (e8e88683f834)
m_EditorVersion: 2021.3.18f1
m_EditorVersionWithRevision: 2021.3.18f1 (3129e69bc0c7)
8 changes: 0 additions & 8 deletions Basic/ClientDriven/Assets/StarterAssets/TutorialInfo.meta

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

Loading