Skip to content

Commit 794ee92

Browse files
Coding-HenJannify
andcommitted
Fixed resource asset parsing
Co-authored-by: Jannify <[email protected]>
1 parent baae2a9 commit 794ee92

File tree

74 files changed

+1199
-162
lines changed

Some content is hidden

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

74 files changed

+1199
-162
lines changed

Nitrox.BuildTool/Program.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Diagnostics;
33
using System.IO;
44
using System.Reflection;
@@ -22,7 +22,11 @@ public static class Program
2222

2323
public static string GeneratedOutputDir => Path.Combine(ProcessDir, "generated_files");
2424

25+
#if BELOWZERO
26+
private const int LEGACY_BRANCH_SUBNAUTICA_VERSION = 49370;
27+
#elif SUBNAUTICA
2528
private const int LEGACY_BRANCH_SUBNAUTICA_VERSION = 68598;
29+
#endif
2630

2731
public static async Task Main(string[] args)
2832
{
@@ -58,7 +62,11 @@ private static void LogError(string message)
5862

5963
private static void AbortIfInvalidGameVersion(GameInstallData game)
6064
{
65+
#if BELOWZERO
66+
string gameVersionFile = Path.Combine(game.InstallDir, "SubnauticaZero_Data", "StreamingAssets", "SNUnmanagedData", "plastic_status.ignore");
67+
#elif SUBNAUTICA
6168
string gameVersionFile = Path.Combine(game.InstallDir, "Subnautica_Data", "StreamingAssets", "SNUnmanagedData", "plastic_status.ignore");
69+
#endif
6270
if (!File.Exists(gameVersionFile))
6371
{
6472
return;

Nitrox.Test/Patcher/Patches/Dynamic/Builder_TryPlace_PatchTest.cs

+5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public class Builder_TryPlace_PatchTest
1414
public void Sanity()
1515
{
1616
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(Builder_TryPlace_Patch.TARGET_METHOD);
17+
#if SUBNAUTICA
1718
IEnumerable<CodeInstruction> transformedIl = Builder_TryPlace_Patch.Transpiler(null, originalIl);
1819
originalIl.Count().Should().Be(transformedIl.Count() - (Builder_TryPlace_Patch.InstructionsToAdd1.Count + Builder_TryPlace_Patch.InstructionsToAdd2.Count));
20+
#elif BELOWZERO
21+
IEnumerable<CodeInstruction> transformedIl = Builder_TryPlace_Patch.Transpiler(null, originalIl, Builder_TryPlace_Patch.TARGET_METHOD.GetILGenerator());
22+
originalIl.Count().Should().Be(transformedIl.Count() - 4);
23+
#endif
1924
}
2025
}

Nitrox.Test/Server/Serialization/WorldPersistenceTest.cs

+2
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,12 @@ private static void EntityTest(Entity entity, Entity entityAfter)
397397
case BuildEntity buildEntity when globalRootEntityAfter is BuildEntity buildEntityAfter:
398398
Assert.AreEqual(buildEntity.BaseData, buildEntityAfter.BaseData);
399399
break;
400+
#if SUBNAUTICA
400401
case EscapePodWorldEntity escapePodWorldEntity when globalRootEntityAfter is EscapePodWorldEntity escapePodWorldEntityAfter:
401402
Assert.AreEqual(escapePodWorldEntity.Damaged, escapePodWorldEntityAfter.Damaged);
402403
Assert.IsTrue(escapePodWorldEntity.Players.SequenceEqual(escapePodWorldEntityAfter.Players));
403404
break;
405+
#endif
404406
case InteriorPieceEntity interiorPieceEntity when globalRootEntityAfter is InteriorPieceEntity interiorPieceEntityAfter:
405407
Assert.AreEqual(interiorPieceEntity.BaseFace, interiorPieceEntityAfter.BaseFace);
406408
break;

NitroxClient/GameLogic/Entities.cs

+2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public Entities(IPacketSender packetSender, ThrottledPacketSender throttledPacke
5656
entitySpawnersByType[typeof(WorldEntity)] = new WorldEntitySpawner(entityMetadataManager, playerManager, localPlayer, this, simulationOwnership);
5757
entitySpawnersByType[typeof(PlaceholderGroupWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
5858
entitySpawnersByType[typeof(PrefabPlaceholderEntity)] = entitySpawnersByType[typeof(WorldEntity)];
59+
#if SUBNAUTICA
5960
entitySpawnersByType[typeof(EscapePodWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
61+
#endif
6062
entitySpawnersByType[typeof(PlayerWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
6163
entitySpawnersByType[typeof(VehicleWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];
6264
entitySpawnersByType[typeof(SerializedWorldEntity)] = entitySpawnersByType[typeof(WorldEntity)];

NitroxClient/GameLogic/HUD/PlayerListTab.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ public class PlayerListTab : NitroxPDATab
1414
public override PDATab FallbackTabIcon => PDATab.Inventory;
1515

1616
public override uGUI_PDATab uGUI_PDATab => tab;
17-
17+
#if SUBNAUTICA
1818
public override PDATab PDATabId => (PDATab)8;
19+
#elif BELOWZERO
20+
public override PDATab PDATabId => (PDATab)9;
21+
#endif
1922

2023
public override void OnInitializePDA(uGUI_PDA uGUI_PDA)
2124
{

NitroxClient/GameLogic/LiveMixinManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public bool ShouldApplyNextHealthUpdate(LiveMixin receiver, GameObject dealer =
6666
vehicleDockingBay.interpolatingVehicle == dealerVehicle ||
6767
vehicleDockingBay.nearbyVehicle == dealerVehicle)
6868
#elif BELOWZERO
69-
if (vehicleDockingBay.GetDockedObject() == dealerVehicle ||
70-
vehicleDockingBay.interpolatingDockable == dealerVehicle ||
69+
if (vehicleDockingBay.GetDockedObject().vehicle == dealerVehicle ||
70+
vehicleDockingBay.interpolatingDockable.vehicle == dealerVehicle ||
7171
vehicleDockingBay.nearbyDockable.vehicle == dealerVehicle)
7272
#endif
7373
{

NitroxClient/GameLogic/LocalPlayer.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ public LocalPlayer(IMultiplayerSession multiplayerSession, IPacketSender packetS
4646
this.packetSender = packetSender;
4747
this.throttledPacketSender = throttledPacketSender;
4848
body = new Lazy<GameObject>(() => Player.main.RequireGameObject("body"));
49+
#if SUBNAUTICA
4950
playerModel = new Lazy<GameObject>(() => Body.RequireGameObject("player_view"));
51+
#elif BELOWZERO
52+
playerModel = new Lazy<GameObject>(() => Body.RequireGameObject("player_view_female"));
53+
#endif
5054
bodyPrototype = new Lazy<GameObject>(CreateBodyPrototype);
5155
Permissions = Perms.PLAYER;
5256
}
@@ -112,14 +116,15 @@ public void BroadcastSubrootChange(Optional<NitroxId> subrootId)
112116
packetSender.Send(new SubRootChanged(PlayerId.Value, subrootId));
113117
}
114118
}
115-
119+
#if SUBNAUTICA
116120
public void BroadcastEscapePodChange(Optional<NitroxId> escapePodId)
117121
{
118122
if (PlayerId.HasValue)
119123
{
120124
packetSender.Send(new EscapePodChanged(PlayerId.Value, escapePodId));
121125
}
122126
}
127+
#endif
123128

124129
public void BroadcastWeld(NitroxId id, float healthAdded) => packetSender.Send(new WeldAction(id, healthAdded));
125130

@@ -151,7 +156,11 @@ private GameObject CreateBodyPrototype()
151156
clone.name = "RemotePlayerPrototype";
152157

153158
// Removing items that are held in hand
159+
#if SUBNAUTICA
154160
foreach (Transform child in clone.transform.Find($"player_view/{PlayerEquipmentConstants.ITEM_ATTACH_POINT_GAME_OBJECT_NAME}"))
161+
#elif BELOWZERO
162+
foreach (Transform child in clone.transform.Find($"player_view_female/{PlayerEquipmentConstants.ITEM_ATTACH_POINT_GAME_OBJECT_NAME}"))
163+
#endif
155164
{
156165
if (!child.gameObject.name.Contains("attach1_"))
157166
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#if BELOWZERO
2+
using System;
3+
using System.Collections.Generic;
4+
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
5+
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
6+
using NitroxClient.Unity.Helper;
7+
using NitroxModel_Subnautica.DataStructures;
8+
using UnityEngine;
9+
using static NitroxClient.GameLogic.PlayerLogic.PlayerModel.PlayerEquipmentConstants;
10+
11+
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap
12+
{
13+
public class ColdProtectiveSuitColorSwapManager : IColorSwapManager
14+
{
15+
public Action<ColorSwapAsyncOperation> CreateColorSwapTask(INitroxPlayer nitroxPlayer)
16+
{
17+
GameObject playerModel = nitroxPlayer.PlayerModel;
18+
Color playerColor = nitroxPlayer.PlayerSettings.PlayerColor.ToUnity();
19+
IColorSwapStrategy colorSwapStrategy = new HueSwapper(playerColor);
20+
21+
SkinnedMeshRenderer coldProtectiveHeadRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_HEAD_GAME_OBJECT_NAME);
22+
coldProtectiveHeadRenderer.material.ApplyClonedTexture();
23+
24+
SkinnedMeshRenderer coldProtectiveMaskRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_MASK_GAME_OBJECT_NAME);
25+
coldProtectiveMaskRenderer.material.ApplyClonedTexture();
26+
27+
SkinnedMeshRenderer coldProtectiveSuitRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_BODY_GAME_OBJECT_NAME);
28+
coldProtectiveSuitRenderer.material.ApplyClonedTexture();
29+
coldProtectiveSuitRenderer.materials[1].ApplyClonedTexture();
30+
31+
SkinnedMeshRenderer coldProtectiveHandsRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_HANDS_GAME_OBJECT_NAME);
32+
coldProtectiveHandsRenderer.material.ApplyClonedTexture();
33+
34+
Color[] headTexturePixels = coldProtectiveHeadRenderer.material.GetMainTexturePixels();
35+
Color[] maskTexturePixels = coldProtectiveMaskRenderer.material.GetMainTexturePixels();
36+
Color[] suitTexturePixels = coldProtectiveSuitRenderer.material.GetMainTexturePixels();
37+
Color[] armsTexturePixels = coldProtectiveSuitRenderer.materials[1].GetMainTexturePixels();
38+
Color[] handsTexturePixels = coldProtectiveHandsRenderer.material.GetMainTexturePixels();
39+
40+
return operation =>
41+
{
42+
HsvSwapper coldProtectiveSuitFilter = new HsvSwapper(colorSwapStrategy);
43+
coldProtectiveSuitFilter.SetHueRange(0f, 20f);
44+
coldProtectiveSuitFilter.SetSaturationRange(45f, 100f);
45+
coldProtectiveSuitFilter.SwapColors(headTexturePixels);
46+
coldProtectiveSuitFilter.SwapColors(maskTexturePixels);
47+
coldProtectiveSuitFilter.SwapColors(suitTexturePixels);
48+
coldProtectiveSuitFilter.SwapColors(armsTexturePixels);
49+
coldProtectiveSuitFilter.SwapColors(handsTexturePixels);
50+
operation.UpdateIndex(COLD_PROTECTIVE_HEAD_INDEX_KEY, headTexturePixels);
51+
operation.UpdateIndex(COLD_PROTECTIVE_MASK_INDEX_KEY, maskTexturePixels);
52+
operation.UpdateIndex(COLD_PROTECTIVE_BODY_INDEX_KEY, suitTexturePixels);
53+
operation.UpdateIndex(COLD_PROTECTIVE_ARMS_INDEX_KEY, armsTexturePixels);
54+
operation.UpdateIndex(COLD_PROTECTIVE_HANDS_INDEX_KEY, handsTexturePixels);
55+
};
56+
}
57+
58+
public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlayer nitroxPlayer)
59+
{
60+
Color[] headPixelIndexes = pixelIndex[COLD_PROTECTIVE_HEAD_INDEX_KEY];
61+
Color[] maskPixelIndexes = pixelIndex[COLD_PROTECTIVE_MASK_INDEX_KEY];
62+
Color[] suitPixelIndexes = pixelIndex[COLD_PROTECTIVE_BODY_INDEX_KEY];
63+
Color[] armsTexturePixels = pixelIndex[COLD_PROTECTIVE_ARMS_INDEX_KEY];
64+
Color[] handsPixelIndexes = pixelIndex[COLD_PROTECTIVE_HANDS_INDEX_KEY];
65+
66+
GameObject playerModel = nitroxPlayer.PlayerModel;
67+
68+
SkinnedMeshRenderer coldProtectiveHeadRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_HEAD_GAME_OBJECT_NAME);
69+
coldProtectiveHeadRenderer.material.UpdateMainTextureColors(headPixelIndexes);
70+
71+
SkinnedMeshRenderer coldProtectiveMaskRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_MASK_GAME_OBJECT_NAME);
72+
coldProtectiveMaskRenderer.material.UpdateMainTextureColors(maskPixelIndexes);
73+
74+
SkinnedMeshRenderer coldProtectiveSuitRenderer = playerModel.GetRenderer(COLD_PROTECTIVE_BODY_GAME_OBJECT_NAME);
75+
coldProtectiveSuitRenderer.material.UpdateMainTextureColors(suitPixelIndexes);
76+
coldProtectiveSuitRenderer.material.SetTexture("_MainTex", coldProtectiveSuitRenderer.material.mainTexture);
77+
coldProtectiveSuitRenderer.material.SetTexture("_SpecTex", coldProtectiveSuitRenderer.material.mainTexture);
78+
79+
coldProtectiveSuitRenderer.materials[1].UpdateMainTextureColors(armsTexturePixels);
80+
coldProtectiveSuitRenderer.materials[1].SetTexture("_MainTex", coldProtectiveSuitRenderer.materials[1].mainTexture);
81+
coldProtectiveSuitRenderer.materials[1].SetTexture("_SpecTex", coldProtectiveSuitRenderer.materials[1].mainTexture);
82+
83+
SkinnedMeshRenderer reinforcedHandsRenderer = playerModel.GetRenderer(REINFORCED_GLOVES_GAME_OBJECT_NAME);
84+
reinforcedHandsRenderer.material.UpdateMainTextureColors(handsPixelIndexes);
85+
}
86+
}
87+
}
88+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/FinColorSwapManager.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
44
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -20,11 +20,13 @@ public Action<ColorSwapAsyncOperation> CreateColorSwapTask(INitroxPlayer nitroxP
2020
SkinnedMeshRenderer basicFinRenderer = playerModel.GetRenderer(FINS_GAME_OBJECT_NAME);
2121
basicFinRenderer.material.ApplyClonedTexture();
2222

23+
#if SUBNAUTICA
2324
SkinnedMeshRenderer chargedFinRenderer = playerModel.GetRenderer(CHARGED_FINS_GAME_OBJECT_NAME);
2425
chargedFinRenderer.material.ApplyClonedTexture();
2526

2627
SkinnedMeshRenderer glideFinRenderer = playerModel.GetRenderer(GLIDE_FINS_GAME_OBJECT_NAME);
2728
glideFinRenderer.material.ApplyClonedTexture();
29+
#endif
2830

2931
//All fin models use the same texture.
3032
Color[] texturePixels = basicFinRenderer.material.GetMainTexturePixels();
@@ -50,7 +52,7 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
5052
basicFinRenderer.material.UpdateMainTextureColors(pixels);
5153
basicFinRenderer.material.SetTexture("_MainTex", basicFinRenderer.material.mainTexture);
5254
basicFinRenderer.material.SetTexture("_SpecTex", basicFinRenderer.material.mainTexture);
53-
55+
#if SUBNAUTICA
5456
SkinnedMeshRenderer chargedFinRenderer = playerModel.GetRenderer(CHARGED_FINS_GAME_OBJECT_NAME);
5557
chargedFinRenderer.material.UpdateMainTextureColors(pixels);
5658
chargedFinRenderer.material.SetTexture("_MainTex", chargedFinRenderer.material.mainTexture);
@@ -60,6 +62,7 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
6062
glideFinRenderer.material.UpdateMainTextureColors(pixels);
6163
glideFinRenderer.material.SetTexture("_MainTex", glideFinRenderer.material.mainTexture);
6264
glideFinRenderer.material.SetTexture("_SpecTex", glideFinRenderer.material.mainTexture);
65+
#endif
6366
}
6467
}
6568
}

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/RadiationHelmetColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -55,3 +56,4 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
5556
}
5657
}
5758
}
59+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/RadiationSuitColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -88,3 +89,4 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
8889
}
8990
}
9091
}
92+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/RadiationSuitVestColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -44,3 +45,4 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
4445
}
4546
}
4647
}
48+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/RadiationTankColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -46,3 +47,4 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
4647
}
4748
}
4849
}
50+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/RebreatherColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -66,3 +67,4 @@ private static void FixRebreatherMaterials(GameObject playerModel, SkinnedMeshRe
6667
}
6768
}
6869
}
70+
#endif

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/ReinforcedSuitColorSwapManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
44
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;

NitroxClient/GameLogic/PlayerLogic/PlayerModel/ColorSwap/ScubaTankColorSwapManager.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if SUBNAUTICA
2+
using System;
23
using System.Collections.Generic;
34
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Abstract;
45
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.ColorSwap.Strategy;
@@ -46,3 +47,4 @@ public void ApplyPlayerColor(Dictionary<string, Color[]> pixelIndex, INitroxPlay
4647
}
4748
}
4849
}
50+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#if BELOWZERO
2+
using System.Collections.ObjectModel;
3+
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
4+
using UnityEngine;
5+
6+
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
7+
{
8+
public class BaseVisibilityHandler : IEquipmentVisibilityHandler
9+
{
10+
private readonly GameObject gloves;
11+
private readonly GameObject mask;
12+
private readonly GameObject hands;
13+
private readonly GameObject head;
14+
private readonly GameObject body;
15+
16+
public BaseVisibilityHandler(GameObject playerModel)
17+
{
18+
gloves = playerModel.transform.Find(PlayerEquipmentConstants.BASE_GLOVES_GAME_OBJECT_NAME).gameObject;
19+
mask = playerModel.transform.Find(PlayerEquipmentConstants.BASE_MASK_GAME_OBJECT_NAME).gameObject;
20+
hands = playerModel.transform.Find(PlayerEquipmentConstants.BASE_HANDS_GAME_OBJECT_NAME).gameObject;
21+
head = playerModel.transform.Find(PlayerEquipmentConstants.BASE_HEAD_GAME_OBJECT_NAME).gameObject;
22+
body = playerModel.transform.Find(PlayerEquipmentConstants.BASE_BODY_GAME_OBJECT_NAME).gameObject;
23+
}
24+
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
25+
{
26+
bool headVisible = !currentEquipment.Contains(TechType.ColdSuitHelmet);
27+
bool maskVisible = currentEquipment.Contains(TechType.Rebreather);
28+
bool bodyVisible = !currentEquipment.Contains(TechType.ColdSuit);
29+
bool handsVisible = !currentEquipment.Contains(TechType.ColdSuitGloves);
30+
31+
gloves.SetActive(handsVisible);
32+
mask.SetActive(maskVisible);
33+
hands.SetActive(handsVisible);
34+
head.SetActive(headVisible);
35+
body.SetActive(bodyVisible);
36+
}
37+
}
38+
}
39+
#endif

0 commit comments

Comments
 (0)