first commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract
|
||||
{
|
||||
public interface IEquipmentVisibilityHandler
|
||||
{
|
||||
void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment);
|
||||
}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class DiveSuitVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject head;
|
||||
private readonly GameObject body;
|
||||
private readonly GameObject hands;
|
||||
|
||||
public DiveSuitVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
head = playerModel.transform.Find(PlayerEquipmentConstants.NORMAL_HEAD_GAME_OBJECT_NAME).gameObject;
|
||||
body = playerModel.transform.Find(PlayerEquipmentConstants.DIVE_SUIT_GAME_OBJECT_NAME).gameObject;
|
||||
hands = playerModel.transform.Find(PlayerEquipmentConstants.NORMAL_HANDS_GAME_OBJECT_NAME).gameObject;
|
||||
}
|
||||
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool headVisible = !currentEquipment.Contains(TechType.RadiationHelmet) && !currentEquipment.Contains(TechType.Rebreather);
|
||||
bool bodyVisible = !currentEquipment.Contains(TechType.RadiationSuit) &&
|
||||
!currentEquipment.Contains(TechType.WaterFiltrationSuit) &&
|
||||
!currentEquipment.Contains(TechType.ReinforcedDiveSuit);
|
||||
bool handsVisible = !currentEquipment.Contains(TechType.RadiationGloves) && !currentEquipment.Contains(TechType.ReinforcedGloves);
|
||||
|
||||
head.SetActive(headVisible);
|
||||
body.gameObject.SetActive(bodyVisible);
|
||||
hands.SetActive(handsVisible);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class FinsVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject fins;
|
||||
private readonly GameObject finsRoot;
|
||||
private readonly GameObject chargedFins;
|
||||
private readonly GameObject chargedFinsRoot;
|
||||
private readonly GameObject glideFins;
|
||||
private readonly GameObject glideFinsRoot;
|
||||
|
||||
public FinsVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
fins = playerModel.transform.Find(PlayerEquipmentConstants.FINS_GAME_OBJECT_NAME).gameObject;
|
||||
finsRoot = playerModel.transform.Find(PlayerEquipmentConstants.FINS_ROOT_GAME_OBJECT_NAME).gameObject;
|
||||
chargedFins = playerModel.transform.Find(PlayerEquipmentConstants.CHARGED_FINS_GAME_OBJECT_NAME).gameObject;
|
||||
chargedFinsRoot = playerModel.transform.Find(PlayerEquipmentConstants.CHARGED_FINS_ROOT_GAME_OBJECT_NAME).gameObject;
|
||||
glideFins = playerModel.transform.Find(PlayerEquipmentConstants.GLIDE_FINS_GAME_OBJECT_NAME).gameObject;
|
||||
glideFinsRoot = playerModel.transform.Find(PlayerEquipmentConstants.GLIDE_FINS_ROOT_GAME_OBJECT_NAME).gameObject;
|
||||
}
|
||||
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool basicFinsVisible = currentEquipment.Contains(TechType.Fins);
|
||||
bool chargedFinsVisible = currentEquipment.Contains(TechType.SwimChargeFins);
|
||||
bool glideFinsVisible = currentEquipment.Contains(TechType.UltraGlideFins);
|
||||
|
||||
fins.SetActive(basicFinsVisible);
|
||||
finsRoot.SetActive(basicFinsVisible);
|
||||
chargedFins.SetActive(chargedFinsVisible);
|
||||
chargedFinsRoot.SetActive(chargedFinsVisible);
|
||||
glideFins.SetActive(glideFinsVisible);
|
||||
glideFinsRoot.SetActive(glideFinsVisible);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class RadiationSuitVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject head;
|
||||
private readonly GameObject helmet;
|
||||
private readonly GameObject gloves;
|
||||
private readonly GameObject suit;
|
||||
private readonly GameObject suitNeck;
|
||||
private readonly GameObject suitVest;
|
||||
private readonly GameObject tank;
|
||||
private readonly GameObject tankTubes;
|
||||
|
||||
public RadiationSuitVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
head = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_HEAD_GAME_OBJECT_NAME).gameObject;
|
||||
helmet = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_HELMET_GAME_OBJECT_NAME).gameObject;
|
||||
gloves = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_GLOVES_GAME_OBJECT_NAME).gameObject;
|
||||
suit = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_SUIT_GAME_OBJECT_NAME).gameObject;
|
||||
suitNeck = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_SUIT_NECK_CLASP_GAME_OBJECT_NAME).gameObject;
|
||||
suitVest = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_SUIT_VEST_GAME_OBJECT_NAME).gameObject;
|
||||
tank = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_TANK_GAME_OBJECT_NAME).gameObject;
|
||||
tankTubes = playerModel.transform.Find(PlayerEquipmentConstants.RADIATION_TANK_TUBES_GAME_OBJECT_NAME).gameObject;
|
||||
|
||||
}
|
||||
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool tankEquipped = currentEquipment.Contains(TechType.Tank) ||
|
||||
currentEquipment.Contains(TechType.DoubleTank) ||
|
||||
currentEquipment.Contains(TechType.HighCapacityTank) ||
|
||||
currentEquipment.Contains(TechType.PlasteelTank);
|
||||
|
||||
bool helmetVisible = currentEquipment.Contains(TechType.RadiationHelmet);
|
||||
bool glovesVisible = currentEquipment.Contains(TechType.RadiationGloves);
|
||||
bool bodyVisible = currentEquipment.Contains(TechType.RadiationSuit);
|
||||
bool vestVisible = bodyVisible || helmetVisible;
|
||||
bool tankVisible = tankEquipped && vestVisible;
|
||||
bool tubesVisible = tankVisible && helmetVisible;
|
||||
|
||||
head.SetActive(helmetVisible);
|
||||
helmet.SetActive(helmetVisible);
|
||||
gloves.SetActive(glovesVisible);
|
||||
suit.SetActive(bodyVisible);
|
||||
suitNeck.SetActive(helmetVisible);
|
||||
suitVest.SetActive(vestVisible);
|
||||
tank.SetActive(tankVisible);
|
||||
tankTubes.SetActive(tubesVisible);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class ReinforcedSuitVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject gloves;
|
||||
private readonly GameObject suit;
|
||||
|
||||
public ReinforcedSuitVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
gloves = playerModel.transform.Find(PlayerEquipmentConstants.REINFORCED_GLOVES_GAME_OBJECT_NAME).gameObject;
|
||||
suit = playerModel.transform.Find(PlayerEquipmentConstants.REINFORCED_SUIT_GAME_OBJECT_NAME).gameObject;
|
||||
}
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool glovesVisible = currentEquipment.Contains(TechType.ReinforcedGloves);
|
||||
bool bodyVisible = currentEquipment.Contains(TechType.ReinforcedDiveSuit);
|
||||
|
||||
gloves.SetActive(glovesVisible);
|
||||
suit.SetActive(bodyVisible);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class ScubaSuitVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject rebreather;
|
||||
private readonly GameObject scuba;
|
||||
private readonly GameObject scubaTank;
|
||||
private readonly GameObject scubaTankTubes;
|
||||
|
||||
public ScubaSuitVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
rebreather = playerModel.transform.Find(PlayerEquipmentConstants.REBREATHER_GAME_OBJECT_NAME).gameObject;
|
||||
scuba = playerModel.transform.Find(PlayerEquipmentConstants.SCUBA_ROOT_GAME_OBJECT_NAME).gameObject;
|
||||
scubaTank = playerModel.transform.Find(PlayerEquipmentConstants.SCUBA_TANK_GAME_OBJECT_NAME).gameObject;
|
||||
scubaTankTubes = playerModel.transform.Find(PlayerEquipmentConstants.SCUBA_TANK_TUBES_GAME_OBJECT_NAME).gameObject;
|
||||
}
|
||||
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool tankEquipped = currentEquipment.Contains(TechType.Tank) ||
|
||||
currentEquipment.Contains(TechType.DoubleTank) ||
|
||||
currentEquipment.Contains(TechType.HighCapacityTank) ||
|
||||
currentEquipment.Contains(TechType.PlasteelTank);
|
||||
|
||||
bool rebreatherVisible = currentEquipment.Contains(TechType.Rebreather);
|
||||
bool radiationHelmetVisible = currentEquipment.Contains(TechType.RadiationHelmet);
|
||||
bool tankVisible = tankEquipped && !currentEquipment.Contains(TechType.RadiationSuit);
|
||||
bool tubesVisible = (rebreatherVisible || radiationHelmetVisible) && tankVisible;
|
||||
bool rootVisible = rebreatherVisible || tankVisible;
|
||||
|
||||
rebreather.SetActive(rebreatherVisible);
|
||||
scuba.SetActive(rootVisible);
|
||||
scubaTank.SetActive(tankVisible);
|
||||
scubaTankTubes.SetActive(tubesVisible);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment.Abstract;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NitroxClient.GameLogic.PlayerLogic.PlayerModel.Equipment
|
||||
{
|
||||
public class StillSuitVisibilityHandler : IEquipmentVisibilityHandler
|
||||
{
|
||||
private readonly GameObject stillSuit;
|
||||
|
||||
public StillSuitVisibilityHandler(GameObject playerModel)
|
||||
{
|
||||
stillSuit = playerModel.transform.Find(PlayerEquipmentConstants.STILL_SUIT_GAME_OBJECT_NAME).gameObject;
|
||||
}
|
||||
public void UpdateEquipmentVisibility(ReadOnlyCollection<TechType> currentEquipment)
|
||||
{
|
||||
bool bodyVisible = currentEquipment.Contains(TechType.WaterFiltrationSuit);
|
||||
|
||||
stillSuit.SetActive(bodyVisible);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user