Skip to content

Commit

Permalink
add headset to items, fix loadout
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat committed Jul 22, 2023
1 parent 3151134 commit 7c29e54
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 126 deletions.
8 changes: 8 additions & 0 deletions Assets/Content/Addressables/AssetGroups/Items.asset
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ MonoBehaviour:
m_Address: Assets/Content/WorldObjects/Items/Clothes/JumpsuitSecurity.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: f549f4153ef612c4586c46ea280e0e94
m_Address: Assets/Content/WorldObjects/Items/Clothes/HeadsetLeft.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 1a2f912be4bc1b948a2b22ffde517cdc
m_Address: Assets/Content/WorldObjects/Items/Clothes/HeadsetRight.prefab
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
81 changes: 0 additions & 81 deletions Assets/Content/Addressables/link.xml

This file was deleted.

7 changes: 0 additions & 7 deletions Assets/Content/Addressables/link.xml.meta

This file was deleted.

2 changes: 2 additions & 0 deletions Assets/Content/Data/Items.asset
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ MonoBehaviour:
- {fileID: 60374868058361228, guid: 4b790b4ffedbe564dab49f896d71eaa6, type: 3}
- {fileID: 2653363475000095017, guid: d7d68992cbd3cda45bb11a35a1490dc3, type: 3}
- {fileID: 726792282085660869, guid: 4635651592391df41b6b2413afdb76c3, type: 3}
- {fileID: 7723921361698481624, guid: f549f4153ef612c4586c46ea280e0e94, type: 3}
- {fileID: 8712940276313799639, guid: 1a2f912be4bc1b948a2b22ffde517cdc, type: 3}
28 changes: 14 additions & 14 deletions Assets/Content/Data/Roles/Loadouts/AssistantLoadout.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ MonoBehaviour:
RightHand: 0
LeftPocket: 0
RightPocket: 0
LeftGlove: 0
RightGlove: 0
LeftShoe: 0
RightShoe: 0
Hat: 0
LeftGlove: 1
RightGlove: 1
LeftShoe: 1
RightShoe: 1
Hat: 1
Glasses: 0
LeftEar: 0
RightEar: 0
Jumpsuit: 0
RightEar: 1
Jumpsuit: 1
LeftHandItem: 0
RightHandItem: 0
LeftPocketItem: 0
RightPocketItem: 0
LeftGloveItem: 0
RightGloveItem: 0
LeftShoeItem: 0
RightShoeItem: 0
HatItem: 0
LeftGloveItem: 32
RightGloveItem: 33
LeftShoeItem: 37
RightShoeItem: 38
HatItem: 29
GlassesItem: 0
LeftEarItem: 0
RightEarItem: 0
JumpsuitItem: 0
RightEarItem: 43
JumpsuitItem: 36
34 changes: 26 additions & 8 deletions Assets/Content/Data/Roles/Loadouts/SecurityLoadout.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,29 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9fbd6da0c74d76746b141068081e0dc3, type: 3}
m_Name: SecurityLoadout
m_EditorClassIdentifier:
leftHand: 1
rightHand: 1
leftPocket: 0
rightPocket: 0
leftHandItem: 0
rightHandItem: 1
leftPocketItem: 0
rightPocketItem: 0
LeftHand: 0
RightHand: 0
LeftPocket: 0
RightPocket: 0
LeftGlove: 1
RightGlove: 1
LeftShoe: 1
RightShoe: 1
Hat: 1
Glasses: 0
LeftEar: 0
RightEar: 1
Jumpsuit: 1
LeftHandItem: 30
RightHandItem: 0
LeftPocketItem: 0
RightPocketItem: 0
LeftGloveItem: 32
RightGloveItem: 33
LeftShoeItem: 37
RightShoeItem: 38
HatItem: 29
GlassesItem: 0
LeftEarItem: 0
RightEarItem: 43
JumpsuitItem: 41
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 1640526673506620826, guid: fca31db1818708c40a396f6faa3ee993, type: 3}
- {fileID: 2100000, guid: 695c4de41b9578049a93f19b1eef7213, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/SS3D/Data/Enums/ItemId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public enum ItemId
ShoesJackbootsLeft = 39,
ShoesJackbootsRight = 40,
JumpsuitSecurity = 41,
HeadsetLeft = 42,
HeadsetRight = 43,
}
}

43 changes: 29 additions & 14 deletions Assets/Scripts/SS3D/Systems/Roles/Editor/RoleLoadoutEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,32 @@ public class RoleLoadoutEditor : Editor
{
private RoleLoadout roleLoadout;

public void OnEnable()
private SerializedProperty sp;

public void OnEnable()
{
roleLoadout = (RoleLoadout)target;
}

public override void OnInspectorGUI()
{
roleLoadout.LeftHand = EditorGUILayout.Toggle("Left Hand", roleLoadout.LeftHand);
roleLoadout.RightHand = EditorGUILayout.Toggle("Right Hand", roleLoadout.RightHand);
roleLoadout.LeftPocket = EditorGUILayout.Toggle("Left Pocket", roleLoadout.LeftPocket);
roleLoadout.RightPocket = EditorGUILayout.Toggle("Right Pocket", roleLoadout.RightPocket);
roleLoadout.LeftGlove = EditorGUILayout.Toggle("Left Glove", roleLoadout.LeftGlove);
roleLoadout.RightGlove = EditorGUILayout.Toggle("Right Glove", roleLoadout.RightGlove);
roleLoadout.LeftShoe = EditorGUILayout.Toggle("Left Shoe", roleLoadout.LeftShoe);
roleLoadout.RightShoe = EditorGUILayout.Toggle("Right Shoe", roleLoadout.RightShoe);
roleLoadout.Jumpsuit = EditorGUILayout.Toggle("Jumpsuit", roleLoadout.Jumpsuit);
roleLoadout.Glasses = EditorGUILayout.Toggle("Glasses", roleLoadout.Glasses);
roleLoadout.LeftEar = EditorGUILayout.Toggle("LeftEar", roleLoadout.LeftEar);
roleLoadout.RightEar = EditorGUILayout.Toggle("RightEar", roleLoadout.RightEar);
roleLoadout.Hat = EditorGUILayout.Toggle("Hat", roleLoadout.Hat);


serializedObject.Update();

HandleBools("LeftHand", roleLoadout.LeftHand);
HandleBools("RightHand", roleLoadout.RightHand);
HandleBools("LeftPocket", roleLoadout.LeftPocket);
HandleBools("RightPocket", roleLoadout.RightPocket);
HandleBools("LeftGlove", roleLoadout.LeftGlove);
HandleBools("RightGlove", roleLoadout.RightGlove);
HandleBools("LeftShoe", roleLoadout.LeftShoe);
HandleBools("RightShoe", roleLoadout.RightShoe);
HandleBools("Jumpsuit", roleLoadout.Jumpsuit);
HandleBools("Glasses", roleLoadout.Glasses);
HandleBools("LeftEar", roleLoadout.LeftEar);
HandleBools("RightEar", roleLoadout.RightEar);
HandleBools("Hat", roleLoadout.Hat);

if (roleLoadout.LeftHand)
{
Expand Down Expand Up @@ -111,4 +117,13 @@ public override void OnInspectorGUI()
EnumPopup("Glasses Item:", roleLoadout.GlassesItem);
}
}

public void HandleBools(string name, bool loadContainer)
{
sp = serializedObject.FindProperty(name);
sp.boolValue = EditorGUILayout.Toggle(name, loadContainer);
serializedObject.ApplyModifiedProperties();
}


}
8 changes: 7 additions & 1 deletion Assets/Scripts/SS3D/Systems/Roles/RoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,13 @@ private void SpawnLoadoutItems(Entity entity, RoleLoadout loadout)
if (!inventory.TryGetTypeContainer(ContainerType.Pocket, 1, out AttachedContainer rightPocketContainer)) return;
SpawnItemInSlot(loadout.RightPocketItem, loadout.RightPocket, rightPocketContainer);

}
if (!inventory.TryGetTypeContainer(ContainerType.EarRight, 0, out AttachedContainer EarRightContainer)) return;
SpawnItemInSlot(loadout.RightEarItem, loadout.RightEar, EarRightContainer);

if (!inventory.TryGetTypeContainer(ContainerType.EarLeft, 0, out AttachedContainer EarLeftContainer)) return;
SpawnItemInSlot(loadout.LeftEarItem, loadout.LeftEar, EarLeftContainer);

}

/// <summary>
/// Spawns an item inside a container slot after checking for boolean
Expand Down

0 comments on commit 7c29e54

Please sign in to comment.